Package org.entityfs.support.log

Examples of org.entityfs.support.log.LogAdapterHolder


{
  private final Map<Database<?, ?>, Entity[]> m_dbFiles = new HashMap<Database<?, ?>, Entity[]>();

  private ShadowCopyTransactionalDatabase<String, String, Long> createDatabaseUsingFile(Directory dir, EFile f, EFile indf)
  {
    LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
    BPlusTreeIndexBackendFileBackedNodeRepositoryBuilder<Long> nrb = new BPlusTreeIndexBackendFileBackedNodeRepositoryBuilder<Long>();
    nrb.setKeySerializer(LongNullSerializer.INSTANCE);
    nrb.setLogAdapterHolder(lah);
    ShadowCopyTransactionalDatabase<String, String, Long> res = new ShadowCopyTransactionalDatabase<String, String, Long>(new BPlusTreeIndexFileManager(new HeapBackendFileManager(f, dir), indf, dir), new BPlusTreeIndexBackendFactory<String, String, Long, Long>(new HeapBackendFactory<String, String>(StringSerializer.INSTANCE, StringSerializer.INSTANCE, lah), new LruCacheNodeRepositoryBuilder<Long, Long>().setProxiedBuilder(nrb), new StringToLongHasher(), lah), false, lah);
    m_dbFiles.put(res, new Entity[] { dir, f, indf });
View Full Code Here


    File tmpFile = FileSupport.createTempFile();
    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
      NodeRepository<Long> nr = new FileBackedNodeRepository<Long, Long>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), false, LongNullSerializer.INSTANCE, LongSerializer.INSTANCE, 8, 8192, null, lah);
      BPlusTree<Long, Long> btr = new BPlusTree<Long, Long>(nr, lah);
      try
      {
        btr.insert(2L, 3L);
View Full Code Here

    File tmpFile = FileSupport.createTempFile();
    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
      NodeRepository<Long> nr = new FileBackedNodeRepository<Long, Long>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), false, LongNullSerializer.INSTANCE, LongSerializer.INSTANCE, 8, 8192, null, lah);
      BPlusTree<Long, Long> btr = new BPlusTree<Long, Long>(nr, lah);
      try
      {
        assertFalse(btr.insertOrReplace(2L, 3L));
View Full Code Here

    return res;
  }

  private <V> void testFindKeyInternal(NodeRepository<Character> nr, ValueConverter<Character> kconv, ValueConverter<V> vconv)
  {
    BPlusTree<Character, V> btr = new BPlusTree<Character, V>(nr, new LogAdapterHolder(new StdOutLogAdapter()));
    try
    {
      insertTestRecords(btr, kconv, vconv);

      assertNull(btr.findRecord(kconv.convert(4), SearchMode.EXACT_MATCH));
View Full Code Here

    File tmpFile = FileSupport.createTempFile();
    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      NodeRepository<Character> nr = new FileBackedNodeRepository<Character, V>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(4), leafNodePointers, keySerializer, valueSerializer, pointerSize, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      if (cacheSize > 0)
      {
        nr = new LruCacheNodeRepository<Character, V>(nr, cacheSize);
      }
      testFindKeyInternal(nr, kconv, vconv);
View Full Code Here

public class MapBackendTest extends AbstractVariableRecordSizeBackendTest<String>
{
  @Override
  protected MapBackend<String, String> createBackend()
  {
    return new MapBackend<String, String>(StringSerializer.INSTANCE, StringSerializer.INSTANCE, new LogAdapterHolder(new StdOutLogAdapter()));
  }
View Full Code Here

    testFindKeyInternal(10);
  }

  private <K extends Comparable<K>, V> void testReplaceInNodeInternal(NodeRepository<K> nr, ValueConverter<K> kconv, ValueConverter<V> vconv)
  {
    BPlusTree<K, V> btr = new BPlusTree<K, V>(nr, new LogAdapterHolder(new StdOutLogAdapter()));
    try
    {
      insertTestRecords(btr, kconv, vconv);

      btr.replace(kconv.convert(85), vconv.convert(10));
View Full Code Here

    File tmpFile = FileSupport.createTempFile();
    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      NodeRepository<K> nr = new FileBackedNodeRepository<K, V>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(4), leafNodePointers, keySerializer, valueSerializer, pointerSize, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      if (cacheSize > 0)
      {
        nr = new LruCacheNodeRepository<K, V>(nr, cacheSize);
      }
      testReplaceInNodeInternal(nr, kconv, vconv);
View Full Code Here

    File tmpFile = FileSupport.createTempFile();
    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      NodeRepository<Long> nr = new FileBackedNodeRepository<Long, Long>(f, false, f.getSize(), new FixedSizeNodeSizeStrategy(new NumberOfRecordsNodeSizeStrategy(4).getNodeSize(9, 16, 0) + 3), false, LongNullSerializer.INSTANCE, LongSerializer.INSTANCE, 8, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      testReplaceInNodeInternal(nr, LONG_CONVERTER, LONG_CONVERTER);
      assertJunkUntouched(f, barr);
    }
    finally
    {
View Full Code Here

    File tmpFile = FileSupport.createTempFile();
    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
      NodeRepository<Long> nr = new FileBackedNodeRepository<Long, Long>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), false, LongNullSerializer.INSTANCE, LongSerializer.INSTANCE, 8, 8192, null, lah);
      BPlusTree<Long, Long> btr = new BPlusTree<Long, Long>(nr, lah);
      try
      {
        btr.replace(2L, 2L);
View Full Code Here

TOP

Related Classes of org.entityfs.support.log.LogAdapterHolder

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.