test_class.declarator: UNITTEST = UnitTestParams.get()
test_class.modifier: private static final
test_class.original_string: private static final NetworkParameters UNITTEST = UnitTestParams.get();
test_class.type: NetworkParameters
test_class.var_name: UNITTEST
test_class.declarator: blockStoreFile
test_class.modifier: private
test_class.original_string: private File blockStoreFile;
test_class.type: File
test_class.var_name: blockStoreFile
test_class.file: core/src/test/java/org/ulordj/store/SPVBlockStoreTest.java
test_class.identifier: SPVBlockStoreTest
test_case.body: @Test(expected = BlockStoreException.class)
      public void twoStores_sequentially_butMismatchingCapacity() throws Exception {
          SPVBlockStore store = new SPVBlockStore(UNITTEST, blockStoreFile, 10, false);
          store.close();
          store = new SPVBlockStore(UNITTEST, blockStoreFile, 20, false);
      }
test_case.class_method_signature: SPVBlockStoreTest.twoStores_sequentially_butMismatchingCapacity()
test_case.full_signature: @Test(expected = BlockStoreException.class) public void twoStores_sequentially_butMismatchingCapacity()
test_case.identifier: twoStores_sequentially_butMismatchingCapacity
test_case.invocations: close
test_case.modifiers: @Test(expected = BlockStoreException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void twoStores_sequentially_butMismatchingCapacity()
focal_class.declarator: log = LoggerFactory.getLogger(SPVBlockStore.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(SPVBlockStore.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: DEFAULT_CAPACITY = 5000
focal_class.modifier: public static final
focal_class.original_string: public static final int DEFAULT_CAPACITY = 5000;
focal_class.type: int
focal_class.var_name: DEFAULT_CAPACITY
focal_class.declarator: HEADER_MAGIC = "SPVB"
focal_class.modifier: public static final
focal_class.original_string: public static final String HEADER_MAGIC = "SPVB";
focal_class.type: String
focal_class.var_name: HEADER_MAGIC
focal_class.declarator: buffer
focal_class.modifier: protected volatile
focal_class.original_string: protected volatile MappedByteBuffer buffer;
focal_class.type: MappedByteBuffer
focal_class.var_name: buffer
focal_class.declarator: params
focal_class.modifier: protected final
focal_class.original_string: protected final NetworkParameters params;
focal_class.type: NetworkParameters
focal_class.var_name: params
focal_class.declarator: lock = Threading.lock("SPVBlockStore")
focal_class.modifier: protected
focal_class.original_string: protected ReentrantLock lock = Threading.lock("SPVBlockStore");
focal_class.type: ReentrantLock
focal_class.var_name: lock
focal_class.declarator: blockCache = new LinkedHashMap<Sha256Hash, StoredBlock>() {
          @Override
          protected boolean removeEldestEntry(Map.Entry<Sha256Hash, StoredBlock> entry) {
              return size() > 2050;  // Slightly more than the difficulty transition period.
          }
      }
focal_class.modifier: protected
focal_class.original_string: protected LinkedHashMap<Sha256Hash, StoredBlock> blockCache = new LinkedHashMap<Sha256Hash, StoredBlock>() {
          @Override
          protected boolean removeEldestEntry(Map.Entry<Sha256Hash, StoredBlock> entry) {
              return size() > 2050;  // Slightly more than the difficulty transition period.
          }
      };
focal_class.type: LinkedHashMap<Sha256Hash, StoredBlock>
focal_class.var_name: blockCache
focal_class.declarator: NOT_FOUND_MARKER = new Object()
focal_class.modifier: private static final
focal_class.original_string: private static final Object NOT_FOUND_MARKER = new Object();
focal_class.type: Object
focal_class.var_name: NOT_FOUND_MARKER
focal_class.declarator: notFoundCache = new LinkedHashMap<Sha256Hash, Object>() {
          @Override
          protected boolean removeEldestEntry(Map.Entry<Sha256Hash, Object> entry) {
              return size() > 100;  // This was chosen arbitrarily.
          }
      }
focal_class.modifier: protected
focal_class.original_string: protected LinkedHashMap<Sha256Hash, Object> notFoundCache = new LinkedHashMap<Sha256Hash, Object>() {
          @Override
          protected boolean removeEldestEntry(Map.Entry<Sha256Hash, Object> entry) {
              return size() > 100;  // This was chosen arbitrarily.
          }
      };
focal_class.type: LinkedHashMap<Sha256Hash, Object>
focal_class.var_name: notFoundCache
focal_class.declarator: fileLock = null
focal_class.modifier: protected
focal_class.original_string: protected FileLock fileLock = null;
focal_class.type: FileLock
focal_class.var_name: fileLock
focal_class.declarator: randomAccessFile = null
focal_class.modifier: protected
focal_class.original_string: protected RandomAccessFile randomAccessFile = null;
focal_class.type: RandomAccessFile
focal_class.var_name: randomAccessFile
focal_class.declarator: fileLength
focal_class.modifier: private
focal_class.original_string: private int fileLength;
focal_class.type: int
focal_class.var_name: fileLength
focal_class.declarator: lastChainHead = null
focal_class.modifier: protected
focal_class.original_string: protected StoredBlock lastChainHead = null;
focal_class.type: StoredBlock
focal_class.var_name: lastChainHead
focal_class.declarator: RECORD_SIZE = 32 /* hash */ + StoredBlock.COMPACT_SERIALIZED_SIZE
focal_class.modifier: protected static final
focal_class.original_string: protected static final int RECORD_SIZE = 32 /* hash */ + StoredBlock.COMPACT_SERIALIZED_SIZE;
focal_class.type: int
focal_class.var_name: RECORD_SIZE
focal_class.declarator: FILE_PROLOGUE_BYTES = 1024
focal_class.modifier: protected static final
focal_class.original_string: protected static final int FILE_PROLOGUE_BYTES = 1024;
focal_class.type: int
focal_class.var_name: FILE_PROLOGUE_BYTES
focal_class.file: core/src/main/java/org/ulordj/store/SPVBlockStore.java
focal_class.identifier: SPVBlockStore
focal_class.interfaces: implements BlockStore
focal_class.class_method_signature: SPVBlockStore.SPVBlockStore(NetworkParameters params, File file)
focal_class.full_signature: public  SPVBlockStore(NetworkParameters params, File file)
focal_class.identifier: SPVBlockStore
focal_class.modifiers: public
focal_class.parameters: (NetworkParameters params, File file)
focal_class.signature:  SPVBlockStore(NetworkParameters params, File file)
focal_class.class_method_signature: SPVBlockStore.SPVBlockStore(NetworkParameters params, File file, int capacity, boolean grow)
focal_class.full_signature: public  SPVBlockStore(NetworkParameters params, File file, int capacity, boolean grow)
focal_class.identifier: SPVBlockStore
focal_class.modifiers: public
focal_class.parameters: (NetworkParameters params, File file, int capacity, boolean grow)
focal_class.signature:  SPVBlockStore(NetworkParameters params, File file, int capacity, boolean grow)
focal_class.class_method_signature: SPVBlockStore.initNewStore(NetworkParameters params)
focal_class.full_signature: private void initNewStore(NetworkParameters params)
focal_class.identifier: initNewStore
focal_class.modifiers: private
focal_class.parameters: (NetworkParameters params)
focal_class.return: void
focal_class.signature: void initNewStore(NetworkParameters params)
focal_class.class_method_signature: SPVBlockStore.getFileSize(int capacity)
focal_class.full_signature: public static final int getFileSize(int capacity)
focal_class.identifier: getFileSize
focal_class.modifiers: public static final
focal_class.parameters: (int capacity)
focal_class.return: int
focal_class.signature: int getFileSize(int capacity)
focal_class.class_method_signature: SPVBlockStore.put(StoredBlock block)
focal_class.full_signature: @Override public void put(StoredBlock block)
focal_class.identifier: put
focal_class.modifiers: @Override public
focal_class.parameters: (StoredBlock block)
focal_class.return: void
focal_class.signature: void put(StoredBlock block)
focal_class.class_method_signature: SPVBlockStore.get(Sha256Hash hash)
focal_class.full_signature: @Override @Nullable public StoredBlock get(Sha256Hash hash)
focal_class.identifier: get
focal_class.modifiers: @Override @Nullable public
focal_class.parameters: (Sha256Hash hash)
focal_class.return: StoredBlock
focal_class.signature: StoredBlock get(Sha256Hash hash)
focal_class.class_method_signature: SPVBlockStore.getChainHead()
focal_class.full_signature: @Override public StoredBlock getChainHead()
focal_class.identifier: getChainHead
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: StoredBlock
focal_class.signature: StoredBlock getChainHead()
focal_class.class_method_signature: SPVBlockStore.setChainHead(StoredBlock chainHead)
focal_class.full_signature: @Override public void setChainHead(StoredBlock chainHead)
focal_class.identifier: setChainHead
focal_class.modifiers: @Override public
focal_class.parameters: (StoredBlock chainHead)
focal_class.return: void
focal_class.signature: void setChainHead(StoredBlock chainHead)
focal_class.class_method_signature: SPVBlockStore.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: SPVBlockStore.getParams()
focal_class.full_signature: @Override public NetworkParameters getParams()
focal_class.identifier: getParams
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: NetworkParameters
focal_class.signature: NetworkParameters getParams()
focal_class.class_method_signature: SPVBlockStore.getRingCursor(ByteBuffer buffer)
focal_class.full_signature: private int getRingCursor(ByteBuffer buffer)
focal_class.identifier: getRingCursor
focal_class.modifiers: private
focal_class.parameters: (ByteBuffer buffer)
focal_class.return: int
focal_class.signature: int getRingCursor(ByteBuffer buffer)
focal_class.class_method_signature: SPVBlockStore.setRingCursor(ByteBuffer buffer, int newCursor)
focal_class.full_signature: private void setRingCursor(ByteBuffer buffer, int newCursor)
focal_class.identifier: setRingCursor
focal_class.modifiers: private
focal_class.parameters: (ByteBuffer buffer, int newCursor)
focal_class.return: void
focal_class.signature: void setRingCursor(ByteBuffer buffer, int newCursor)
focal_method.body: @Override
      public void close() throws BlockStoreException {
          try {
              buffer.force();
              buffer = null;  // Allow it to be GCd and the underlying file mapping to go away.
              randomAccessFile.close();
              blockCache.clear();
          } catch (IOException e) {
              throw new BlockStoreException(e);
          }
      }
focal_method.class_method_signature: SPVBlockStore.close()
focal_method.full_signature: @Override public void close()
focal_method.identifier: close
focal_method.invocations: force close clear
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void close()