test_class.declarator: fac = Volume.memoryFactory(false)
test_class.original_string: Volume.Factory fac = Volume.memoryFactory(false);
test_class.type: Volume.Factory
test_class.var_name: fac
test_class.file: migration/third-party/org.mapdb/src/test/java/org/mapdb/StorageDirect2Test.java
test_class.identifier: StorageDirect2Test
test_class.superclass: extends EngineTest<StorageDirect2>
test_case.body: @Test
      public void phys_append_alloc_link3(){
          long[] ret = e.physAllocate(100 + MAX_REC_SIZE*2);
          long exp1 = MASK_IS_LINKED | ((long)MAX_REC_SIZE)<<48 | 8L;
          long exp2 = MASK_IS_LINKED | ((long)MAX_REC_SIZE)<<48 | (8L+MAX_REC_SIZE);
          long exp3 = ((long)120)<<48 | (8L+MAX_REC_SIZE*2);
  
          assertArrayEquals(new long[]{exp1, exp2, exp3}, ret);
      }
test_case.class_method_signature: StorageDirect2Test.phys_append_alloc_link3()
test_case.full_signature: @Test public void phys_append_alloc_link3()
test_case.identifier: phys_append_alloc_link3
test_case.invocations: physAllocate assertArrayEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void phys_append_alloc_link3()
focal_class.declarator: MASK_OFFSET = 0x0000FFFFFFFFFFFFL
focal_class.modifier: protected static final
focal_class.original_string: protected static final long MASK_OFFSET = 0x0000FFFFFFFFFFFFL;
focal_class.type: long
focal_class.var_name: MASK_OFFSET
focal_class.declarator: MASK_SIZE = 0x7fff000000000000L
focal_class.modifier: protected static final
focal_class.original_string: protected static final long MASK_SIZE = 0x7fff000000000000L;
focal_class.type: long
focal_class.var_name: MASK_SIZE
focal_class.declarator: MASK_IS_LINKED = 0x8000000000000000L
focal_class.modifier: protected static final
focal_class.original_string: protected static final long MASK_IS_LINKED = 0x8000000000000000L;
focal_class.type: long
focal_class.var_name: MASK_IS_LINKED
focal_class.declarator: HEADER = 9032094932889042394L
focal_class.modifier: protected static final
focal_class.original_string: protected static final long HEADER = 9032094932889042394L;
focal_class.type: long
focal_class.var_name: HEADER
focal_class.declarator: MAX_REC_SIZE = 32767
focal_class.modifier: protected static final
focal_class.original_string: protected static final int MAX_REC_SIZE = 32767;
focal_class.type: int
focal_class.var_name: MAX_REC_SIZE
focal_class.declarator: PHYS_FREE_SLOTS_COUNT = 2048
focal_class.modifier: protected static final
focal_class.original_string: protected static final int PHYS_FREE_SLOTS_COUNT = 2048;
focal_class.type: int
focal_class.var_name: PHYS_FREE_SLOTS_COUNT
focal_class.declarator: IO_INDEX_SIZE = 1*8
focal_class.modifier: protected static final
focal_class.original_string: protected static final int IO_INDEX_SIZE = 1*8;
focal_class.type: int
focal_class.var_name: IO_INDEX_SIZE
focal_class.declarator: IO_PHYS_SIZE = 2*8
focal_class.modifier: protected static final
focal_class.original_string: protected static final int IO_PHYS_SIZE = 2*8;
focal_class.type: int
focal_class.var_name: IO_PHYS_SIZE
focal_class.declarator: IO_FREE_RECID = 15*8
focal_class.modifier: protected static final
focal_class.original_string: protected static final int IO_FREE_RECID = 15*8;
focal_class.type: int
focal_class.var_name: IO_FREE_RECID
focal_class.declarator: IO_USER_START = IO_FREE_RECID+PHYS_FREE_SLOTS_COUNT*8
focal_class.modifier: protected static final
focal_class.original_string: protected static final int IO_USER_START = IO_FREE_RECID+PHYS_FREE_SLOTS_COUNT*8;
focal_class.type: int
focal_class.var_name: IO_USER_START
focal_class.declarator: CONCURRENCY_FACTOR = 32
focal_class.modifier: protected static final
focal_class.original_string: protected static final int CONCURRENCY_FACTOR = 32;
focal_class.type: int
focal_class.var_name: CONCURRENCY_FACTOR
focal_class.declarator: locks
focal_class.modifier: protected final
focal_class.original_string: protected final ReentrantReadWriteLock[] locks;
focal_class.type: ReentrantReadWriteLock[]
focal_class.var_name: locks
focal_class.declarator: freeSpaceLock
focal_class.modifier: protected final
focal_class.original_string: protected final ReentrantLock freeSpaceLock;
focal_class.type: ReentrantLock
focal_class.var_name: freeSpaceLock
focal_class.declarator: index
focal_class.modifier: protected
focal_class.original_string: protected Volume index;
focal_class.type: Volume
focal_class.var_name: index
focal_class.declarator: phys
focal_class.modifier: protected
focal_class.original_string: protected Volume phys;
focal_class.type: Volume
focal_class.var_name: phys
focal_class.declarator: readOnly
focal_class.modifier: protected final
focal_class.original_string: protected final boolean readOnly;
focal_class.type: boolean
focal_class.var_name: readOnly
focal_class.file: migration/third-party/org.mapdb/src/main/java/org/mapdb/StorageDirect2.java
focal_class.identifier: StorageDirect2
focal_class.interfaces: implements Engine
focal_class.class_method_signature: StorageDirect2.StorageDirect2(Volume.Factory volFac, boolean readOnly)
focal_class.full_signature: public  StorageDirect2(Volume.Factory volFac, boolean readOnly)
focal_class.identifier: StorageDirect2
focal_class.modifiers: public
focal_class.parameters: (Volume.Factory volFac, boolean readOnly)
focal_class.signature:  StorageDirect2(Volume.Factory volFac, boolean readOnly)
focal_class.class_method_signature: StorageDirect2.checkHeaders()
focal_class.full_signature: protected void checkHeaders()
focal_class.identifier: checkHeaders
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkHeaders()
focal_class.class_method_signature: StorageDirect2.createStructure()
focal_class.full_signature: protected void createStructure()
focal_class.identifier: createStructure
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void createStructure()
focal_class.class_method_signature: StorageDirect2.put(A value, Serializer<A> serializer)
focal_class.full_signature: @Override public long put(A value, Serializer<A> serializer)
focal_class.identifier: put
focal_class.modifiers: @Override public
focal_class.parameters: (A value, Serializer<A> serializer)
focal_class.return: long
focal_class.signature: long put(A value, Serializer<A> serializer)
focal_class.class_method_signature: StorageDirect2.get(long recid, Serializer<A> serializer)
focal_class.full_signature: @Override public A get(long recid, Serializer<A> serializer)
focal_class.identifier: get
focal_class.modifiers: @Override public
focal_class.parameters: (long recid, Serializer<A> serializer)
focal_class.return: A
focal_class.signature: A get(long recid, Serializer<A> serializer)
focal_class.class_method_signature: StorageDirect2.update(long recid, A value, Serializer<A> serializer)
focal_class.full_signature: @Override public void update(long recid, A value, Serializer<A> serializer)
focal_class.identifier: update
focal_class.modifiers: @Override public
focal_class.parameters: (long recid, A value, Serializer<A> serializer)
focal_class.return: void
focal_class.signature: void update(long recid, A value, Serializer<A> serializer)
focal_class.class_method_signature: StorageDirect2.compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer)
focal_class.full_signature: @Override public boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer)
focal_class.identifier: compareAndSwap
focal_class.modifiers: @Override public
focal_class.parameters: (long recid, A expectedOldValue, A newValue, Serializer<A> serializer)
focal_class.return: boolean
focal_class.signature: boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer)
focal_class.class_method_signature: StorageDirect2.delete(long recid, Serializer<A> serializer)
focal_class.full_signature: @Override public void delete(long recid, Serializer<A> serializer)
focal_class.identifier: delete
focal_class.modifiers: @Override public
focal_class.parameters: (long recid, Serializer<A> serializer)
focal_class.return: void
focal_class.signature: void delete(long recid, Serializer<A> serializer)
focal_class.class_method_signature: StorageDirect2.physAllocate(int size)
focal_class.full_signature: protected long[] physAllocate(int size)
focal_class.identifier: physAllocate
focal_class.modifiers: protected
focal_class.parameters: (int size)
focal_class.return: long[]
focal_class.signature: long[] physAllocate(int size)
focal_class.class_method_signature: StorageDirect2.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: StorageDirect2.isClosed()
focal_class.full_signature: @Override public boolean isClosed()
focal_class.identifier: isClosed
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isClosed()
focal_class.class_method_signature: StorageDirect2.commit()
focal_class.full_signature: @Override public void commit()
focal_class.identifier: commit
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void commit()
focal_class.class_method_signature: StorageDirect2.rollback()
focal_class.full_signature: @Override public void rollback()
focal_class.identifier: rollback
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void rollback()
focal_class.class_method_signature: StorageDirect2.isReadOnly()
focal_class.full_signature: @Override public boolean isReadOnly()
focal_class.identifier: isReadOnly
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isReadOnly()
focal_class.class_method_signature: StorageDirect2.compact()
focal_class.full_signature: @Override public void compact()
focal_class.identifier: compact
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void compact()
focal_class.class_method_signature: StorageDirect2.longStackTake(long indexOffset)
focal_class.full_signature: protected long longStackTake(long indexOffset)
focal_class.identifier: longStackTake
focal_class.modifiers: protected
focal_class.parameters: (long indexOffset)
focal_class.return: long
focal_class.signature: long longStackTake(long indexOffset)
focal_class.class_method_signature: StorageDirect2.longStackPut(long indexOffset, long value)
focal_class.full_signature: protected long longStackPut(long indexOffset, long value)
focal_class.identifier: longStackPut
focal_class.modifiers: protected
focal_class.parameters: (long indexOffset, long value)
focal_class.return: long
focal_class.signature: long longStackPut(long indexOffset, long value)
focal_class.class_method_signature: StorageDirect2.freeRecidPut(long recid)
focal_class.full_signature: protected void freeRecidPut(long recid)
focal_class.identifier: freeRecidPut
focal_class.modifiers: protected
focal_class.parameters: (long recid)
focal_class.return: void
focal_class.signature: void freeRecidPut(long recid)
focal_class.class_method_signature: StorageDirect2.freeRecidTake()
focal_class.full_signature: protected long freeRecidTake()
focal_class.identifier: freeRecidTake
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long freeRecidTake()
focal_class.class_method_signature: StorageDirect2.freePhysPut(long indexVal)
focal_class.full_signature: protected void freePhysPut(long indexVal)
focal_class.identifier: freePhysPut
focal_class.modifiers: protected
focal_class.parameters: (long indexVal)
focal_class.return: void
focal_class.signature: void freePhysPut(long indexVal)
focal_class.class_method_signature: StorageDirect2.freePhysTake(int size)
focal_class.full_signature: protected long freePhysTake(int size)
focal_class.identifier: freePhysTake
focal_class.modifiers: protected
focal_class.parameters: (int size)
focal_class.return: long
focal_class.signature: long freePhysTake(int size)
focal_class.class_method_signature: StorageDirect2.serialize(A value, Serializer<A> serializer)
focal_class.full_signature: protected DataOutput2 serialize(A value, Serializer<A> serializer)
focal_class.identifier: serialize
focal_class.modifiers: protected
focal_class.parameters: (A value, Serializer<A> serializer)
focal_class.return: DataOutput2
focal_class.signature: DataOutput2 serialize(A value, Serializer<A> serializer)
focal_method.body: protected long[] physAllocate(int size) {
          //append to end of file
          if(size<MAX_REC_SIZE){
              long physSize = index.getLong(IO_PHYS_SIZE);
              index.putLong(IO_PHYS_SIZE, physSize+size);
              phys.ensureAvailable(physSize+size);
              physSize = physSize ^ (((long)size)<<48);
              return new long[]{physSize};
          }else{
              long[] ret = new long[2];
              int retPos = 0;
              int c = 12;
  
              while(size>0){
                  if(retPos == ret.length) ret = Arrays.copyOf(ret, ret.length*2);
                  int allocSize = Math.min(size, MAX_REC_SIZE);
                  size -= allocSize - c;
  
                  //append to end of file
                  long physSize = index.getLong(IO_PHYS_SIZE);
                  index.putLong(IO_PHYS_SIZE, physSize+allocSize);
                  phys.ensureAvailable(physSize+allocSize);
                  physSize = physSize ^ (((long)allocSize)<<48);
                  if(c!=0) physSize|=MASK_IS_LINKED;
                  ret[retPos++] = physSize;
  
                  c = size<=MAX_REC_SIZE ? 0 : 8;
              }
              if(size!=0) throw new InternalError();
  
              return Arrays.copyOf(ret, retPos);
          }
      }
focal_method.class_method_signature: StorageDirect2.physAllocate(int size)
focal_method.full_signature: protected long[] physAllocate(int size)
focal_method.identifier: physAllocate
focal_method.invocations: getLong putLong ensureAvailable copyOf min getLong putLong ensureAvailable copyOf
focal_method.modifiers: protected
focal_method.parameters: (int size)
focal_method.return: long[]
focal_method.signature: long[] physAllocate(int size)