rhmessaging commits: r3840 - store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2010-02-04 13:02:05 -0500 (Thu, 04 Feb 2010)
New Revision: 3840
Modified:
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h
Log:
Regenerated QMF files.
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2010-02-03 21:28:47 UTC (rev 3839)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2010-02-04 18:02:05 UTC (rev 3840)
@@ -514,6 +514,27 @@
}
+uint32_t Journal::writePropertiesSize() const
+{
+ uint32_t size = writeTimestampsSize();
+
+ size += 16; // queueRef
+ size += (1 + name.length()); // name
+ size += (1 + directory.length()); // directory
+ size += (1 + baseFileName.length()); // baseFileName
+ size += 4; // writePageSize
+ size += 4; // writePages
+ size += 4; // readPageSize
+ size += 4; // readPages
+ size += 2; // initialFileCount
+ size += 1; // autoExpand
+ size += 2; // currentFileCount
+ size += 2; // maxFileCount
+ size += 4; // dataFileSize
+
+ return size;
+}
+
void Journal::readProperties (Buffer& buf)
{
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
@@ -535,7 +556,7 @@
}
-void Journal::writeProperties (Buffer& buf)
+void Journal::writeProperties (Buffer& buf) const
{
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
configChanged = false;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2010-02-03 21:28:47 UTC (rev 3839)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2010-02-04 18:02:05 UTC (rev 3840)
@@ -128,19 +128,18 @@
void aggregatePerThreadStats(struct PerThreadStats*);
- // Private Methods
+ public:
static void writeSchema(::qpid::framing::Buffer& buf);
+ uint32_t writePropertiesSize() const;
void readProperties(::qpid::framing::Buffer& buf);
- void writeProperties(::qpid::framing::Buffer& buf);
- void writeStatistics(::qpid::framing::Buffer& buf,
- bool skipHeaders = false);
+ void writeProperties(::qpid::framing::Buffer& buf) const;
+ void writeStatistics(::qpid::framing::Buffer& buf, bool skipHeaders = false);
void doMethod(std::string& methodName,
::qpid::framing::Buffer& inBuf,
::qpid::framing::Buffer& outBuf);
std::string getKey() const;
writeSchemaCall_t getWriteSchemaCall() { return writeSchema; }
- public:
Journal(::qpid::management::ManagementAgent* agent,
::qpid::management::Manageable* coreObject);
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp 2010-02-03 21:28:47 UTC (rev 3839)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp 2010-02-04 18:02:05 UTC (rev 3840)
@@ -311,6 +311,25 @@
}
+uint32_t Store::writePropertiesSize() const
+{
+ uint32_t size = writeTimestampsSize();
+
+ size += 16; // brokerRef
+ size += (1 + location.length()); // location
+ size += 2; // defaultInitialFileCount
+ size += 4; // defaultDataFileSize
+ size += 1; // tplIsInitialized
+ size += (1 + tplDirectory.length()); // tplDirectory
+ size += 4; // tplWritePageSize
+ size += 4; // tplWritePages
+ size += 2; // tplInitialFileCount
+ size += 4; // tplDataFileSize
+ size += 4; // tplCurrentFileCount
+
+ return size;
+}
+
void Store::readProperties (Buffer& buf)
{
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
@@ -330,7 +349,7 @@
}
-void Store::writeProperties (Buffer& buf)
+void Store::writeProperties (Buffer& buf) const
{
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
configChanged = false;
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h 2010-02-03 21:28:47 UTC (rev 3839)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h 2010-02-04 18:02:05 UTC (rev 3840)
@@ -98,19 +98,18 @@
void aggregatePerThreadStats(struct PerThreadStats*);
- // Private Methods
+ public:
static void writeSchema(::qpid::framing::Buffer& buf);
+ uint32_t writePropertiesSize() const;
void readProperties(::qpid::framing::Buffer& buf);
- void writeProperties(::qpid::framing::Buffer& buf);
- void writeStatistics(::qpid::framing::Buffer& buf,
- bool skipHeaders = false);
+ void writeProperties(::qpid::framing::Buffer& buf) const;
+ void writeStatistics(::qpid::framing::Buffer& buf, bool skipHeaders = false);
void doMethod(std::string& methodName,
::qpid::framing::Buffer& inBuf,
::qpid::framing::Buffer& outBuf);
std::string getKey() const;
writeSchemaCall_t getWriteSchemaCall() { return writeSchema; }
- public:
Store(::qpid::management::ManagementAgent* agent,
::qpid::management::Manageable* coreObject, ::qpid::management::Manageable* _parent);
14 years, 10 months
rhmessaging commits: r3839 - in mgmt/trunk/cumin: python/cumin/inventory and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-02-03 16:28:47 -0500 (Wed, 03 Feb 2010)
New Revision: 3839
Modified:
mgmt/trunk/cumin/python/cumin/grid/pool.strings
mgmt/trunk/cumin/python/cumin/grid/slot.py
mgmt/trunk/cumin/python/cumin/inventory/system.strings
mgmt/trunk/cumin/resources/slots.swf
Log:
Fixed the label position on the flash slot vis.
Restored the transition animations.
Modified: mgmt/trunk/cumin/python/cumin/grid/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/pool.strings 2010-02-03 18:37:21 UTC (rev 3838)
+++ mgmt/trunk/cumin/python/cumin/grid/pool.strings 2010-02-03 21:28:47 UTC (rev 3839)
@@ -69,10 +69,15 @@
function updatePoolSlotVis(id, loadType) {
var chart = cumin.getFlashChart(id);
if ((chart != null) && (typeof chart.src != "undefined")) {
- if (typeof chart.load != "undefined")
- chart.load(chart.src, false);
- else
- wooly.log("load not definded for " + id);
+ if (typeof loadType != "undefined") {
+ if (typeof chart.reload != "undefined")
+ chart.reload(chart.src, false);
+ } else {
+ if (typeof chart.load != "undefined")
+ chart.load(chart.src, false);
+ else
+ wooly.log("load not defined for " + id);
+ }
}
}
function vis_loaded(data) {
Modified: mgmt/trunk/cumin/python/cumin/grid/slot.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/slot.py 2010-02-03 18:37:21 UTC (rev 3838)
+++ mgmt/trunk/cumin/python/cumin/grid/slot.py 2010-02-03 21:28:47 UTC (rev 3839)
@@ -305,8 +305,9 @@
for activityState in activityStates:
el = Element()
el.name = "slot_info"
- el.value = activityState
+ el.a_s = activityState
el.count = activityStates[activityState]
+ el.value = "%s.%s" % (records[plist[0]][groups[level-1]], activityState) # uid
level_list.append(el)
return level_list
Modified: mgmt/trunk/cumin/python/cumin/inventory/system.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/inventory/system.strings 2010-02-03 18:37:21 UTC (rev 3838)
+++ mgmt/trunk/cumin/python/cumin/inventory/system.strings 2010-02-03 21:28:47 UTC (rev 3839)
@@ -96,10 +96,15 @@
function updateSystemSlotVis(id, loadType) {
var chart = cumin.getFlashChart(id);
if ((chart != null) && (typeof chart.src != "undefined")) {
- if (typeof chart.load != "undefined")
- chart.load(chart.src, false);
- else
- wooly.log("load not definded for " + id);
+ if (typeof loadType != "undefined") {
+ if (typeof chart.reload != "undefined")
+ chart.reload(chart.src, false);
+ } else {
+ if (typeof chart.load != "undefined")
+ chart.load(chart.src, false);
+ else
+ wooly.log("load not defined for " + id);
+ }
}
}
function vis_loaded(data) {
Modified: mgmt/trunk/cumin/resources/slots.swf
===================================================================
(Binary files differ)
14 years, 10 months
rhmessaging commits: r3838 - in mgmt/trunk/cumin: python/cumin/grid and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-02-03 13:37:21 -0500 (Wed, 03 Feb 2010)
New Revision: 3838
Modified:
mgmt/trunk/cumin/python/cumin/OpenFlashChart.py
mgmt/trunk/cumin/python/cumin/grid/pool.strings
mgmt/trunk/cumin/python/cumin/grid/slot.py
mgmt/trunk/cumin/python/cumin/grid/slot.strings
mgmt/trunk/cumin/python/cumin/inventory/system.strings
mgmt/trunk/cumin/resources/slots.swf
Log:
Updates to flash slot vis to:
- handle no cjson or jjson module installed
- collapse systems and allow drill down when slots > 500
Modified: mgmt/trunk/cumin/python/cumin/OpenFlashChart.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/OpenFlashChart.py 2010-02-03 14:30:51 UTC (rev 3837)
+++ mgmt/trunk/cumin/python/cumin/OpenFlashChart.py 2010-02-03 18:37:21 UTC (rev 3838)
@@ -14,76 +14,76 @@
CJSON = False
JJSON = False
try:
- import cjson
- CJSON = True
+ import cjson
+ CJSON = True
except ImportError:
- try:
- import json
- JJSON = True
- except ImportError:
- pass
-import copy
+ try:
+ import json
+ JJSON = True
+ except ImportError:
+ pass
+import copy
class Chart(dict):
- # Dictionary for replacing attribute names
- replaceKeyDictionary = {
- "on_show": "on-show", "on_click": "on-click", "on_click_text": "on-click-text",
- "start_angle": "start-angle",
-
- "threeD": "3d", "tick_height": "tick-height",
- "grid_colour": "grid-colour", "tick_length": "tick-length",
-
- "dot_style": "dot-style", "dot_size": "dot-size",
- "halo_size": "halo-size",
-
- "line_style": "line-style", "outline_colour": "outline-colour",
- "fill_alpha": "fill-alpha", "gradient_fill": "gradient-fill",
- "visible_steps": "visible-steps",
- }
+ # Dictionary for replacing attribute names
+ replaceKeyDictionary = {
+ "on_show": "on-show", "on_click": "on-click", "on_click_text": "on-click-text",
+ "start_angle": "start-angle",
+
+ "threeD": "3d", "tick_height": "tick-height",
+ "grid_colour": "grid-colour", "tick_length": "tick-length",
+
+ "dot_style": "dot-style", "dot_size": "dot-size",
+ "halo_size": "halo-size",
+
+ "line_style": "line-style", "outline_colour": "outline-colour",
+ "fill_alpha": "fill-alpha", "gradient_fill": "gradient-fill",
+ "visible_steps": "visible-steps",
+ }
- # Redefine to allow for nested attributes.
- # E.g. when calling the leaf attribute, text, in chart.title.text
- # without previously defining the branch attribute, title.
- def __getattribute__(self, key):
- try:
- return dict.__getattribute__(self, key)
- except AttributeError:
- self.__dict__[key] = Chart()
- return dict.__getattribute__(self, key)
+ # Redefine to allow for nested attributes.
+ # E.g. when calling the leaf attribute, text, in chart.title.text
+ # without previously defining the branch attribute, title.
+ def __getattribute__(self, key):
+ try:
+ return dict.__getattribute__(self, key)
+ except AttributeError:
+ self.__dict__[key] = Chart()
+ return dict.__getattribute__(self, key)
- # This copy function is called when we want to get all the attributes of the
- # chart instance so we can pass it off to cjson to create the JSON string.
- # Recursive trick to get leaf attributes. Have to be careful of list types.
- # Also, replace certain underscored keys.
- # E.g. getting the leaf attribute, text, from the parent Chart instance where a
- # previous assignment was to chart.title.text
- def __copy__(self):
- attributes = dict()
- for key, value in self.__dict__.items():
- if isinstance(value, list):
- attributes[self.replaceKey(key)] = [copy.copy(item) for item in value]
- else:
- attributes[self.replaceKey(key)] = copy.copy(value)
- return attributes
+ # This copy function is called when we want to get all the attributes of the
+ # chart instance so we can pass it off to cjson to create the JSON string.
+ # Recursive trick to get leaf attributes. Have to be careful of list types.
+ # Also, replace certain underscored keys.
+ # E.g. getting the leaf attribute, text, from the parent Chart instance where a
+ # previous assignment was to chart.title.text
+ def __copy__(self):
+ attributes = dict()
+ for key, value in self.__dict__.items():
+ if isinstance(value, list):
+ attributes[self.replaceKey(key)] = [copy.copy(item) for item in value]
+ else:
+ attributes[self.replaceKey(key)] = copy.copy(value)
+ return attributes
- # If key has an underscore, replace with a dash.
- # Python does not allow dash in object names.
- def replaceKey(self, key):
- if (key in self.replaceKeyDictionary):
- return self.replaceKeyDictionary[key]
- else:
- return key
+ # If key has an underscore, replace with a dash.
+ # Python does not allow dash in object names.
+ def replaceKey(self, key):
+ if (key in self.replaceKeyDictionary):
+ return self.replaceKeyDictionary[key]
+ else:
+ return key
- # Encode the chart attributes as JSON
- def create(self):
- attributes = copy.copy(self)
- if CJSON:
- return cjson.encode(attributes)
- elif JJSON:
- return json.dumps(attributes)
- else:
- return str(attributes)
+ # Encode the chart attributes as JSON
+ def create(self):
+ attributes = copy.copy(self)
+ if CJSON:
+ return cjson.encode(attributes)
+ elif JJSON:
+ return json.dumps(attributes)
+ else:
+ return str(attributes).replace("': u'", "': '")
class Element(Chart):
- pass
\ No newline at end of file
+ pass
\ No newline at end of file
Modified: mgmt/trunk/cumin/python/cumin/grid/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/pool.strings 2010-02-03 14:30:51 UTC (rev 3837)
+++ mgmt/trunk/cumin/python/cumin/grid/pool.strings 2010-02-03 18:37:21 UTC (rev 3838)
@@ -69,15 +69,10 @@
function updatePoolSlotVis(id, loadType) {
var chart = cumin.getFlashChart(id);
if ((chart != null) && (typeof chart.src != "undefined")) {
- if (typeof loadType != "undefined") {
- if (typeof chart.reload != "undefined")
- chart.reload(chart.src, false);
- } else {
- if (typeof chart.load != "undefined")
- chart.load(chart.src, false);
- else
- wooly.log("load not definded for " + id);
- }
+ if (typeof chart.load != "undefined")
+ chart.load(chart.src, false);
+ else
+ wooly.log("load not definded for " + id);
}
}
function vis_loaded(data) {
@@ -96,6 +91,14 @@
updatePoolSlotVis('{id}ctrl');
}
}
+ function vis_expand(parent) {
+ var chart = cumin.getFlashChart("{id}");
+ var src = chart.src;
+ var branch = wooly.session.branch(src);
+ branch['expanded'] = parent;
+ chart.src = branch.marshal();
+ updatePoolSlotVis("{id}", "reload");
+ }
function vis_treemap_over(type, value) {
var chart = cumin.getFlashChart("{id}");
if (chart) {
Modified: mgmt/trunk/cumin/python/cumin/grid/slot.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/slot.py 2010-02-03 14:30:51 UTC (rev 3837)
+++ mgmt/trunk/cumin/python/cumin/grid/slot.py 2010-02-03 18:37:21 UTC (rev 3838)
@@ -155,6 +155,7 @@
shapes = ["rectangle", "circle", "circle"]
max_width = 400
max_png_age = 30
+ max_visible_slots = 500 # start drill-down mode after this number
def __init__(self, app, name, param, desc):
super(SlotMapPage, self).__init__(app, name)
@@ -171,6 +172,10 @@
self.json = Parameter(app, "json")
self.add_parameter(self.json)
+ self.expanded = Parameter(app, "expanded")
+ self.expanded.default = "all"
+ self.add_parameter(self.expanded)
+
group = Parameter(app, "agroup")
self.groups = ListParameter(app, "group", group)
self.add_parameter(self.groups)
@@ -241,6 +246,18 @@
d[atr].append(i)
return d
+ def get_activityStates(self, records, plist):
+ """ for each unique combination of activity:state, return a dictionary entry
+ that counts the number of records with that combo """
+
+ d = dict()
+ for i in plist:
+ activityState = "%s:%s" % (records[i]["activity"], records[i]["state"])
+ if not activityState in d:
+ d[activityState] = 0
+ d[activityState] += 1
+ return d
+
def render_json(self, session):
cursor = self.slots.execute(session)
records = cursor_to_rows(cursor)
@@ -257,15 +274,15 @@
root.slots = slot_count
root.vis = self.json.get(session)
root.activity_colors = self.interiors
+ expanded = self.expanded.get(session)
+ json = self.json.get(session)
leaves = True
- if self.json.get(session) == "slots":
- if slot_count > 1000:
- leaves = False
+ root.tree = self.treeify(records, range(slot_count), groups, 0,
+ expanded, leaves, slot_count, json)
- root.tree = self.treeify(records, range(slot_count), groups, 0, leaves)
return "[%s]" % root.create()
- def treeify(self, records, plist, groups, level, leaves):
+ def treeify(self, records, plist, groups, level, expanded, leaves, slot_count, json):
level_list = list()
# leaf
if level == len(groups):
@@ -282,11 +299,21 @@
el.name = "slot"
el.slot_id = records[i]["id"]
level_list.append(el)
+ else:
+ # display summary info for all the slots under this grouping
+ activityStates = self.get_activityStates(records, plist)
+ for activityState in activityStates:
+ el = Element()
+ el.name = "slot_info"
+ el.value = activityState
+ el.count = activityStates[activityState]
+ level_list.append(el)
return level_list
# not a leaf
group = groups[level]
level_dict = self.get_info_array(records, plist, group)
+ first = True
for key in sorted(level_dict):
el = Element()
el.name = group
@@ -294,7 +321,23 @@
el.slots = len(level_dict[key])
el.level = level
if level < len(groups):
- el.tree = self.treeify(records, level_dict[key], groups, level + 1, leaves)
+ if json == "slots":
+ if expanded == self.expanded.default:
+ # expand the 1st group if there are too many slots
+ if slot_count >= self.max_visible_slots:
+ if first:
+ leaves = True
+ first = False
+ else:
+ leaves = False
+ else:
+ leaves = True
+ elif expanded == key:
+ leaves = True
+ else:
+ leaves = False
+ el.tree = self.treeify(records, level_dict[key], groups, level + 1,
+ expanded, leaves, slot_count, json)
level_list.append(el)
return level_list
Modified: mgmt/trunk/cumin/python/cumin/grid/slot.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/slot.strings 2010-02-03 14:30:51 UTC (rev 3837)
+++ mgmt/trunk/cumin/python/cumin/grid/slot.strings 2010-02-03 18:37:21 UTC (rev 3838)
@@ -793,7 +793,6 @@
function vis_clicked(slot) {
go_to_slot(slot);
}
-
/* generic get value from cookie */
function get_cookie(name) {
return get_value(document.cookie, name, ";");
Modified: mgmt/trunk/cumin/python/cumin/inventory/system.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/inventory/system.strings 2010-02-03 14:30:51 UTC (rev 3837)
+++ mgmt/trunk/cumin/python/cumin/inventory/system.strings 2010-02-03 18:37:21 UTC (rev 3838)
@@ -96,15 +96,10 @@
function updateSystemSlotVis(id, loadType) {
var chart = cumin.getFlashChart(id);
if ((chart != null) && (typeof chart.src != "undefined")) {
- if (typeof loadType != "undefined") {
- if (typeof chart.reload != "undefined")
- chart.reload(chart.src, false);
- } else {
- if (typeof chart.load != "undefined")
- chart.load(chart.src, false);
- else
- wooly.log("load not definded for " + id);
- }
+ if (typeof chart.load != "undefined")
+ chart.load(chart.src, false);
+ else
+ wooly.log("load not definded for " + id);
}
}
function vis_loaded(data) {
Modified: mgmt/trunk/cumin/resources/slots.swf
===================================================================
(Binary files differ)
14 years, 10 months
rhmessaging commits: r3837 - store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2010-02-03 09:30:51 -0500 (Wed, 03 Feb 2010)
New Revision: 3837
Modified:
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp
store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h
Log:
Regenerated management components.
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2010-02-02 21:43:22 UTC (rev 3836)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.cpp 2010-02-03 14:30:51 UTC (rev 3837)
@@ -28,6 +28,7 @@
#include "Journal.h"
#include "ArgsJournalExpand.h"
+#include <iostream>
using namespace qmf::com::redhat::rhm::store;
using namespace qpid::framing;
@@ -513,6 +514,27 @@
}
+void Journal::readProperties (Buffer& buf)
+{
+ ::qpid::sys::Mutex::ScopedLock mutex(accessLock);
+ readTimestamps(buf);
+
+ queueRef.decode(buf);
+ buf.getShortString(name);
+ buf.getShortString(directory);
+ buf.getShortString(baseFileName);
+ writePageSize = buf.getLong();
+ writePages = buf.getLong();
+ readPageSize = buf.getLong();
+ readPages = buf.getLong();
+ initialFileCount = buf.getShort();
+ autoExpand = buf.getOctet()==1;
+ currentFileCount = buf.getShort();
+ maxFileCount = buf.getShort();
+ dataFileSize = buf.getLong();
+
+}
+
void Journal::writeProperties (Buffer& buf)
{
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
@@ -614,3 +636,12 @@
outBuf.putLong(status);
outBuf.putShortString(Manageable::StatusText(status, text));
}
+
+std::string Journal::getKey() const
+{
+ std::stringstream key;
+
+ key << name;
+ return key.str();
+}
+
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2010-02-02 21:43:22 UTC (rev 3836)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Journal.h 2010-02-03 14:30:51 UTC (rev 3837)
@@ -130,12 +130,14 @@
// Private Methods
static void writeSchema(::qpid::framing::Buffer& buf);
+ void readProperties(::qpid::framing::Buffer& buf);
void writeProperties(::qpid::framing::Buffer& buf);
void writeStatistics(::qpid::framing::Buffer& buf,
bool skipHeaders = false);
void doMethod(std::string& methodName,
::qpid::framing::Buffer& inBuf,
::qpid::framing::Buffer& outBuf);
+ std::string getKey() const;
writeSchemaCall_t getWriteSchemaCall() { return writeSchema; }
public:
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp 2010-02-02 21:43:22 UTC (rev 3836)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.cpp 2010-02-03 14:30:51 UTC (rev 3837)
@@ -27,6 +27,7 @@
#include "qpid/management/ManagementAgent.h"
#include "Store.h"
+#include <iostream>
using namespace qmf::com::redhat::rhm::store;
using namespace qpid::framing;
@@ -310,6 +311,25 @@
}
+void Store::readProperties (Buffer& buf)
+{
+ ::qpid::sys::Mutex::ScopedLock mutex(accessLock);
+ readTimestamps(buf);
+
+ brokerRef.decode(buf);
+ buf.getShortString(location);
+ defaultInitialFileCount = buf.getShort();
+ defaultDataFileSize = buf.getLong();
+ tplIsInitialized = buf.getOctet()==1;
+ buf.getShortString(tplDirectory);
+ tplWritePageSize = buf.getLong();
+ tplWritePages = buf.getLong();
+ tplInitialFileCount = buf.getShort();
+ tplDataFileSize = buf.getLong();
+ tplCurrentFileCount = buf.getLong();
+
+}
+
void Store::writeProperties (Buffer& buf)
{
::qpid::sys::Mutex::ScopedLock mutex(accessLock);
@@ -372,3 +392,12 @@
outBuf.putLong(status);
outBuf.putShortString(Manageable::StatusText(status, text));
}
+
+std::string Store::getKey() const
+{
+ std::stringstream key;
+
+ key << brokerRef.getV2Key();
+ return key.str();
+}
+
Modified: store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h
===================================================================
--- store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h 2010-02-02 21:43:22 UTC (rev 3836)
+++ store/trunk/cpp/lib/gen/qmf/com/redhat/rhm/store/Store.h 2010-02-03 14:30:51 UTC (rev 3837)
@@ -100,12 +100,14 @@
// Private Methods
static void writeSchema(::qpid::framing::Buffer& buf);
+ void readProperties(::qpid::framing::Buffer& buf);
void writeProperties(::qpid::framing::Buffer& buf);
void writeStatistics(::qpid::framing::Buffer& buf,
bool skipHeaders = false);
void doMethod(std::string& methodName,
::qpid::framing::Buffer& inBuf,
::qpid::framing::Buffer& outBuf);
+ std::string getKey() const;
writeSchemaCall_t getWriteSchemaCall() { return writeSchema; }
public:
14 years, 10 months
rhmessaging commits: r3836 - in mgmt/trunk/rosemary: python/rosemary and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-02-02 16:43:22 -0500 (Tue, 02 Feb 2010)
New Revision: 3836
Added:
mgmt/trunk/rosemary/python/rosemary/sqlmodel.py
Modified:
mgmt/trunk/rosemary/bin/rosemary-test
mgmt/trunk/rosemary/python/rosemary/model.py
Log:
Add modeling of sql objects and support for generating ddl
Modified: mgmt/trunk/rosemary/bin/rosemary-test
===================================================================
--- mgmt/trunk/rosemary/bin/rosemary-test 2010-02-01 20:42:03 UTC (rev 3835)
+++ mgmt/trunk/rosemary/bin/rosemary-test 2010-02-02 21:43:22 UTC (rev 3836)
@@ -4,10 +4,7 @@
from rosemary.model import *
from rosemary.sql import *
-if __name__ == "__main__":
- model = RosemaryModel()
- model.load_qmf_dir(os.path.join(os.environ["ROSEMARY_HOME"], "xml"))
-
+def do_model(args):
for package in model.packages:
print "package %s" % package.name
@@ -15,13 +12,11 @@
print " class %s" % cls.name
select = SelectObject(cls)
- print select.emit()
+ #print select.emit()
update = UpdateObject(cls)
- print update.emit()
+ #print update.emit()
- continue
-
for prop in cls.properties:
print " prop %s %s" % (prop.name, prop.title or "")
@@ -33,3 +28,13 @@
for arg in meth.arguments:
print " arg %s" % arg.name
+
+def do_schema(args):
+ model.sql_model.write_ddl(sys.stdout)
+
+if __name__ == "__main__":
+ model = RosemaryModel()
+ model.load_qmf_dir(os.path.join(os.environ["ROSEMARY_HOME"], "xml"))
+
+ #do_model(sys.argv)
+ do_schema(sys.argv)
Modified: mgmt/trunk/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/trunk/rosemary/python/rosemary/model.py 2010-02-01 20:42:03 UTC (rev 3835)
+++ mgmt/trunk/rosemary/python/rosemary/model.py 2010-02-02 21:43:22 UTC (rev 3836)
@@ -9,12 +9,15 @@
from elementtree.ElementTree import *
from sql import *
+from sqlmodel import *
class RosemaryModel(object):
def __init__(self):
self.packages = list()
self.packages_by_name = dict()
+ self.sql_model = SqlModel()
+
def load_qmf_dir(self, dir):
assert os.path.isdir(dir)
@@ -46,14 +49,15 @@
class RosemaryPackage(object):
def __init__(self, model, name):
self.model = model
-
self.name = name
+ self.model.packages.append(self)
+ self.model.packages_by_name[self.name] = self
+
self.classes = list()
self.classes_by_name = dict()
- self.model.packages.append(self)
- self.model.packages_by_name[self.name] = self
+ self.sql_schema = SqlSchema(self.model.sql_model, self.name)
def load(self, elem):
for child in elem.findall("class"):
@@ -65,12 +69,17 @@
cls = self.classes_by_name[child.get("name")]
cls.extend(child)
+ def init(self):
+ pass
+
class RosemaryClass(object):
def __init__(self, package, name):
self.package = package
-
self.name = name
+ self.package.classes.append(self)
+ self.package.classes_by_name[self.name] = self
+
self.properties = list()
self.properties_by_name = dict()
@@ -80,9 +89,11 @@
self.methods = list()
self.methods_by_name = dict()
- self.package.classes.append(self)
- self.package.classes_by_name[self.name] = self
+ stats_name = "%s_stats" % self.name
+ self.sql_table = SqlTable(self.package.sql_schema, self.name)
+ self.sql_stats_table = SqlTable(self.package.sql_schema, stats_name)
+
def load(self, elem):
for child in elem.findall("property"):
prop = RosemaryProperty(self, child.get("name"))
@@ -112,8 +123,11 @@
class RosemaryProperty(object):
def __init__(self, cls, name):
self.cls = cls
+ self.name = name
- self.name = name
+ self.cls.properties.append(self)
+ self.cls.properties_by_name[self.name] = self
+
self.title = None
self.type = None
self.references = None
@@ -123,8 +137,7 @@
self.is_optional = None
self.description = None
- self.cls.properties.append(self)
- self.cls.properties_by_name[self.name] = self
+ self.sql_column = SqlColumn(self.cls.sql_table, self.name)
def load(self, elem):
self.type = elem.get("type")
@@ -138,6 +151,9 @@
def extend(self, elem):
self.title = elem.findtext("title")
+ def init(self):
+ pass
+
class RosemaryStatistic(object):
def __init__(self, cls, name):
self.cls = cls
@@ -150,6 +166,8 @@
self.cls.statistics.append(self)
self.cls.statistics_by_name[self.name] = self
+ self.sql_column = SqlColumn(self.cls.sql_stats_table, self.name)
+
def load(self, elem):
self.type = elem.get("type")
self.unit = elem.get("unit")
@@ -158,6 +176,9 @@
def extend(self, elem):
pass
+ def init(self):
+ self.column = SqlColumn(self.cls.stats_table, self.name)
+
class RosemaryMethod(object):
def __init__(self, cls, name):
self.cls = cls
Added: mgmt/trunk/rosemary/python/rosemary/sqlmodel.py
===================================================================
--- mgmt/trunk/rosemary/python/rosemary/sqlmodel.py (rev 0)
+++ mgmt/trunk/rosemary/python/rosemary/sqlmodel.py 2010-02-02 21:43:22 UTC (rev 3836)
@@ -0,0 +1,72 @@
+from util import *
+
+class SqlModel(object):
+ def __init__(self):
+ self.schemas = list()
+ self.schemas_by_name = dict()
+
+ self.relations = list()
+ self.relations_by_name = dict()
+
+ def write_ddl(self, out):
+ for schema in self.schemas:
+ schema.write_ddl(out)
+
+class SqlSchema(object):
+ def __init__(self, model, name):
+ self.model = model
+ self.name = name
+
+ self.model.schemas.append(self)
+ self.model.schemas_by_name[self.name] = self
+
+ self.tables = list()
+ self.tables_by_name = dict()
+
+ def write_ddl(self, out):
+ out.write("create schema \"%s\"\n" % self.name)
+
+ for table in self.tables:
+ if table.columns:
+ table.write_ddl(out)
+
+ out.write(" ;\n")
+
+class SqlTable(object):
+ def __init__(self, schema, name):
+ self.schema = schema
+ self.name = name
+
+ self.schema.tables.append(self)
+ self.schema.tables_by_name[self.name] = self
+
+ self.columns = list()
+ self.columns_by_name = dict()
+
+ def write_ddl(self, out):
+ out.write(" create table \"%s\" (\n" % self.name)
+
+ exprs = list()
+
+ for column in self.columns:
+ exprs.append("\"%s\" text" % column.name)
+
+ out.write(" ")
+ out.write(",\n ".join(exprs))
+ out.write("\n )\n")
+
+class SqlColumn(object):
+ def __init__(self, table, name):
+ self.table = table
+ self.name = name
+
+ self.table.columns.append(self)
+ self.table.columns_by_name[self.name] = self
+
+class SqlRelation(object):
+ def __init__(self, model, name, columns):
+ self.name = name
+ self.columns = columns
+
+ self.model.relations.append(self)
+ self.model.relations_by_name[self.name] = self
14 years, 10 months
rhmessaging commits: r3835 - store/tags.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-02-01 15:42:03 -0500 (Mon, 01 Feb 2010)
New Revision: 3835
Added:
store/tags/qpid-0.5-release/
Log:
Make a tag for the 0.5 store release from r.3373
Copied: store/tags/qpid-0.5-release (from rev 3373, store/trunk)
14 years, 10 months