Package org.xmlBlaster.util.qos.storage

Examples of org.xmlBlaster.util.qos.storage.MsgUnitStoreProperty


         this.glob.getProperty().set("QueuePlugin[JDBC][1.0]", pluginInfo.dumpPluginParameters());

         if (!"JDBC".equals(type))
            pluginInfo = new PluginInfo(glob, pluginManager, type, "1.0");

         MsgUnitStoreProperty storeProp = new MsgUnitStoreProperty(glob, "/node/test");
         StorageId queueId = new StorageId(glob, "msgUnitStore", "SomeMapId");

         this.currMap = pluginManager.getPlugin(pluginInfo, queueId, storeProp);
         this.currMap.clear();
         this.currMap.shutdown(); // to allow to initialize again
View Full Code Here


      QueuePropertyBase prop1 = null;
      QueuePropertyBase prop = null;
      try {
         // test initialize()
         prop1 = new MsgUnitStoreProperty(glob, "/node/test");
         int max = 12;
         prop1.setMaxEntries(max);
         prop1.setMaxEntriesCache(max);
         assertEquals(ME+": Wrong capacity", max, prop1.getMaxEntries());
         assertEquals(ME+": Wrong cache capacity", max, prop1.getMaxEntriesCache());
         StorageId queueId = new StorageId(glob, "msgUnitStore", "SomeMapId");

         i_map.initialize(queueId, prop1);
         assertEquals(ME+": Wrong queue ID", queueId, i_map.getStorageId());

         try {
            prop = new MsgUnitStoreProperty(glob, "/node/test");
            prop.setMaxEntries(99);
            prop.setMaxEntriesCache(99);
            i_map.setProperties(prop);
         }
         catch(XmlBlasterException e) {
View Full Code Here

//------------------------------------
   public void testPutMsg() {
      String queueType = "unknown";
      try {
         QueuePropertyBase prop = new MsgUnitStoreProperty(glob, "/node/test");
         queueType = this.currMap.toString();
         StorageId queueId = new StorageId(glob, "msgUnitStore", "MapPlugin/putMsg");
         this.currMap.initialize(queueId, prop);
         this.currMap.clear();
         assertEquals(ME + "wrong size before starting ", 0L, this.currMap.getNumOfEntries());
View Full Code Here

      I_Map i_map = this.currMap;
      ME = "I_MapTest.testByteOverflow(" + i_map.getStorageId() + ")[" + i_map.getClass().getName() + "]";
      System.out.println("***" + ME);
      try {
         StorageId storageId = new StorageId(glob, "msgUnitStore", "ByteOverflowMapId");
         QueuePropertyBase prop = new MsgUnitStoreProperty(glob, "/node/test");

         MsgUnitWrapper mu = new MsgUnitWrapper(glob, createMsgUnit(false, 0),  storageId);
         long sizeEmpty = mu.getSizeInBytes();

         MsgUnitWrapper[] queueEntries = {
            new MsgUnitWrapper(glob, createMsgUnit(false, 0),  storageId),
            new MsgUnitWrapper(glob, createMsgUnit(false, 0),  storageId),
            new MsgUnitWrapper(glob, createMsgUnit(false, 0),  storageId),
            // Each above entry has 3,311 bytes = 9,922, the next one has 9,932 bytes
            // so when it is entered two of the above need to be swapped away
            // as maxBytes=13,244
            new MsgUnitWrapper(glob, createMsgUnit(false, 2*sizeEmpty-1), storageId),
            new MsgUnitWrapper(glob, createMsgUnit(false, 0),  storageId)};

         final long maxBytesCache = 4*sizeEmpty;
         prop.setMaxBytes(1000000);
         prop.setMaxBytesCache(maxBytesCache);
         assertEquals(ME+": Wrong capacity", 1000000, prop.getMaxBytes());
         assertEquals(ME+": Wrong cache capacity", maxBytesCache, prop.getMaxBytesCache());
         i_map.initialize(storageId, prop);
         assertEquals(ME+": Wrong queue ID", storageId, i_map.getStorageId());

         long numOfBytes = 0;
         for(int i=0; i<queueEntries.length; i++) {
View Full Code Here

//------------------------------------
   public void testGetMsg() {

      String queueType = "unknown";
      try {
         QueuePropertyBase prop = new MsgUnitStoreProperty(glob, "/node/test");
         queueType = this.currMap.toString();
         StorageId queueId = new StorageId(glob, "msgUnitStore", "MapPlugin/getMsg");
         this.currMap.initialize(queueId, prop);
         this.currMap.clear();
         assertEquals(ME + "wrong size before starting ", 0, this.currMap.getNumOfEntries());
View Full Code Here

//------------------------------------
   public void testGetAllMsgs() {

      String queueType = "unknown";
      try {
         QueuePropertyBase prop = new MsgUnitStoreProperty(glob, "/node/test");
         queueType = this.currMap.toString();
         StorageId queueId = new StorageId(glob, "msgUnitStore", "MapPlugin/getAllMsgs");
         this.currMap.initialize(queueId, prop);
         this.currMap.clear();
         assertEquals(ME + "wrong size before starting ", 0, this.currMap.getNumOfEntries());
View Full Code Here

//------------------------------------
   public void testGetAllSwappedMsgs() {

      String queueType = "unknown";
      try {
         QueuePropertyBase prop = new MsgUnitStoreProperty(glob, "/node/test");
         queueType = this.currMap.toString();
         StorageId queueId = new StorageId(glob, "msgUnitStore", "MapPlugin/getAllSwappedMsgs");
         prop.setMaxEntries(10);      // Overall size (RAM or JDBC or CACHE)
         prop.setMaxEntriesCache(2)// Is only interpreted for cache implementations (-> the size of the RAM map)
         this.currMap.initialize(queueId, prop);
         this.currMap.clear();
         assertEquals(ME + "wrong size before starting ", 0, this.currMap.getNumOfEntries());
         getAllSwappedMsgs(this.currMap);
      }
View Full Code Here


   public void testPutEntriesTwice() {
      String queueType = "unknown";
      try {
         QueuePropertyBase prop = new MsgUnitStoreProperty(glob, "/node/test");
         queueType = this.currMap.toString();
         StorageId queueId = new StorageId(glob, "msgUnitStore", "MapPlugin/putEntriesTwice");
         this.currMap.initialize(queueId, prop);
         this.currMap.clear();
         assertEquals(ME + " wrong size before starting ", 0, this.currMap.getNumOfEntries());
View Full Code Here

   /**
    * This cache stores the 'real meat' (the MsgUnit data struct)
    */
   private void startupMsgstore() throws XmlBlasterException   {
      MsgUnitStoreProperty msgUnitStoreProperty = this.topicProperty.getMsgUnitStoreProperty();
      if (this.msgUnitCache == null) {
         String type = msgUnitStoreProperty.getType();
         String version = msgUnitStoreProperty.getVersion();
         // ContextNode syntax: "/node/heron/topic/hello" (similar to callback queue)
         // instead of "msgUnitStore:heron_hello"
         // This change would be nice but then existing entries on restart wouldn't be found
         // This syntax is also used in RequestBroker:checkConsistency to reverse lookup the TopicHandler by a given I_Map
         StorageId msgUnitStoreId = new StorageId(serverScope, serverScope.getDatabaseNodeStr(),
View Full Code Here

      TopicProperty topicProps = msgQosData.getTopicProperty();
      if (topicProps == null) {
         log.warning("The TopicProperty is null, not reconfiguring anything");
         return false;
      }
      MsgUnitStoreProperty msgUnitStoreProps = topicProps.getMsgUnitStoreProperty();
      if (msgUnitStoreProps == null) {
         log.warning("The msgUnitStoreProps are null, not reconfiguring anything");
         return false;
      }

      MsgUnitStoreProperty currentMsgUnitStoreProps = this.topicProperty.getMsgUnitStoreProperty();
      long currentMaxBytes = currentMsgUnitStoreProps.getMaxBytes();
      long currentMaxBytesCache = currentMsgUnitStoreProps.getMaxBytesCache();
      long currentMaxEntries = currentMsgUnitStoreProps.getMaxEntries();
      long currentMaxEntriesCache = currentMsgUnitStoreProps.getMaxEntriesCache();
      StringBuffer report = new StringBuffer(1024);
      // msgUnitStoreProps.getMaxBytesProp().isSet() checks if the value is explicitely set by a client
      if (msgUnitStoreProps.getMaxBytes() == 0 || !msgUnitStoreProps.getMaxBytesProp().isSet() && currentMaxBytes > msgUnitStoreProps.getMaxBytes()) {
         report.append("msgUnitStore: 'currentMaxBytes='" + currentMaxBytes + "' > than what publish proposed: '" + msgUnitStoreProps.getMaxBytes() + "' will leave it to '" + currentMaxBytes + "'\n");
         msgUnitStoreProps.setMaxBytes(currentMaxBytes);
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.qos.storage.MsgUnitStoreProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.