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);
      NodeRepository<K> nr = new FileBackedNodeRepository<K, V>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(8), leafNodePointers, keySerializer, valueSerializer, pointerSize, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      if (cacheSize > 0)
      {
        nr = new LruCacheNodeRepository<K, V>(nr, cacheSize);
      }
      testStealTwoNonLeafRecordsFromNodeToTheLeftInternal(nr, new NodePositions(getNonLeafNodeSize(keySerializer.getSerializedSize(), pointerSize, 8), getLeafNodeSize(keySerializer.getSerializedSize(), valueSerializer.getSerializedSize(), pointerSize, 8, leafNodePointers), nr.getPositionOfRootNode()), kconv, vconv);
View Full Code Here


    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      // 8 records per node + 5 extra bytes
      int nodeSize = new NumberOfRecordsNodeSizeStrategy(8).getNodeSize(9, 16, 0) + 5;
      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()));
      testStealTwoNonLeafRecordsFromNodeToTheLeftInternal(nr, new NodePositions(nodeSize, nodeSize, nr.getPositionOfRootNode()), LONG_CONVERTER, LONG_CONVERTER);
      assertJunkUntouched(f, barr);
    }
    finally
    {
View Full Code Here

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

  private ShadowCopyTransactionalDatabase<String, String, Long> createDatabaseUsingFile(Directory dir, EFile f)
  {
    LogAdapterHolder lah = new LogAdapterHolder(new StdOutLogAdapter());
    ShadowCopyTransactionalDatabase<String, String, Long> res = new ShadowCopyTransactionalDatabase<String, String, Long>(new SingleFileManager(f, dir), new HeapBackendFactory<String, String>(StringSerializer.INSTANCE, StringSerializer.INSTANCE, lah), false, lah);
    m_dbFiles.put(res, new Entity[] { dir, f });
    return res;
  }
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 NumberOfRecordsNodeSizeStrategy(2), false, LongNullSerializer.INSTANCE, LongSerializer.INSTANCE, 8, 8192, null, new LogAdapterHolder(new StdOutLogAdapter()));
      BPlusTree<Long, Long> btr = new BPlusTree<Long, Long>(nr, new LogAdapterHolder(new StdOutLogAdapter()));
      try
      {
        assertFalse(btr.isIteratorSupported());

        try
View Full Code Here

    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      Iterator<Long> itr = null;
      BPlusTree<Long, Integer> btr = new BPlusTree<Long, Integer>(new FileBackedNodeRepository<Long, Integer>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), true, LongNullSerializer.INSTANCE, IntegerSerializer.INSTANCE, 3, 8192, null, new LogAdapterHolder(new StdOutLogAdapter())), new LogAdapterHolder(new StdOutLogAdapter()));
      try
      {
        itr = btr.keyIterator();
        assertFalse(itr.hasNext());
View Full Code Here

    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      Iterator<Long> itr = null;
      BPlusTree<Long, Integer> btr = new BPlusTree<Long, Integer>(new LruCacheNodeRepository<Long, Integer>(new FileBackedNodeRepository<Long, Integer>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), true, LongNullSerializer.INSTANCE, IntegerSerializer.INSTANCE, 3, 8192, null, new LogAdapterHolder(new StdOutLogAdapter())), 10), new LogAdapterHolder(new StdOutLogAdapter()));
      try
      {
        itr = btr.keyIterator();
        assertFalse(itr.hasNext());
        try
View Full Code Here

    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      Iterator<Integer> itr = null;
      BPlusTree<Long, Integer> btr = new BPlusTree<Long, Integer>(new FileBackedNodeRepository<Long, Integer>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), true, LongNullSerializer.INSTANCE, IntegerSerializer.INSTANCE, 3, 8192, null, new LogAdapterHolder(new StdOutLogAdapter())), new LogAdapterHolder(new StdOutLogAdapter()));
      try
      {
        itr = btr.valueIterator();
        assertFalse(itr.hasNext());
View Full Code Here

    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      Iterator<Integer> itr = null;
      BPlusTree<Long, Integer> btr = new BPlusTree<Long, Integer>(new FileBackedNodeRepository<Long, Integer>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), true, LongNullSerializer.INSTANCE, IntegerSerializer.INSTANCE, 3, 8192, null, new LogAdapterHolder(new StdOutLogAdapter())), new LogAdapterHolder(new StdOutLogAdapter()));
      try
      {
        itr = btr.valueIterator();
        assertFalse(itr.hasNext());
        try
View Full Code Here

    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      Iterator<Record<Long, Integer>> itr = null;
      BPlusTree<Long, Integer> btr = new BPlusTree<Long, Integer>(new FileBackedNodeRepository<Long, Integer>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), true, LongNullSerializer.INSTANCE, IntegerSerializer.INSTANCE, 3, 8192, null, new LogAdapterHolder(new StdOutLogAdapter())), new LogAdapterHolder(new StdOutLogAdapter()));
      try
      {
        itr = btr.iterator();
        assertFalse(itr.hasNext());
View Full Code Here

    try
    {
      ReadWritableFile f = new ReadWritableFileAdapter(tmpFile);
      byte[] barr = writeJunk(f);
      Iterator<Record<Long, Integer>> itr = null;
      BPlusTree<Long, Integer> btr = new BPlusTree<Long, Integer>(new FileBackedNodeRepository<Long, Integer>(f, false, f.getSize(), new NumberOfRecordsNodeSizeStrategy(2), true, LongNullSerializer.INSTANCE, IntegerSerializer.INSTANCE, 3, 8192, null, new LogAdapterHolder(new StdOutLogAdapter())), new LogAdapterHolder(new StdOutLogAdapter()));
      try
      {
        itr = btr.iterator();
        assertFalse(itr.hasNext());
        try
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.