Examples of treeMap()


Examples of jdbm.RecordManager.treeMap()

 
  public void testStrings() throws IOException{
    long init = Long.MAX_VALUE - size*2;
    String file = newTestFile();
    RecordManager recman = new BaseRecordManager(file);
    PrimaryTreeMap<String, String> map = recman.treeMap("aa");
    for(long i = init; i<init+size/10;i++){
      map.put("aaaaa"+i, "");     
    }
    recman.commit();
    recman.defrag();   
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

public class StoreReferenceTest extends TestCaseWithTestFile{
 
  public void test() throws IOException{
    String file = newTestFile();
    RecordManager r = RecordManagerFactory.createRecordManager(file);
    PrimaryTreeMap<Long,StoreReference<String>> t = r.treeMap("aaa");
   
    t.put(1l, new StoreReference(r,"1"));
    t.put(2l, new StoreReference(r,"2"));
    r.commit();
   
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

    }
    recman.commit();
    recman.defrag();   
    recman.close();
    recman = new BaseRecordManager(file);
    map = recman.treeMap("aa");
    for(long i = init; i<init+size/10;i++){
      assertTrue(map.containsKey("aaaaa"+i));     
    }

    long fileSize = new File(file+".dbr.0").length()/1024;
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

    assertEquals("2",t.get(2l).get(r));
   
    //reopen store
    r.close();
    r = RecordManagerFactory.createRecordManager(file);
    t = r.treeMap("aaa");
    assertEquals("1",t.get(1l).get(r));
    assertEquals("2",t.get(2l).get(r));
    r.close();
   
  }
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

  }
 
 
  public void testSecondaryTreeMap() throws IOException{
    RecordManager r = newRecordManager();
    PrimaryTreeMap<Integer, String> m = r.treeMap("aa");
    SecondaryTreeMap<Integer, Integer, String> s = m.secondaryTreeMap("bb",
        new SecondaryKeyExtractor<Integer, Integer, String>() {

      public Integer extractSecondaryKey(Integer key, String value) {       
        return value.length();
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

  }
 
  public void testSecondaryHashMap() throws IOException{
    RecordManager r = newRecordManager();
    PrimaryTreeMap<Integer, String> m = r.treeMap("aa");
    SecondaryHashMap<Integer, Integer, String> s = m.secondaryHashMap("bb",
        new SecondaryKeyExtractor<Integer, Integer, String>() {

      public Integer extractSecondaryKey(Integer key, String value) {       
        return value.length();
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

  }
 
  public void testSecondaryTreeMapManyToOne() throws IOException{
    RecordManager r = newRecordManager();
    PrimaryTreeMap<Integer, String> m = r.treeMap("aa");
    SecondaryTreeMap<Integer, Integer, String> s = m.secondaryTreeMapManyToOne("bb",
        new SecondaryKeyExtractor<Iterable<Integer>, Integer, String>() {

      public List<Integer> extractSecondaryKey(Integer key, String value) {       
        return list(value.length(),10+value.length());
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

  }


  public void testSecondaryHashMapManyToOne() throws IOException{
    RecordManager r = newRecordManager();
    PrimaryTreeMap<Integer, String> m = r.treeMap("aa");
    SecondaryHashMap<Integer, Integer, String> s = m.secondaryHashMapManyToOne("bb",
        new SecondaryKeyExtractor<Iterable<Integer>, Integer, String>() {

      public List<Integer> extractSecondaryKey(Integer key, String value) {       
        return list(value.length(),10+value.length());
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

   
  }
 
  public void testInverseHashView() throws IOException{
    RecordManager r = newRecordManager();
    PrimaryTreeMap<Integer, String> m = r.treeMap("aa");
    InverseHashView<Integer, String> inverse = m.inverseHashView("aaInverse");   
    m.put(1, "a");
    m.put(2, "ab");
    m.put(3, "abc");
   
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

  static final class NoHashObject implements Serializable{}
 
  public void testInverseHashIdentityCheck() throws IOException{
    RecordManager r = newRecordManager();
    PrimaryTreeMap<Integer, Object> m = r.treeMap("aa");
    InverseHashView<Integer, Object> inverse = m.inverseHashView("aaInverse");
    try{
      for(int i =0; i<1000;i++){
        m.put(i, new NoHashObject());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.