Package jdbm.htree

Examples of jdbm.htree.HTree


   *
   * @param handle
   * @return
   */
  private HTree getHashtableForHandle(String handle) {
    HTree hashtable = metrics.get(handle);
    if (null == hashtable) {
      try {
        long recid = recman.getNamedObject(handle);
        if (recid != 0) {
          hashtable = HTree.load(recman, recid);
        } else {
          hashtable = HTree.createInstance(recman);
          recman.setNamedObject(handle, hashtable.getRecid());
        }
        metrics.put(handle, hashtable);
      } catch (Throwable e) {
        logger.log(Level.SEVERE, "Counld not get cached value for "
            + handle, e);
View Full Code Here


  void setStat( Stat update ) throws IOException {
    db.update( stat, update );
  }

  HTree getData() throws IOException {
    HTree tree;
    long recid = db.getNamedObject( DATA_TREE );
    if ( recid != 0 ) {
      tree = HTree.load( db, recid );
    } else {
      tree = HTree.createInstance( db );
      db.setNamedObject( DATA_TREE, tree.getRecid() );
    }
    return tree;
  }
View Full Code Here

    test this issue
    http://code.google.com/p/jdbm2/issues/detail?id=2
     */
    public void testHTreeClear() throws IOException {
        final RecordManager recman = newRecordManager();
        final HTree tree = HTree.createInstance(recman);
        recman.setNamedObject("test", tree.getRecid());
        final HTreeMap<String,String> treeMap = tree.asMap();

        for (int i = 0; i < 1001; i++) {
            treeMap.put(String.valueOf(i),String.valueOf(i));
        }
        recman.commit();
View Full Code Here

TOP

Related Classes of jdbm.htree.HTree

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.