Package jdbm.helper

Examples of jdbm.helper.TupleBrowser


   /**
    * Dumps the tree past the key to debug.
    */
   public void dump(Object key) throws IOException {
      TupleBrowser browser = tree.browse(key);
      Tuple t = new Tuple();
      log.debug("contents: " + key);
      while (browser.getNext(t)) {
         log.debug(t.getKey() + "\t" + t.getValue());
      }
      log.debug("");
   }
View Full Code Here


    * Find all times less than current time. Build a list of keys for those times. Then purge those keys, assuming those
    * keys' expiry has not changed.
    * @throws ClassNotFoundException
    */
   private void purgeInternal0() throws Exception {
      TupleBrowser browse = expiryTree.browse();
      Tuple tuple = new Tuple();
      List<Long> times = new ArrayList<Long>();
      List<Object> keys = new ArrayList<Object>();
      synchronized (expiryLock) {
         while (browse.getNext(tuple)) {
            Long time = (Long) tuple.getKey();
            if (time > System.currentTimeMillis())
               break;
            times.add(time);
            Object key = tuple.getValue();
View Full Code Here

            }
         }
      }

      // Browse the expiry and remove accordingly
      TupleBrowser browse = expiryTree.browse();
      Tuple tuple = new Tuple();
      List<Long> times = new ArrayList<Long>();
      List<Object> keys = new ArrayList<Object>();
      while (browse.getNext(tuple)) {
         Long time = (Long) tuple.getKey();
         if (time > System.currentTimeMillis())
            break;
         times.add(time);
         Object key = tuple.getValue();
View Full Code Here

            }
         }
      }

      // Browse the expiry and remove accordingly
      TupleBrowser browse = expiryTree.browse();
      Tuple tuple = new Tuple();
      List<Long> times = new ArrayList<Long>();
      List<Object> keys = new ArrayList<Object>();
      while (browse.getNext(tuple)) {
         Long time = (Long) tuple.getKey();
         if (time > System.currentTimeMillis())
            break;
         times.add(time);
         Object key = tuple.getValue();
View Full Code Here

   @Override
   Set<Object> getChildrenNames0(Fqn name) throws IOException
   {
      Fqn name2 = withDepth(name, name.size() + 1);
      TupleBrowser browser = tree.browse(name2);
      Tuple t = new Tuple();

      Set<Object> set = new HashSet<Object>();

      while (browser.getNext(t))
      {
         Fqn fqn = (Fqn) t.getKey();
         if (!fqn.isChildOf(name2))
         {
            break;
View Full Code Here

      }
   }

   Set<Object> getChildrenNames0(Fqn name) throws IOException
   {
      TupleBrowser browser = tree.browse(name);
      Tuple t = new Tuple();

      if (browser.getNext(t))
      {
         if (!t.getValue().equals(NODE))
         {
            log.trace(" not a node");
            return null;
         }
      }
      else
      {
         log.trace(" no nodes");
         return null;
      }

      Set<Object> set = new HashSet<Object>();

      // Want only /a/b/c/X nodes
      int depth = name.size() + 1;
      while (browser.getNext(t))
      {
         Fqn fqn = (Fqn) t.getKey();
         int size = fqn.size();
         if (size < depth)
         {
View Full Code Here

      Tuple t = new Tuple();
      Map map = new HashMap();

      synchronized (tree)
      {
         TupleBrowser browser = tree.browse(keys);
         while (browser.getNext(t))
         {
            Fqn fqn = (Fqn) t.getKey();
            if (!fqn.isChildOf(keys))
            {
               break;
View Full Code Here

      Fqn keys = keys(name);
      Tuple t = new Tuple();
      List<Object> removeList = new ArrayList<Object>();
      synchronized (tree)
      {
         TupleBrowser browser = tree.browse(keys);
         while (browser.getNext(t))
         {
            Fqn fqn = (Fqn) t.getKey();
            if (!fqn.isChildOf(keys))
            {
               break;
View Full Code Here

         log.trace("erase " + name + " self=" + self);
      }
      List<Object> removeList = new ArrayList<Object>();
      synchronized (tree)
      {
         TupleBrowser browser = tree.browse(name);
         Tuple t = new Tuple();
         boolean first = true;
         while (browser.getNext(t))
         {
          if (first && !self)
          {
             first = false;
             continue;
View Full Code Here

   /**
    * Dumps the tree past the key to debug.
    */
   public void dump(Object key) throws IOException
   {
      TupleBrowser browser = tree.browse(key);
      Tuple t = new Tuple();
      log.debug("contents: " + key);
      while (browser.getNext(t))
      {
         log.debug(t.getKey() + "\t" + t.getValue());
      }
      log.debug("");
   }
View Full Code Here

TOP

Related Classes of jdbm.helper.TupleBrowser

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.