Package org.helidb.util.bplus

Examples of org.helidb.util.bplus.NumberOfRecordsNodeSizeStrategy


  private LoggingTransactionalDatabase<String, String, Long> createDbUsingFiles(EFile f, EFile treef, EFile logf)
  {
    LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
    lah.setLevel(Level.SEVERE);
    DatabaseBackend<String, String, Long> backend = new HeapBackend<String, String>(f, false, StringNullSerializer.INSTANCE, StringSerializer.INSTANCE, 0, 8192, lah);
    NodeRepository<Long> nr = new LruCacheNodeRepository<Long, Long>(new FileBackedNodeRepository<Long, Long>(treef, false, 0, new NumberOfRecordsNodeSizeStrategy(3), true, LongNullSerializer.INSTANCE, LongSerializer.INSTANCE, 4, 8192, null, lah), 10);
    BPlusTree<Long, Long> tree = new BPlusTree<Long, Long>(nr, lah);
    backend = new BPlusTreeIndexBackend<String, String, Long, Long>(backend, false, tree, StringToLongHasher.INSTANCE, lah);
    LoggingTransactionalDatabase<String, String, Long> res = new LoggingTransactionalDatabase<String, String, Long>(backend, logf, StringNullSerializer.INSTANCE, StringSerializer.INSTANCE, lah);
    m_dbFiles.put(res, new EFile[] { f, treef, logf });
    return res;
View Full Code Here


  private LoggingTransactionalDatabase<Integer, Long, KeyAndValue<Integer, Long>> createDbUsingFiles(EFile f, EFile logf)
  {
    LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
    lah.setLevel(Level.SEVERE);
    NodeRepository<Integer> nr = new LruCacheNodeRepository<Integer, Long>(new FileBackedNodeRepository<Integer, Long>(f, false, 0, new NumberOfRecordsNodeSizeStrategy(4), true, IntegerNullSerializer.INSTANCE, LongSerializer.INSTANCE, 4, 8192, null, lah), 10);
    ConstantRecordSizeBPlusTreeBackend<Integer, Long> backend = new ConstantRecordSizeBPlusTreeBackend<Integer, Long>(nr, false, lah);
    LoggingTransactionalDatabase<Integer, Long, KeyAndValue<Integer, Long>> res = new LoggingTransactionalDatabase<Integer, Long, KeyAndValue<Integer, Long>>(backend, logf, IntegerNullSerializer.INSTANCE, LongSerializer.INSTANCE, lah);
    m_dbFiles.put(res, new EFile[] { f, logf });
    return res;
  }
View Full Code Here

  private LoggingTransactionalDatabase<Character, Character, KeyAndValue<Character, Character>> createCharacterDbUsingFiles(EFile f, EFile logf)
  {
    LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
    lah.setLevel(Level.SEVERE);
    NodeRepository<Character> nr = new LruCacheNodeRepository<Character, Character>(new FileBackedNodeRepository<Character, Character>(f, false, 0, new NumberOfRecordsNodeSizeStrategy(2), true, CharacterNullSerializer.INSTANCE, CharacterSerializer.INSTANCE, 4, 8192, null, lah), 10);
    ConstantRecordSizeBPlusTreeBackend<Character, Character> backend = new ConstantRecordSizeBPlusTreeBackend<Character, Character>(nr, false, lah);
    LoggingTransactionalDatabase<Character, Character, KeyAndValue<Character, Character>> res = new LoggingTransactionalDatabase<Character, Character, KeyAndValue<Character, Character>>(backend, logf, CharacterNullSerializer.INSTANCE, CharacterSerializer.INSTANCE, lah);
    m_dbFiles.put(res, new EFile[] { f, logf });
    return res;
  }
View Full Code Here

    File dbFile = FileSupport.createTempFile();
    File indexFile = FileSupport.createTempFile();
    LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
    // Set a ridiculously low buffer size
    HeapBackend<String, String> hb = new HeapBackend<String, String>(new ReadWritableFileAdapter(dbFile), false, StringSerializer.INSTANCE, StringSerializer.INSTANCE, 0L, 4, lah);
    BPlusTreeIndexBackend<String, String, Long, Long> res = new BPlusTreeIndexBackend<String, String, Long, Long>(hb, false, new BPlusTree<Long, Long>(new FileBackedNodeRepository<Long, Long>(new ReadWritableFileAdapter(indexFile), false, 0, new NumberOfRecordsNodeSizeStrategy(5), true, LongNullSerializer.INSTANCE, LongSerializer.INSTANCE, 6, 8192, null, lah), lah), new StringToLongHasher(), lah);
    m_dbFiles.put(res, dbFile);
    m_indexFiles.put(res, indexFile);
    return res;
  }
View Full Code Here

  {
    File dbFile = FileSupport.createTempFile();
    File indexFile = FileSupport.createTempFile();
    LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
    DatabaseBackend<Integer, Long, Long> db = new ConstantRecordSizeHeapBackend<Integer, Long>(new ReadWritableFileAdapter(dbFile), false, IntegerSerializer.INSTANCE, LongSerializer.INSTANCE, 0L, 8192, lah);
    BPlusTreeIndexBackend<Integer, Long, Integer, Long> res = new BPlusTreeIndexBackend<Integer, Long, Integer, Long>(db, false, new BPlusTree<Integer, Long>(new FileBackedNodeRepository<Integer, Long>(new ReadWritableFileAdapter(indexFile), false, 0, new NumberOfRecordsNodeSizeStrategy(5), true, IntegerNullSerializer.INSTANCE, LongSerializer.INSTANCE, 6, 8192, null, lah), lah), IntegerToIntegerHasher.INSTANCE, lah);
    m_dbFiles.put(res, dbFile);
    m_indexFiles.put(res, indexFile);
    return res;
  }
View Full Code Here

  {
    File dbFile = FileSupport.createTempFile();
    File indexFile = FileSupport.createTempFile();
    LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
    DatabaseBackend<Character, Character, Long> db = new ConstantRecordSizeHeapBackend<Character, Character>(new ReadWritableFileAdapter(dbFile), false, CharacterSerializer.INSTANCE, CharacterSerializer.INSTANCE, 0L, 8192, lah);
    BPlusTreeIndexBackend<Character, Character, Character, Long> res = new BPlusTreeIndexBackend<Character, Character, Character, Long>(db, false, new BPlusTree<Character, Long>(new FileBackedNodeRepository<Character, Long>(new ReadWritableFileAdapter(indexFile), false, 0, new NumberOfRecordsNodeSizeStrategy(5), true, CharacterNullSerializer.INSTANCE, LongSerializer.INSTANCE, 6, 8192, null, lah), lah), CharacterToCharacterHasher.INSTANCE, lah);
    m_dbFiles.put(res, dbFile);
    m_indexFiles.put(res, indexFile);
    return res;
  }
View Full Code Here

TOP

Related Classes of org.helidb.util.bplus.NumberOfRecordsNodeSizeStrategy

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.