Package org.entityfs.support.log

Examples of org.entityfs.support.log.LogAdapterHolder


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


  @SuppressWarnings("unchecked")
  private <K extends Comparable<K>, V> void testInsertFrom15ToOneWithTwoRecordsPerNodeInternal(NodeRepository<K> nr, ValueConverter<K> kconv, ValueConverter<V> vconv, long nonLeafNodeSize, long leafNodeSize)
  {
    NodePositions np = new NodePositions(nonLeafNodeSize, leafNodeSize, nr.getPositionOfRootNode());
    BPlusTree<K, V> btr = new BPlusTree<K, V>(nr, new LogAdapterHolder(new StdOutLogAdapter()));
    try
    {
      // *0[15, ]
      KeyAndValue<K, V> r15 = createLRecord(kconv, vconv, 15, 15);
      btr.insert(r15.getKey(), r15.getValue());
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(2), leafNodePointers, keySerializer, valueSerializer, pointerSize, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      if (cacheSize > 0)
      {
        nr = new LruCacheNodeRepository<K, V>(nr, cacheSize);
      }
      testInsertFrom15ToOneWithTwoRecordsPerNodeInternal(nr, kconv, vconv, getNonLeafNodeSize(keySerializer.getSerializedSize(), pointerSize, 2), getLeafNodeSize(keySerializer.getSerializedSize(), valueSerializer.getSerializedSize(), pointerSize, 2, leafNodePointers));
View Full Code Here

  @SuppressWarnings("unchecked")
  private <K extends Comparable<K>, V> void testInsertFromOneToTenInRandomOrderWithTwoRecordsPerNodeInternal(NodeRepository<K> nr, ValueConverter<K> kconv, ValueConverter<V> vconv, long nonLeafNodeSize, long leafNodeSize)
  {
    NodePositions np = new NodePositions(nonLeafNodeSize, leafNodeSize, nr.getPositionOfRootNode());
    BPlusTree<K, V> btr = new BPlusTree<K, V>(nr, new LogAdapterHolder(new StdOutLogAdapter()));
    try
    {
      // Insert 4, 2, 3, 9, 8, 6, 5, 1, 10, 7
      // *0[4, ]
      KeyAndValue<K, V> r4 = createLRecord(kconv, vconv, 4, 4);
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(2), leafNodePointers, keySerializer, valueSerializer, pointerSize, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      if (cacheSize > 0)
      {
        nr = new LruCacheNodeRepository<K, V>(nr, cacheSize);
      }
      testInsertFromOneToTenInRandomOrderWithTwoRecordsPerNodeInternal(nr, kconv, vconv, getNonLeafNodeSize(keySerializer.getSerializedSize(), pointerSize, 2), getLeafNodeSize(keySerializer.getSerializedSize(), valueSerializer.getSerializedSize(), pointerSize, 2, leafNodePointers));
View Full Code Here

  @SuppressWarnings("unchecked")
  private <K extends Comparable<K>, V> void testInsertWithTreeRecordsPerNodeInternal(NodeRepository<K> nr, ValueConverter<K> kconv, ValueConverter<V> vconv, long nonLeafNodeSize, long leafNodeSize)
  {
    NodePositions np = new NodePositions(nonLeafNodeSize, leafNodeSize, nr.getPositionOfRootNode());
    BPlusTree<K, V> btr = new BPlusTree<K, V>(nr, new LogAdapterHolder(new StdOutLogAdapter()));
    try
    {
      // Insert 5, 10, 30, 50, 25, 15, 20, 55, 75, 80, 85, 60, 65, 90,
      // 28, 70, 95, 72
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(3), leafNodePointers, keySerializer, valueSerializer, pointerSize, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      if (cacheSize > 0)
      {
        nr = new LruCacheNodeRepository<K, V>(nr, cacheSize);
      }
      testInsertWithTreeRecordsPerNodeInternal(nr, kconv, vconv, getNonLeafNodeSize(keySerializer.getSerializedSize(), pointerSize, 3), getLeafNodeSize(keySerializer.getSerializedSize(), valueSerializer.getSerializedSize(), pointerSize, 3, leafNodePointers));
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  private <K extends Comparable<K>, V> void testInsertWithFourRecordsPerNodeInternal(NodeRepository<K> nr, NodePositions np, ValueConverter<K> kconv, ValueConverter<V> vconv)
  {
    BPlusTree<K, V> btr = new BPlusTree<K, V>(nr, new LogAdapterHolder(new StdOutLogAdapter()));
    try
    {
      // Insert 5, 10, 30, 50, 25, 15, 20, 55, 75, 80, 85, 60, 65, 90, 73,
      // 100
      // 0[(1),25(2),50(3),75(4), ]
View Full Code Here

    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      int nodeSize = new NumberOfRecordsNodeSizeStrategy(4).getNodeSize(9, 2 * LongSerializer.DATA_SIZE, 0) + 3;
      NodeRepository<Long> nr = new FileBackedNodeRepository<Long, Long>(f, false, f.getSize(), new FixedSizeNodeSizeStrategy(nodeSize), false, LongNullSerializer.INSTANCE, LongSerializer.INSTANCE, 8, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      testInsertWithFourRecordsPerNodeInternal(nr, new NodePositions(nodeSize, nodeSize, nr.getPositionOfRootNode()), 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);
      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);
      }
      testInsertWithFourRecordsPerNodeInternal(nr, new NodePositions(getNonLeafNodeSize(keySerializer.getSerializedSize(), pointerSize, 4), getLeafNodeSize(keySerializer.getSerializedSize(), valueSerializer.getSerializedSize(), pointerSize, 4, leafNodePointers), nr.getPositionOfRootNode()), kconv, vconv);
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.