rhmessaging commits: r3118 - store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2009-02-13 10:13:27 -0500 (Fri, 13 Feb 2009)
New Revision: 3118
Modified:
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
Log:
Update to the change in the MessageFactory, such that all messages created via recovery so by id are created persistent
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2009-02-13 11:41:24 UTC (rev 3117)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2009-02-13 15:13:27 UTC (rev 3118)
@@ -1667,7 +1667,7 @@
else
{
- message = (PersistentAMQMessage) _messageFactory.createMessage(messageId, this, true);
+ message = (PersistentAMQMessage) _messageFactory.createMessage(messageId, this);
msgMap.put(messageId, message);
MessageMetaData mmd = getMessageMetaData(context, messageId);
15 years, 10 months
rhmessaging commits: r3117 - in store/branches/java/broker-queue-refactor/java/bdbstore/src: test/java/org/apache/qpid/server/store/berkeleydb and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2009-02-13 06:41:24 -0500 (Fri, 13 Feb 2009)
New Revision: 3117
Modified:
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreTest.java
Log:
Updates based on QPID-1628, QPID-1629 that remove the MessageHandles and the factory
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2009-02-11 13:45:15 UTC (rev 3116)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2009-02-13 11:41:24 UTC (rev 3117)
@@ -23,13 +23,20 @@
import com.sleepycat.bind.EntryBinding;
import com.sleepycat.bind.tuple.ByteBinding;
import com.sleepycat.bind.tuple.TupleBinding;
-
-import com.sleepycat.je.*;
-
+import com.sleepycat.je.CheckpointConfig;
+import com.sleepycat.je.Cursor;
+import com.sleepycat.je.Database;
+import com.sleepycat.je.DatabaseConfig;
+import com.sleepycat.je.DatabaseEntry;
+import com.sleepycat.je.DatabaseException;
+import com.sleepycat.je.Environment;
+import com.sleepycat.je.EnvironmentConfig;
+import com.sleepycat.je.LockMode;
+import com.sleepycat.je.OperationStatus;
+import com.sleepycat.je.Transaction;
+import com.sleepycat.je.TransactionConfig;
import org.apache.commons.configuration.Configuration;
-
import org.apache.log4j.Logger;
-
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.FieldTable;
@@ -37,15 +44,17 @@
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.queue.AMQMessage;
import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.MessageHandleFactory;
+import org.apache.qpid.server.queue.AMQQueueFactory;
+import org.apache.qpid.server.queue.MessageFactory;
import org.apache.qpid.server.queue.MessageMetaData;
+import org.apache.qpid.server.queue.PersistentAMQMessage;
import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueueFactory;
+import org.apache.qpid.server.queue.TransientAMQMessage;
import org.apache.qpid.server.store.MessageStore;
import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.store.berkeleydb.tuples.QueueTupleBindingFactory;
import org.apache.qpid.server.store.berkeleydb.tuples.BindingTupleBindingFactory;
import org.apache.qpid.server.store.berkeleydb.tuples.QueueTuple;
+import org.apache.qpid.server.store.berkeleydb.tuples.QueueTupleBindingFactory;
import org.apache.qpid.server.txn.NonTransactionalContext;
import org.apache.qpid.server.txn.TransactionalContext;
import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -58,8 +67,8 @@
import java.util.Map;
import java.util.Queue;
import java.util.TreeMap;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
@@ -126,8 +135,11 @@
private QueueTupleBindingFactory _queueTupleBindingFactory;
private BindingTupleBindingFactory _bindingTupleBindingFactory;
+ MessageFactory _messageFactory;
+
/** The data version this store should run with */
private int _version;
+
private enum State
{
INITIAL,
@@ -220,6 +232,8 @@
boolean newEnvironment = setupStore(environmentPath, readonly);
+ _messageFactory = MessageFactory.getInstance();
+
// Performing recovery when we only want read access will cause all the broker objects to be recreated
// This will/may include thread pool creations that may be duplicated when manually inspecting the state of
// the store. Simplest solution is to prevent the initial creation of the state by blocking recovery.
@@ -340,10 +354,10 @@
envConfig.setTransactional(true);
envConfig.setConfigParam("je.lock.nLockTables", "7");
envConfig.setLockTimeout(15000);
-
+
// Set transaction mode
_transactionConfig.setReadCommitted(true);
-
+
//This prevents background threads running which will potentially update the store.
envConfig.setReadOnly(readonly);
try
@@ -357,7 +371,7 @@
{
//Allow the creation this time
envConfig.setAllowCreate(true);
- if (_environment != null )
+ if (_environment != null)
{
_environment.cleanLog();
_environment.close();
@@ -648,7 +662,7 @@
{
_log.info("Restoring binding: (Exchange: " + binding.getExchangeName() + ", Queue: " + binding
.getQueueName() + ", Routing Key: " + binding.getRoutingKey() + ", Arguments: " + binding.getArguments()
- + ")");
+ + ")");
queue.bind(exchange, binding.getRoutingKey(), binding.getArguments());
}
@@ -992,7 +1006,7 @@
{
_log.debug("Message Id: " + messageId + " Dequeue");
}
-
+
try
{
@@ -1000,7 +1014,7 @@
if (status == OperationStatus.NOTFOUND)
{
throw new AMQException("Unable to find message with id " + messageId + " on queue " + name);
- }
+ }
else if (status != OperationStatus.SUCCESS)
{
throw new AMQException("Unable to remove message with id " + messageId + " on queue " + name);
@@ -1065,7 +1079,7 @@
{
try
{
- context.setPayload(_environment.beginTransaction(null, _transactionConfig ));
+ context.setPayload(_environment.beginTransaction(null, _transactionConfig));
}
catch (DatabaseException e)
{
@@ -1437,6 +1451,16 @@
return true;
}
+ public void flow(Long messageId)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void recover(Long messageId)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
Map<AMQShortString, AMQQueue> loadQueues() throws DatabaseException, AMQException
{
Cursor cursor = null;
@@ -1598,7 +1622,7 @@
private void deliverMessages(final StoreContext context, Map<AMQShortString, AMQQueue> queues)
throws DatabaseException, AMQException
{
- Map<Long, AMQMessage> msgMap = new HashMap<Long, AMQMessage>();
+ Map<Long, PersistentAMQMessage> msgMap = new HashMap<Long, PersistentAMQMessage>();
List<ProcessAction> actions = new ArrayList<ProcessAction>();
Map<AMQShortString, Integer> queueRecoveries = new TreeMap<AMQShortString, Integer>();
@@ -1613,7 +1637,6 @@
DatabaseEntry value = new DatabaseEntry();
EntryBinding valueBinding = TupleBinding.getPrimitiveBinding(Long.class);
- MessageHandleFactory messageHandleFactory = new MessageHandleFactory();
long maxId = 1;
TransactionalContext txnContext = new NonTransactionalContext(this, new StoreContext(), null, null);
@@ -1635,7 +1658,7 @@
long messageId = dd.messageId;
maxId = Math.max(maxId, messageId);
- AMQMessage message = msgMap.get(messageId);
+ PersistentAMQMessage message = msgMap.get(messageId);
if (message != null)
{
@@ -1643,8 +1666,23 @@
}
else
{
- message = new AMQMessage(messageId, this, messageHandleFactory, txnContext);
+
+ message = (PersistentAMQMessage) _messageFactory.createMessage(messageId, this, true);
msgMap.put(messageId, message);
+
+ MessageMetaData mmd = getMessageMetaData(context, messageId);
+ //Recover HeaderBody
+ message.recoverFromMessageMetaData(mmd);
+
+ //Recover Bodies
+ int count = mmd.getContentChunkCount();
+
+ for (int index = 0; index < count; index++)
+ {
+ ContentChunk cc = getContentBodyChunk(context, messageId, index);
+ message.recoverContentBodyFrame(cc, index == count);
+ }
+
}
if (_log.isDebugEnabled())
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java 2009-02-11 13:45:15 UTC (rev 3116)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ContentTB.java 2009-02-13 11:41:24 UTC (rev 3117)
@@ -23,14 +23,10 @@
import com.sleepycat.bind.tuple.TupleBinding;
import com.sleepycat.bind.tuple.TupleInput;
import com.sleepycat.bind.tuple.TupleOutput;
-import org.apache.qpid.framing.ContentBody;
+import org.apache.mina.common.ByteBuffer;
import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.mina.common.ByteBuffer;
-
-/**
- * @author Robert Greig (robert.j.greig(a)jpmorgan.com)
- */
+/** @author Robert Greig (robert.j.greig(a)jpmorgan.com) */
public class ContentTB extends TupleBinding
{
public Object entryToObject(TupleInput tupleInput)
@@ -39,7 +35,7 @@
final int size = tupleInput.readInt();
byte[] underlying = new byte[size];
tupleInput.readFast(underlying);
- final ByteBuffer data = ByteBuffer.wrap(underlying);
+ final ByteBuffer data = ByteBuffer.wrap(underlying);
ContentChunk cb = new ContentChunk()
{
@@ -70,7 +66,7 @@
ByteBuffer buf = cb.getData();
buf.duplicate().rewind().get(underlying);
-
+
tupleOutput.writeInt(size);
tupleOutput.writeFast(underlying);
}
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java 2009-02-11 13:45:15 UTC (rev 3116)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/MessageMetaDataTB.java 2009-02-13 11:41:24 UTC (rev 3117)
@@ -26,6 +26,7 @@
import org.apache.qpid.framing.*;
import org.apache.qpid.framing.abstraction.MessagePublishInfo;
import org.apache.qpid.server.queue.MessageMetaData;
+import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl;
/**
* Handles the mapping to and from message meta data
@@ -76,35 +77,7 @@
final boolean mandatory = tupleInput.readBoolean();
final boolean immediate = tupleInput.readBoolean();
- return new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return exchange;
- }
-
- public void setExchange(AMQShortString exchange)
- {
-
- }
-
- public boolean isImmediate()
- {
- return immediate;
- }
-
- public boolean isMandatory()
- {
- return mandatory;
- }
-
- public AMQShortString getRoutingKey()
- {
- return routingKey;
- }
- } ;
-
+ return new MessagePublishInfoImpl(exchange,immediate,mandatory,routingKey);
}
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreTest.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreTest.java 2009-02-11 13:45:15 UTC (rev 3116)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreTest.java 2009-02-13 11:41:24 UTC (rev 3117)
@@ -19,7 +19,6 @@
import com.sleepycat.je.DatabaseException;
import junit.framework.Assert;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.log4j.Logger;
import org.apache.mina.common.ByteBuffer;
@@ -28,6 +27,7 @@
import org.apache.qpid.framing.*;
import org.apache.qpid.framing.abstraction.MessagePublishInfo;
import org.apache.qpid.framing.abstraction.ContentChunk;
+import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl;
import org.apache.qpid.server.RequiredDeliveryException;
import org.apache.qpid.server.exchange.Exchange;
import org.apache.qpid.server.exchange.DefaultExchangeFactory;
@@ -39,6 +39,7 @@
import org.apache.qpid.server.queue.MessageMetaData;
import org.apache.qpid.server.queue.AMQQueueFactory;
import org.apache.qpid.server.queue.AMQPriorityQueue;
+import org.apache.qpid.server.queue.MockContentChunk;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.server.txn.NonTransactionalContext;
import org.apache.qpid.server.txn.TransactionalContext;
@@ -55,7 +56,7 @@
private BDBMessageStore _store;
private String STORE_LOCATION = System.getProperty("BDB_WORK") + "/bdbTestEnv";
-
+
private StoreContext _storeContext = new StoreContext();
private VirtualHost _virtualHost;
@@ -176,36 +177,7 @@
private MessagePublishInfo createPublishBody()
{
-
- return new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return MYEXCHANGE;
- }
-
- public void setExchange(AMQShortString exchange)
- {
-
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return true;
- }
-
- public AMQShortString getRoutingKey()
- {
- return RK;
- }
- };
-
+ return new MessagePublishInfoImpl(MYEXCHANGE,false,true,RK);
}
private BasicContentHeaderProperties createContentHeaderProperties()
@@ -440,8 +412,10 @@
_store.storeMessageMetaData(_storeContext, 40L, new MessageMetaData(pubBody, chb, 0));
_store.storeMessageMetaData(_storeContext, 41L, new MessageMetaData(pubBody, chb, 0));
- _store.storeMessageMetaData(_storeContext, 42L, new MessageMetaData(pubBody, chb, 0));
+ _store.storeMessageMetaData(_storeContext, 42L, new MessageMetaData(pubBody, chb, 1));
+ _store.storeContentBodyChunk(_storeContext, 42L, 0, new MockContentChunk(), true);
+
AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(QUEUE1, true, ME, false, _virtualHost, null);
AMQQueue queue2 = AMQQueueFactory.createAMQQueueImpl(QUEUE2, true, HIM, false, _virtualHost, null);
15 years, 10 months
rhmessaging commits: r3116 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-02-11 08:45:15 -0500 (Wed, 11 Feb 2009)
New Revision: 3116
Modified:
store/trunk/cpp/lib/jrnl/jinf.cpp
Log:
Corrected a typo in the generated output of the journal info files *.jinf.
Modified: store/trunk/cpp/lib/jrnl/jinf.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jinf.cpp 2009-02-10 16:23:50 UTC (rev 3115)
+++ store/trunk/cpp/lib/jrnl/jinf.cpp 2009-02-11 13:45:15 UTC (rev 3116)
@@ -348,7 +348,7 @@
oss << " <creation_time>" << std::endl;
oss << " <seconds value=\"" << _ts.tv_sec << "\" />" << std::endl;
oss << " <nanoseconds value=\"" << _ts.tv_nsec << "\" />" << std::endl;
- oss << " <string vlaue=\"" << (_tm_ptr->tm_year + 1900) << "/";
+ oss << " <string value=\"" << (_tm_ptr->tm_year + 1900) << "/";
oss << std::setw(2) << (_tm_ptr->tm_mon + 1) << "/" << std::setw(2) << _tm_ptr->tm_mday << " ";
oss << std::setw(2) << _tm_ptr->tm_hour << ":" << std::setw(2) << _tm_ptr->tm_min << ":";
oss << std::setw(2) << _tm_ptr->tm_sec << "." << std::setw(9) << _ts.tv_nsec;
15 years, 10 months
rhmessaging commits: r3115 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-02-10 11:23:50 -0500 (Tue, 10 Feb 2009)
New Revision: 3115
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
Log:
Correction to previous checkin
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-02-10 15:45:50 UTC (rev 3114)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-02-10 16:23:50 UTC (rev 3115)
@@ -975,7 +975,7 @@
ofsp.close();
std::free(buff);
rd._lfid = fid;
- if (rd._ffid)
+ if (!rd._frot)
rd._ffid = (fid + 1) % rd._njf;
this->log(LOG_INFO, "Bad record alignment fixed.");
}
15 years, 10 months
rhmessaging commits: r3114 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-02-10 10:45:50 -0500 (Tue, 10 Feb 2009)
New Revision: 3114
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
Log:
Fix for BZ474366 - "qpidd+store jcntl::check_owi() threw JERR_JCNTL_OWIMISMATCH on journal recovery".
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-02-10 12:35:49 UTC (rev 3113)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-02-10 15:45:50 UTC (rev 3114)
@@ -818,13 +818,11 @@
}
break;
case 0:
- check_journal_alignment(fid, file_pos);
- rd._eo = file_pos;
+ check_journal_alignment(fid, file_pos, rd);
return false;
default:
// Stop as this is the overwrite boundary.
- check_journal_alignment(fid, file_pos);
- rd._eo = file_pos;
+ check_journal_alignment(fid, file_pos, rd);
return false;
}
return true;
@@ -850,9 +848,8 @@
// fid != (rd._ffid ? rd._ffid - 1 : _num_jfiles - 1)) throw;
// Tried this, but did not work
// if (e.err_code() != jerrno::JERR_JREC_BADRECTAIL || h._magic != 0) throw;
- check_journal_alignment(start_fid, start_file_offs);
+ check_journal_alignment(start_fid, start_file_offs, rd);
// rd._lfid = start_fid;
- rd._eo = start_file_offs;
return false;
}
if (!done && !jfile_cycle(fid, ifsp, lowi, rd, false))
@@ -919,8 +916,7 @@
u_int16_t expected_fid = rd._ffid ? rd._ffid - 1 : rd._njf - 1;
if (fid == expected_fid)
{
- check_journal_alignment(fid, file_pos);
- rd._eo = file_pos;
+ check_journal_alignment(fid, file_pos, rd);
return false;
}
std::ostringstream oss;
@@ -938,7 +934,7 @@
void
-jcntl::check_journal_alignment(const u_int16_t fid, std::streampos& file_pos)
+jcntl::check_journal_alignment(const u_int16_t fid, std::streampos& file_pos, rcvdat& rd)
{
unsigned sblk_offs = file_pos % (JRNL_DBLK_SIZE * JRNL_SBLK_SIZE);
if (sblk_offs)
@@ -972,14 +968,18 @@
ofsp.write((const char*)buff, JRNL_DBLK_SIZE);
assert(!ofsp.fail());
std::ostringstream oss;
- oss << "Recover phase write: Wrote filler record at offs=0x" << std::hex << file_pos << std::dec;
+ oss << std::hex << "Recover phase write: Wrote filler record: fid=0x" << fid << " offs=0x" << file_pos;
this->log(LOG_NOTICE, oss.str());
file_pos = ofsp.tellp();
}
ofsp.close();
std::free(buff);
+ rd._lfid = fid;
+ if (rd._ffid)
+ rd._ffid = (fid + 1) % rd._njf;
this->log(LOG_INFO, "Bad record alignment fixed.");
}
+ rd._eo = file_pos;
}
} // namespace journal
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2009-02-10 12:35:49 UTC (rev 3113)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2009-02-10 15:45:50 UTC (rev 3114)
@@ -701,7 +701,7 @@
bool check_owi(const u_int16_t fid, rec_hdr& h, bool& lowi, rcvdat& rd,
std::streampos& read_pos);
- void check_journal_alignment(const u_int16_t fid, std::streampos& rec_offset);
+ void check_journal_alignment(const u_int16_t fid, std::streampos& rec_offset, rcvdat& rd);
};
} // namespace journal
15 years, 10 months
rhmessaging commits: r3113 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-02-10 07:35:49 -0500 (Tue, 10 Feb 2009)
New Revision: 3113
Modified:
mgmt/trunk/cumin/python/cumin/charts.py
Log:
Revert an unintentional change
Modified: mgmt/trunk/cumin/python/cumin/charts.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/charts.py 2009-02-10 12:29:37 UTC (rev 3112)
+++ mgmt/trunk/cumin/python/cumin/charts.py 2009-02-10 12:35:49 UTC (rev 3113)
@@ -26,7 +26,6 @@
cr.set_source_rgba(color[0], color[1], color[2], 0.66)
tnow = time()
- value = None
for dt, value in samples:
if value is None:
@@ -34,8 +33,6 @@
t = secs(dt)
- print "--", t
-
# prevent line from drawing off right side of grid
if tnow - t < 0:
t = tnow
@@ -44,9 +41,6 @@
y = self.height - (value / float(self.y_max)) * self.height
cr.line_to(x, y)
- if value:
- cr.line_to(self.width, value)
-
cr.stroke()
def plot_legend(self, titles, colors):
15 years, 10 months
rhmessaging commits: r3112 - in mgmt/trunk: cumin/python/cumin and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-02-10 07:29:37 -0500 (Tue, 10 Feb 2009)
New Revision: 3112
Modified:
mgmt/trunk/basil/python/basil/model.py
mgmt/trunk/basil/python/basil/page.py
mgmt/trunk/basil/python/basil/page.strings
mgmt/trunk/basil/python/basil/widgets.py
mgmt/trunk/basil/python/basil/widgets.strings
mgmt/trunk/cumin/python/cumin/charts.py
Log:
Add timestamps, refine styles
Modified: mgmt/trunk/basil/python/basil/model.py
===================================================================
--- mgmt/trunk/basil/python/basil/model.py 2009-02-09 22:49:51 UTC (rev 3111)
+++ mgmt/trunk/basil/python/basil/model.py 2009-02-10 12:29:37 UTC (rev 3112)
@@ -53,6 +53,9 @@
self.model.lock.release()
def newClass(self, kind, classKey):
+ if kind == 2:
+ return # XXX for now, drop events
+
self.model.lock.acquire()
try:
Modified: mgmt/trunk/basil/python/basil/page.py
===================================================================
--- mgmt/trunk/basil/python/basil/page.py 2009-02-09 22:49:51 UTC (rev 3111)
+++ mgmt/trunk/basil/python/basil/page.py 2009-02-10 12:29:37 UTC (rev 3112)
@@ -28,7 +28,7 @@
objects = ObjectBrowser(app, "objects")
self.tabs.add_tab(objects)
-class ObjectBrowser(Widget):
+class ObjectBrowser(PanningColumnSet):
def __init__(self, app, name):
super(ObjectBrowser, self).__init__(app, name)
@@ -86,11 +86,14 @@
self.add_column(col)
def do_get_items(self, session):
- package = self.pkgid.get(session)
+ id = self.pkgid.get(session)
- if package:
- classes = self.app.model.classes_by_package[package].values()
- return sorted(classes)
+ if id:
+ try:
+ classes = self.app.model.classes_by_package[id].values()
+ return sorted(classes)
+ except KeyError:
+ pass
def render_title(self, session):
return "Classes"
@@ -151,6 +154,34 @@
self.stats = ObjectStatistics(app, "stats", self.objid)
self.add_child(self.stats)
+ def render_name(self, session):
+ id = self.objid.get(session)
+
+ try:
+ return self.app.model.objects_by_id[id].getIndex()
+ except KeyError:
+ pass
+
+ def render_timestamp(self, session, index):
+ id = self.objid.get(session)
+
+ try:
+ utime = self.app.model.objects_by_id[id].getTimestamps()[index]
+ if utime != 0:
+ utime = utime / float(1000000000)
+ return datetime.fromtimestamp(utime)
+ except KeyError:
+ pass
+
+ def render_create_time(self, session):
+ return self.render_timestamp(session, 0)
+
+ def render_update_time(self, session):
+ return self.render_timestamp(session, 1)
+
+ def render_delete_time(self, session):
+ return self.render_timestamp(session, 2)
+
class BaseObjectProperties(PropertySet):
def __init__(self, app, name, objid):
super(BaseObjectProperties, self).__init__(app, name)
@@ -178,5 +209,12 @@
return object.getProperties()
class ObjectStatistics(BaseObjectProperties):
+ def do_get_items(self, session):
+ id = self.objid.get(session)
+ stats = self.app.model.stats_by_id.get(id)
+
+ if stats:
+ return self.get_properties(stats[-1])
+
def get_properties(self, object):
return object.getStatistics()
Modified: mgmt/trunk/basil/python/basil/page.strings
===================================================================
--- mgmt/trunk/basil/python/basil/page.strings 2009-02-09 22:49:51 UTC (rev 3111)
+++ mgmt/trunk/basil/python/basil/page.strings 2009-02-10 12:29:37 UTC (rev 3112)
@@ -1,4 +1,14 @@
[BasilPage.css]
+body {
+ font-size: 0.9em;
+ font-family: "DejaVu LGC Sans", "Bitstream Vera Sans", "Lucida Grande",
+ "Trebuchet MS", verdana, helvetica, arial, sans-serif;
+}
+
+h3 {
+ font-size: 0.9em;
+}
+
a {
text-decoration: none;
color: blue;
@@ -22,34 +32,20 @@
</body>
</html>
-[ObjectBrowser.css]
-table.ObjectBrowser tr td {
- vertical-align: top;
-}
-
-table.ObjectBrowser tr td.view {
- width: 50%;
-}
-
-[ObjectBrowser.html]
-<table class="ObjectBrowser">
- <tr>
- <td>{packages}</td>
- <td>{classes}</td>
- <td>{objects}</td>
- <td class="view">{view}</td>
- </tr>
-</table>
-
[ObjectView.html]
-{prev_link} {next_link}
-
<h2>{name}</h2>
-<h3>Agent</h3>
+<table class="PropertySet">
+ <thead>
+ <tr><th><a>Name</a></th><th><a>Value</a></th></tr>
+ </thead>
+ <tbody>
+ <tr><td>Created</td><td>{create_time}</td></tr>
+ <tr><td>Updated</td><td>{update_time}</td></tr>
+ <tr><td>Deleted</td><td>{delete_time}</td></tr>
+ </tbody>
+</table>
-<h3>Timestamps</h3>
-
<h3>Properties</h3>
{props}
Modified: mgmt/trunk/basil/python/basil/widgets.py
===================================================================
--- mgmt/trunk/basil/python/basil/widgets.py 2009-02-09 22:49:51 UTC (rev 3111)
+++ mgmt/trunk/basil/python/basil/widgets.py 2009-02-10 12:29:37 UTC (rev 3112)
@@ -2,24 +2,25 @@
from wooly import *
from wooly.tables import *
from wooly.resources import *
+from wooly.parameters import *
strings = StringCatalog(__file__)
class SelectableNameColumn(ItemTableColumn):
- def __init__(self, app, name, param):
+ def __init__(self, app, name, id_param):
super(SelectableNameColumn, self).__init__(app, name)
- self.param = param
+ self.id_param = id_param
def render_content(self, session, object):
id = self.get_id(object)
name = self.get_name(object)
- selected = self.param.get(session) == id
+ selected = self.id_param.get(session) == id
class_attr = selected and "class=\"selected\"" or ""
branch = session.branch()
- self.param.set(branch, id)
+ self.id_param.set(branch, id)
return "<a %s href=\"%s\">%s</a>" % \
(class_attr, branch.marshal(), name)
@@ -59,3 +60,38 @@
def render_content(self, session, item):
return escape(self.parent.get_item_value(item))
+
+class PanningColumnSet(Widget):
+ def __init__(self, app, name):
+ super(PanningColumnSet, self).__init__(app, name)
+
+ self.start = IntegerParameter(app, "start")
+ self.start.default = 0
+ self.add_parameter(self.start)
+
+ self.column_tmpl = Template(self, "column_html")
+
+ def render_back_href(self, session):
+ branch = session.branch()
+ self.start.set(branch, max((0, self.start.get(session) - 1)))
+ return branch.marshal()
+
+ def render_columns(self, session):
+ start = self.start.get(session)
+ writer = Writer()
+
+ for i, column in enumerate(self.children[start:]):
+ if i > 1:
+ break
+
+ if i == 1:
+ branch = session.branch()
+ self.start.set(branch, start + 1)
+ self.column_tmpl.render(writer, branch, column)
+ else:
+ self.column_tmpl.render(writer, session, column)
+
+ return writer.to_string()
+
+ def render_column(self, session, column):
+ return column.render(session)
Modified: mgmt/trunk/basil/python/basil/widgets.strings
===================================================================
--- mgmt/trunk/basil/python/basil/widgets.strings 2009-02-09 22:49:51 UTC (rev 3111)
+++ mgmt/trunk/basil/python/basil/widgets.strings 2009-02-10 12:29:37 UTC (rev 3112)
@@ -0,0 +1,45 @@
+[PropertySet.css]
+table.PropertySet {
+ width: 100%;
+ font-size: 0.9em;
+ text-align: left;
+ border-collapse; collapse;
+}
+
+table.PropertySet tbody td {
+ border-top: 1px dotted #ccc;
+}
+
+table.PropertySet thead a {
+ color: #666;
+ font-weight: normal;
+ font-style: italic;
+}
+
+[PropertySet.html]
+<table class="PropertySet">
+ <thead><tr>{headers}</tr></thead>
+ <tbody>{items}</tbody>
+</table>
+
+[PanningColumnSet.css]
+table.PanningColumnSet {
+ width: 100%;
+}
+
+table.PanningColumnSet tr td {
+ vertical-align: top;
+ width: 50%;
+}
+
+[PanningColumnSet.html]
+<table class="PanningColumnSet">
+ <tr>
+ <td><a href="{back_href}"><< Back</a></td>
+ <td></td>
+ </tr>
+ <tr>{columns}</tr>
+</table>
+
+[PanningColumnSet.column_html]
+<td>{column}</td>
Modified: mgmt/trunk/cumin/python/cumin/charts.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/charts.py 2009-02-09 22:49:51 UTC (rev 3111)
+++ mgmt/trunk/cumin/python/cumin/charts.py 2009-02-10 12:29:37 UTC (rev 3112)
@@ -26,13 +26,16 @@
cr.set_source_rgba(color[0], color[1], color[2], 0.66)
tnow = time()
+ value = None
for dt, value in samples:
if value is None:
- log.debug("Unexpected null value") # XXX
continue
t = secs(dt)
+
+ print "--", t
+
# prevent line from drawing off right side of grid
if tnow - t < 0:
t = tnow
@@ -41,6 +44,9 @@
y = self.height - (value / float(self.y_max)) * self.height
cr.line_to(x, y)
+ if value:
+ cr.line_to(self.width, value)
+
cr.stroke()
def plot_legend(self, titles, colors):
15 years, 10 months
rhmessaging commits: r3111 - in mgmt/trunk/basil: python/basil and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-02-09 17:49:51 -0500 (Mon, 09 Feb 2009)
New Revision: 3111
Added:
mgmt/trunk/basil/python/basil/model.py
mgmt/trunk/basil/python/basil/page.py
mgmt/trunk/basil/python/basil/page.strings
mgmt/trunk/basil/python/basil/server.py
mgmt/trunk/basil/python/basil/widgets.py
mgmt/trunk/basil/python/basil/widgets.strings
Modified:
mgmt/trunk/basil/bin/basil
mgmt/trunk/basil/python/basil/__init__.py
Log:
Initial check in of basil web
Modified: mgmt/trunk/basil/bin/basil
===================================================================
--- mgmt/trunk/basil/bin/basil 2009-02-06 16:28:59 UTC (rev 3110)
+++ mgmt/trunk/basil/bin/basil 2009-02-09 22:49:51 UTC (rev 3111)
@@ -1,43 +1,50 @@
#!/usr/bin/env python
import sys, os
-from code import InteractiveConsole
-from basil import *
+from basil.server import *
def usage():
- print "Usage: basil [BROKER-ADDRESS]"
+ print "Usage: basil [BROKER-HOST:BROKER-PORT]"
print "Example: basil localhost:5672"
sys.exit(1)
-def do_main(spec, host, port):
- model = BasilModel(spec)
+def do_main(host, port):
+ app = BasilApplication()
+ server = BasilServer(app, host, port)
- conn = BasilConnection(model, host, port)
- conn.open()
+ print "Initializing"
- console = InteractiveConsole(locals())
+ app.init()
+ app.start()
try:
- console.interact()
+ print "Starting web service at %s:%i" % (host, port)
+
+ try:
+ server.start()
+ finally:
+ server.stop()
finally:
- conn.close()
+ app.stop()
def main():
try:
addr = sys.argv[1]
except IndexError:
- addr = "localhost:5672"
+ addr = "localhost:55672"
- host, port = addr.split(":")
+ try:
+ host, port = addr.split(":")
+ port = int(port)
+ except:
+ print "Error: Malformed address"
+ usage()
- spec = os.environ.get("AMQP_SPEC", "/usr/share/amqp/amqp.0-10.xml")
-
try:
- do_main(spec, host, int(port))
+ do_main(host, port)
except KeyboardInterrupt:
pass
if __name__ == "__main__":
main()
-
Modified: mgmt/trunk/basil/python/basil/__init__.py
===================================================================
--- mgmt/trunk/basil/python/basil/__init__.py 2009-02-06 16:28:59 UTC (rev 3110)
+++ mgmt/trunk/basil/python/basil/__init__.py 2009-02-09 22:49:51 UTC (rev 3111)
@@ -8,7 +8,7 @@
from util import *
-class BasilModel(object):
+class OldBasilModel(object):
def __init__(self, spec_path):
self.spec = qpid.spec.load(spec_path)
Added: mgmt/trunk/basil/python/basil/model.py
===================================================================
--- mgmt/trunk/basil/python/basil/model.py (rev 0)
+++ mgmt/trunk/basil/python/basil/model.py 2009-02-09 22:49:51 UTC (rev 3111)
@@ -0,0 +1,85 @@
+from qmf.console import *
+from threading import Lock
+
+class BasilModel(object):
+ def __init__(self):
+ super(BasilModel, self).__init__()
+
+ self.broker_urls = set()
+
+ self.console = BasilConsole(self)
+ self.session = Session(self.console, manageConnections=True)
+
+ self.lock = Lock()
+
+ self.packages = set()
+ self.classes_by_package = dict()
+ self.objects_by_class = dict()
+ self.objects_by_id = dict()
+ self.stats_by_id = dict()
+
+ def add_broker_url(self, url):
+ self.broker_urls.add(url)
+
+ def init(self):
+ pass
+
+ def start(self):
+ for url in self.broker_urls:
+ self.session.addBroker(url)
+
+ def stop(self):
+ # XXX hack necessary for shutdown; bug rafi
+
+ for url in self.broker_urls:
+ self.session.delBroker(url)
+
+ def __repr__(self):
+ return "%s(%s)" % (self.__class__.__name__, self.session)
+
+class BasilConsole(Console):
+ def __init__(self, model):
+ #Console.__init__(self)
+ #super(BasilConsole, self).__init__()
+
+ self.model = model
+
+ def newPackage(self, name):
+ self.model.lock.acquire()
+
+ try:
+ self.model.packages.add(name)
+ finally:
+ self.model.lock.release()
+
+ def newClass(self, kind, classKey):
+ self.model.lock.acquire()
+
+ try:
+ pkgid = classKey.getPackageName()
+ classes = self.model.classes_by_package.setdefault(pkgid, dict())
+ classes[classKey.getHashString()] = classKey
+ finally:
+ self.model.lock.release()
+
+ def objectProps(self, broker, object):
+ self.model.lock.acquire()
+
+ try:
+ clsid = object.getClassKey().getHashString()
+ objects = self.model.objects_by_class.setdefault(clsid, dict())
+ objects[str(object.getObjectId())] = object
+
+ self.model.objects_by_id[str(object.getObjectId())] = object
+ finally:
+ self.model.lock.release()
+
+ def objectStats(self, broker, object):
+ self.model.lock.acquire()
+
+ try:
+ objid = str(object.getObjectId())
+ stats = self.model.stats_by_id.setdefault(objid, list())
+ stats.append(object)
+ finally:
+ self.model.lock.release()
Added: mgmt/trunk/basil/python/basil/page.py
===================================================================
--- mgmt/trunk/basil/python/basil/page.py (rev 0)
+++ mgmt/trunk/basil/python/basil/page.py 2009-02-09 22:49:51 UTC (rev 3111)
@@ -0,0 +1,182 @@
+import struct
+
+from wooly import *
+from wooly.tables import *
+from wooly.resources import *
+
+from widgets import *
+
+strings = StringCatalog(__file__)
+
+class BasilPage(Page):
+ def __init__(self, app, page):
+ super(BasilPage, self).__init__(app, page)
+
+ self.main = MainView(app, "main")
+ self.add_child(self.main)
+
+ def render_title(self, session):
+ return "Basil"
+
+class MainView(Widget):
+ def __init__(self, app, name):
+ super(MainView, self).__init__(app, name)
+
+ self.tabs = TabbedModeSet(app, "tabs")
+ self.add_child(self.tabs)
+
+ objects = ObjectBrowser(app, "objects")
+ self.tabs.add_tab(objects)
+
+class ObjectBrowser(Widget):
+ def __init__(self, app, name):
+ super(ObjectBrowser, self).__init__(app, name)
+
+ self.pkgid = Parameter(app, "package")
+ self.add_parameter(self.pkgid)
+
+ self.clsid = Parameter(app, "class")
+ self.add_parameter(self.clsid)
+
+ self.objid = Parameter(app, "object")
+ self.add_parameter(self.objid)
+
+ packages = PackageSet(app, "packages", self.pkgid)
+ self.add_child(packages)
+
+ classes = ClassSet(app, "classes", self.pkgid, self.clsid)
+ self.add_child(classes)
+
+ objects = ObjectSet(app, "objects", self.clsid, self.objid)
+ self.add_child(objects)
+
+ view = ObjectView(app, "view", self.objid)
+ self.add_child(view)
+
+ def render_title(self, session):
+ return "Objects"
+
+class PackageSet(ItemTable):
+ def __init__(self, app, name, pkgid):
+ super(PackageSet, self).__init__(app, name)
+
+ self.pkgid = pkgid
+
+ col = self.NameColumn(app, "name", self.pkgid)
+ self.add_column(col)
+
+ def do_get_items(self, session):
+ return sorted(self.app.model.packages)
+
+ def render_title(self, session):
+ return "Packages"
+
+ class NameColumn(SelectableNameColumn):
+ def get_id(self, name):
+ return name
+
+class ClassSet(ItemTable):
+ def __init__(self, app, name, pkgid, clsid):
+ super(ClassSet, self).__init__(app, name)
+
+ self.pkgid = pkgid
+ self.clsid = clsid
+
+ col = self.NameColumn(app, "name", self.clsid)
+ self.add_column(col)
+
+ def do_get_items(self, session):
+ package = self.pkgid.get(session)
+
+ if package:
+ classes = self.app.model.classes_by_package[package].values()
+ return sorted(classes)
+
+ def render_title(self, session):
+ return "Classes"
+
+ class NameColumn(SelectableNameColumn):
+ def get_id(self, clacc):
+ return clacc.getHashString()
+
+ def get_name(self, clacc):
+ name = clacc.getClassName()
+ hash = "%08x" % struct.unpack("!L", clacc.getHash()[:4])
+ return "%s (%s)" % (name, hash)
+
+class ObjectSet(ItemTable):
+ def __init__(self, app, name, clsid, objid):
+ super(ObjectSet, self).__init__(app, name)
+
+ self.clsid = clsid
+ self.objid = objid
+
+ col = self.NameColumn(app, "name", self.objid)
+ self.add_column(col)
+
+ def do_get_items(self, session):
+ clsid = self.clsid.get(session)
+
+ if clsid:
+ objects = self.app.model.objects_by_class.get(clsid)
+
+ if objects:
+ return sorted(objects.values())
+
+ def render_title(self, session):
+ return "Classes"
+
+ class NameColumn(SelectableNameColumn):
+ def get_id(self, object):
+ return str(object.getObjectId())
+
+ def get_name(self, object):
+ return object.getIndex()
+
+# if hasattr(object, "name"):
+# return getattr(object, "name")
+# else:
+# return self.get_id(object)
+ #return getattr(object, "name", self.get_id(object)) # XXX use this
+
+class ObjectView(Widget):
+ def __init__(self, app, name, objid):
+ super(ObjectView, self).__init__(app, name)
+
+ self.objid = objid
+
+ self.props = ObjectProperties(app, "props", self.objid)
+ self.add_child(self.props)
+
+ self.stats = ObjectStatistics(app, "stats", self.objid)
+ self.add_child(self.stats)
+
+class BaseObjectProperties(PropertySet):
+ def __init__(self, app, name, objid):
+ super(BaseObjectProperties, self).__init__(app, name)
+
+ self.objid = objid
+
+ def do_get_items(self, session):
+ id = self.objid.get(session)
+ obj = self.app.model.objects_by_id.get(id)
+
+ if obj:
+ return self.get_properties(obj)
+
+ def get_properties(self, object):
+ return object.getProperties()
+
+ def get_item_name(self, item):
+ return str(item[0])
+
+ def get_item_value(self, item):
+ return str(item[1])
+
+class ObjectProperties(BaseObjectProperties):
+ def get_properties(self, object):
+ return object.getProperties()
+
+class ObjectStatistics(BaseObjectProperties):
+ def get_properties(self, object):
+ return object.getStatistics()
Added: mgmt/trunk/basil/python/basil/page.strings
===================================================================
--- mgmt/trunk/basil/python/basil/page.strings (rev 0)
+++ mgmt/trunk/basil/python/basil/page.strings 2009-02-09 22:49:51 UTC (rev 3111)
@@ -0,0 +1,59 @@
+[BasilPage.css]
+a {
+ text-decoration: none;
+ color: blue;
+}
+
+a.selected {
+ color: black;
+ background-color: #ff6;
+}
+
+[BasilPage.html]
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
+ <head>
+ <title>{title}</title>
+ <link rel="stylesheet" type="text/css" href="index.css"/>
+ </head>
+ <body>
+ {content}
+ </body>
+</html>
+
+[ObjectBrowser.css]
+table.ObjectBrowser tr td {
+ vertical-align: top;
+}
+
+table.ObjectBrowser tr td.view {
+ width: 50%;
+}
+
+[ObjectBrowser.html]
+<table class="ObjectBrowser">
+ <tr>
+ <td>{packages}</td>
+ <td>{classes}</td>
+ <td>{objects}</td>
+ <td class="view">{view}</td>
+ </tr>
+</table>
+
+[ObjectView.html]
+{prev_link} {next_link}
+
+<h2>{name}</h2>
+
+<h3>Agent</h3>
+
+<h3>Timestamps</h3>
+
+<h3>Properties</h3>
+
+{props}
+
+<h3>Statistics</h3>
+
+{stats}
Added: mgmt/trunk/basil/python/basil/server.py
===================================================================
--- mgmt/trunk/basil/python/basil/server.py (rev 0)
+++ mgmt/trunk/basil/python/basil/server.py 2009-02-09 22:49:51 UTC (rev 3111)
@@ -0,0 +1,37 @@
+from qmf.console import *
+from wooly import Application
+from wooly.server import WebServer
+from wooly.pages import CssPage
+
+from model import BasilModel
+from page import BasilPage
+
+class BasilServer(WebServer):
+ def authorized(self, session):
+ return True
+
+class BasilApplication(Application):
+ def __init__(self):
+ super(BasilApplication, self).__init__()
+
+ self.model = BasilModel()
+ self.model.add_broker_url("amqp://north-15.lab.bos.redhat.com")
+
+ self.main_page = BasilPage(self, "index.html")
+
+ self.add_page(self.main_page)
+ self.set_default_page(self.main_page)
+
+ page = CssPage(self, "index.css")
+ self.add_page(page)
+
+ self.enable_debug()
+
+ def init(self):
+ self.model.init()
+
+ def start(self):
+ self.model.start()
+
+ def stop(self):
+ self.model.stop()
Added: mgmt/trunk/basil/python/basil/widgets.py
===================================================================
--- mgmt/trunk/basil/python/basil/widgets.py (rev 0)
+++ mgmt/trunk/basil/python/basil/widgets.py 2009-02-09 22:49:51 UTC (rev 3111)
@@ -0,0 +1,61 @@
+from xml.sax.saxutils import escape
+from wooly import *
+from wooly.tables import *
+from wooly.resources import *
+
+strings = StringCatalog(__file__)
+
+class SelectableNameColumn(ItemTableColumn):
+ def __init__(self, app, name, param):
+ super(SelectableNameColumn, self).__init__(app, name)
+
+ self.param = param
+
+ def render_content(self, session, object):
+ id = self.get_id(object)
+ name = self.get_name(object)
+
+ selected = self.param.get(session) == id
+ class_attr = selected and "class=\"selected\"" or ""
+
+ branch = session.branch()
+ self.param.set(branch, id)
+
+ return "<a %s href=\"%s\">%s</a>" % \
+ (class_attr, branch.marshal(), name)
+
+ def get_id(self, object):
+ return object.id
+
+ def get_name(self, object):
+ return self.get_id(object)
+
+class PropertySet(ItemTable):
+ def __init__(self, app, name):
+ super(PropertySet, self).__init__(app, name)
+
+ self.name_column = self.NameColumn(app, "name")
+ self.add_column(self.name_column)
+
+ self.value_column = self.ValueColumn(app, "value")
+ self.add_column(self.value_column)
+
+ def get_item_name(self, item):
+ pass
+
+ def get_item_value(self, item):
+ pass
+
+ class NameColumn(ItemTableColumn):
+ def render_title(self, session, item):
+ return "Name"
+
+ def render_content(self, session, item):
+ return escape(self.parent.get_item_name(item))
+
+ class ValueColumn(ItemTableColumn):
+ def render_title(self, session, item):
+ return "Value"
+
+ def render_content(self, session, item):
+ return escape(self.parent.get_item_value(item))
Added: mgmt/trunk/basil/python/basil/widgets.strings
===================================================================
15 years, 10 months
rhmessaging commits: r3110 - in mgmt/trunk/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-02-06 11:28:59 -0500 (Fri, 06 Feb 2009)
New Revision: 3110
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/python/mint/schemaparser.py
mgmt/trunk/mint/sql/triggers.sql
Log:
Nuno's patch to simplify triggers, and a new schema
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2009-02-05 18:53:07 UTC (rev 3109)
+++ mgmt/trunk/mint/python/mint/schema.py 2009-02-06 16:28:59 UTC (rev 3110)
@@ -1353,7 +1353,8 @@
"connection": "clientConnection", "Connection": "ClientConnection",
"connectionRef": "clientConnectionRef",
"user": "gridUser", "User": "GridUser",
- "registeredTo": "broker"}
+ "registeredTo": "broker",
+ "sync": "syncRsv"}
classToSchemaNameMap['Slot'] = 'Slot'
schemaNameToClassMap['Slot'] = Slot
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2009-02-05 18:53:07 UTC (rev 3109)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2009-02-06 16:28:59 UTC (rev 3110)
@@ -40,7 +40,8 @@
"connection": "clientConnection", "Connection": "ClientConnection",
"connectionRef": "clientConnectionRef",
"user": "gridUser", "User": "GridUser",
- "registeredTo": "broker"}
+ "registeredTo": "broker",
+ "sync": "syncRsv"}
def renameReservedWord(self, name):
if (name in self.reservedWords.keys()):
@@ -141,8 +142,11 @@
colPythonName = self.style.dbColumnToPythonAttr(schemaName)
keyPythonName = self.style.dbTableToPythonClass(schemaName)
sqlTable = self.style.pythonClassToDBTable(pythonName)
- self.sqlTriggersOutput += "CREATE TRIGGER update_stats AFTER INSERT ON %s \n" % (sqlTable)
- self.sqlTriggersOutput += " FOR EACH ROW EXECUTE PROCEDURE update_stats(); \n\n"
+ sqlParentTable = self.style.pythonClassToDBTable(self.style.dbTableToPythonClass(schemaName))
+ self.sqlTriggersOutput += self.sqlTriggerFunction % (sqlParentTable, sqlParentTable, sqlParentTable)
+ self.sqlTriggersOutput += "\n"
+ self.sqlTriggersOutput += "CREATE TRIGGER update_%s_stats AFTER INSERT ON %s \n" % (sqlParentTable, sqlTable)
+ self.sqlTriggersOutput += " FOR EACH ROW EXECUTE PROCEDURE update_%s_stats(); \n\n" % (sqlParentTable)
self.sqlTriggersOutput += "CREATE INDEX %s_update_time ON %s (qmf_update_time);\n\n" % (sqlTable, sqlTable)
else:
pythonName = self.style.dbTableToPythonClass(schemaName)
@@ -218,7 +222,8 @@
self.finalPythonOutput += ' "connection": "clientConnection", "Connection": "ClientConnection", \n'
self.finalPythonOutput += ' "connectionRef": "clientConnectionRef", \n'
self.finalPythonOutput += ' "user": "gridUser", "User": "GridUser", \n'
- self.finalPythonOutput += ' "registeredTo": "broker"} \n\n'
+ self.finalPythonOutput += ' "registeredTo": "broker",\n'
+ self.finalPythonOutput += ' "sync": "syncRsv"} \n\n'
# TODO: optimize getting the id to the parent table from new.parent_table_id
self.sqlTriggersOutput += """
@@ -239,30 +244,16 @@
DROP FUNCTION create_plpgsql();
-CREATE OR REPLACE FUNCTION update_stats() RETURNS trigger AS '
-DECLARE
- parent_table varchar;
- select_parent varchar;
- update_parent varchar;
-BEGIN
- -- remove "_stats" suffix from table name
- parent_table := substr(tg_relname, 0, char_length(tg_relname) - 5);
-
- select_parent := ''SELECT id FROM '' || parent_table ||
- '' WHERE id = (SELECT '' || parent_table || ''_id FROM '' || tg_relname || '' WHERE id = '' ||
- new.id || '') FOR UPDATE'';
-
- update_parent := ''UPDATE '' || parent_table ||
- '' SET stats_prev_id = stats_curr_id, stats_curr_id = '' || new.id ||
- '' WHERE id = (SELECT '' || parent_table || ''_id FROM '' || tg_relname || '' WHERE id = '' ||
- new.id || '')'';
- EXECUTE select_parent;
- EXECUTE update_parent;
- RETURN new;
-END
-' LANGUAGE plpgsql;
-
"""
+ self.sqlTriggerFunction = """
+CREATE OR REPLACE FUNCTION update_%s_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE %s SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.%s_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+"""
+
outputFile = open(self.pythonFilePath, "w")
sqlTriggersFile = open(self.sqlTriggersFilePath, "w")
for xmlFile in self.xmlFilePaths:
Modified: mgmt/trunk/mint/sql/triggers.sql
===================================================================
--- mgmt/trunk/mint/sql/triggers.sql 2009-02-05 18:53:07 UTC (rev 3109)
+++ mgmt/trunk/mint/sql/triggers.sql 2009-02-06 16:28:59 UTC (rev 3110)
@@ -16,141 +16,302 @@
DROP FUNCTION create_plpgsql();
-CREATE OR REPLACE FUNCTION update_stats() RETURNS trigger AS '
-DECLARE
- parent_table varchar;
- select_parent varchar;
- update_parent varchar;
-BEGIN
- -- remove "_stats" suffix from table name
- parent_table := substr(tg_relname, 0, char_length(tg_relname) - 5);
- select_parent := ''SELECT id FROM '' || parent_table ||
- '' WHERE id = (SELECT '' || parent_table || ''_id FROM '' || tg_relname || '' WHERE id = '' ||
- new.id || '') FOR UPDATE'';
+CREATE OR REPLACE FUNCTION update_slot_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE slot SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.slot_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
- update_parent := ''UPDATE '' || parent_table ||
- '' SET stats_prev_id = stats_curr_id, stats_curr_id = '' || new.id ||
- '' WHERE id = (SELECT '' || parent_table || ''_id FROM '' || tg_relname || '' WHERE id = '' ||
- new.id || '')'';
- EXECUTE select_parent;
- EXECUTE update_parent;
- RETURN new;
-END
-' LANGUAGE plpgsql;
+CREATE TRIGGER update_slot_stats AFTER INSERT ON slot_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_slot_stats();
-CREATE TRIGGER update_stats AFTER INSERT ON slot_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
-
CREATE INDEX slot_stats_update_time ON slot_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON job_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_job_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE job SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.job_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_job_stats AFTER INSERT ON job_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_job_stats();
+
CREATE INDEX job_stats_update_time ON job_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON scheduler_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_scheduler_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE scheduler SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.scheduler_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_scheduler_stats AFTER INSERT ON scheduler_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_scheduler_stats();
+
CREATE INDEX scheduler_stats_update_time ON scheduler_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON submitter_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_submitter_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE submitter SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.submitter_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_submitter_stats AFTER INSERT ON submitter_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_submitter_stats();
+
CREATE INDEX submitter_stats_update_time ON submitter_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON negotiator_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_negotiator_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE negotiator SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.negotiator_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_negotiator_stats AFTER INSERT ON negotiator_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_negotiator_stats();
+
CREATE INDEX negotiator_stats_update_time ON negotiator_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON collector_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_collector_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE collector SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.collector_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_collector_stats AFTER INSERT ON collector_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_collector_stats();
+
CREATE INDEX collector_stats_update_time ON collector_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON master_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_master_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE master SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.master_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_master_stats AFTER INSERT ON master_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_master_stats();
+
CREATE INDEX master_stats_update_time ON master_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON acl_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_acl_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE acl SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.acl_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_acl_stats AFTER INSERT ON acl_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_acl_stats();
+
CREATE INDEX acl_stats_update_time ON acl_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON cluster_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_cluster_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE cluster SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.cluster_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_cluster_stats AFTER INSERT ON cluster_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_cluster_stats();
+
CREATE INDEX cluster_stats_update_time ON cluster_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON store_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_store_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE store SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.store_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_store_stats AFTER INSERT ON store_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_store_stats();
+
CREATE INDEX store_stats_update_time ON store_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON journal_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_journal_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE journal SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.journal_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_journal_stats AFTER INSERT ON journal_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_journal_stats();
+
CREATE INDEX journal_stats_update_time ON journal_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON system_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_system_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE system SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.system_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_system_stats AFTER INSERT ON system_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_system_stats();
+
CREATE INDEX system_stats_update_time ON system_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON broker_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_broker_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE broker SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.broker_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_broker_stats AFTER INSERT ON broker_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_broker_stats();
+
CREATE INDEX broker_stats_update_time ON broker_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON agent_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_agent_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE agent SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.agent_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_agent_stats AFTER INSERT ON agent_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_agent_stats();
+
CREATE INDEX agent_stats_update_time ON agent_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON vhost_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_vhost_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE vhost SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.vhost_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_vhost_stats AFTER INSERT ON vhost_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_vhost_stats();
+
CREATE INDEX vhost_stats_update_time ON vhost_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON queue_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_queue_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE queue SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.queue_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_queue_stats AFTER INSERT ON queue_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_queue_stats();
+
CREATE INDEX queue_stats_update_time ON queue_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON exchange_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_exchange_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE exchange SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.exchange_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_exchange_stats AFTER INSERT ON exchange_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_exchange_stats();
+
CREATE INDEX exchange_stats_update_time ON exchange_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON binding_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_binding_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE binding SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.binding_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_binding_stats AFTER INSERT ON binding_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_binding_stats();
+
CREATE INDEX binding_stats_update_time ON binding_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON client_connection_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_client_connection_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE client_connection SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.client_connection_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_client_connection_stats AFTER INSERT ON client_connection_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_client_connection_stats();
+
CREATE INDEX client_connection_stats_update_time ON client_connection_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON link_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_link_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE link SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.link_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_link_stats AFTER INSERT ON link_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_link_stats();
+
CREATE INDEX link_stats_update_time ON link_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON bridge_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_bridge_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE bridge SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.bridge_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_bridge_stats AFTER INSERT ON bridge_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_bridge_stats();
+
CREATE INDEX bridge_stats_update_time ON bridge_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON session_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_session_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE session SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.session_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_session_stats AFTER INSERT ON session_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_session_stats();
+
CREATE INDEX session_stats_update_time ON session_stats (qmf_update_time);
-CREATE TRIGGER update_stats AFTER INSERT ON sysimage_stats
- FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE OR REPLACE FUNCTION update_sysimage_stats() RETURNS trigger AS '
+BEGIN
+ UPDATE sysimage SET stats_prev_id = stats_curr_id, stats_curr_id = new.id WHERE id = new.sysimage_id;
+ RETURN new;
+END
+' LANGUAGE plpgsql;
+
+CREATE TRIGGER update_sysimage_stats AFTER INSERT ON sysimage_stats
+ FOR EACH ROW EXECUTE PROCEDURE update_sysimage_stats();
+
CREATE INDEX sysimage_stats_update_time ON sysimage_stats (qmf_update_time);
15 years, 10 months
rhmessaging commits: r3109 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-02-05 13:53:07 -0500 (Thu, 05 Feb 2009)
New Revision: 3109
Modified:
mgmt/trunk/cumin/python/cumin/broker.py
mgmt/trunk/cumin/python/cumin/broker.strings
Log:
Fix crash on cluster column sort
Modified: mgmt/trunk/cumin/python/cumin/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.py 2009-02-04 22:16:44 UTC (rev 3108)
+++ mgmt/trunk/cumin/python/cumin/broker.py 2009-02-05 18:53:07 UTC (rev 3109)
@@ -128,7 +128,7 @@
return "Cluster"
def render_content(self, session, data):
- return data["cluster_name"] or fmt_none()
+ return data["cluster"] or fmt_none()
class TopBrokerSet(CuminTable):
def __init__(self, app, name):
Modified: mgmt/trunk/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.strings 2009-02-04 22:16:44 UTC (rev 3108)
+++ mgmt/trunk/cumin/python/cumin/broker.strings 2009-02-05 18:53:07 UTC (rev 3109)
@@ -1,5 +1,5 @@
[BrokerSet.sql]
-select br.id, br.name, c.cluster_name
+select br.id, br.name, c.cluster_name as cluster
from broker_registration as br
left outer join broker as b on b.registration_id = br.id
left outer join cluster as c on c.broker_id = b.id
15 years, 10 months