Examples of treeMap()


Examples of jdbm.RecordManager.treeMap()

   
  public static void main(String[] args) throws IOException {
    //init Record Manager and dao
    RecordManager recman = RecordManagerFactory.createRecordManager("persons1");

    PrimaryTreeMap<String,Person> personsByName = recman.treeMap("personsByName");

    SecondaryTreeMap<String, String, Person> personsByTown =
        personsByName.secondaryTreeMap("personsByTown",
            new SecondaryKeyExtractor<String, String, Person>() {
              public String extractSecondaryKey(String key,Person value) {
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

    RecordManager recMan = RecordManagerFactory.createRecordManager(fileName);
   
    /** Creates TreeMap which stores data in database. 
     *  Constructor method takes recordName (something like SQL table name)*/
    String recordName = "firstTreeMap";
    PrimaryTreeMap<Integer,String> treeMap = recMan.treeMap(recordName);

    /** add some stuff to map*/
    treeMap.put(1, "One");
    treeMap.put(2, "Two");
    treeMap.put(3, "Three");
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

public class HugeData {
  public static void main(String[] args) throws IOException {

    /** open db */
        RecordManager recman = RecordManagerFactory.createRecordManager( "hugedata");       
        PrimaryTreeMap<Long, String> m = recman.treeMap("hugemap");
       
        /** insert 1e7 records */
        for(long i = 0;i<1e8;i++){
          m.put(i, "aa"+i);       
          if(i%1e5==0){
View Full Code Here

Examples of jdbm.RecordManager.treeMap()

        i.incrementAndGet();
        out.writeUTF(obj);
      }};
     
    RecordManager recman = newRecordManager();
    PrimaryTreeMap<Long,String> t =  recman.treeMap("test",ser);
    t.put(1l, "hopsa hejsa1");
    t.put(2l, "hopsa hejsa2");
    recman.commit();
    assertEquals(t.get(2l),"hopsa hejsa2");
    assertTrue(i.intValue()>0);
View Full Code Here

Examples of jdbm.recman.BaseRecordManager.treeMap()

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

Examples of jdbm.recman.BaseRecordManager.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.recman.BaseRecordManager.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
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.