/** * This is for debugging and testing. * <p> * @return the length of the data file. * @throws IOException */ protected long getDataFileSize() throws IOException { long size = 0; storageLock.readLock().lock(); try { if ( dataFile != null ) { size = dataFile.length(); } } finally { storageLock.readLock().unlock(); } return size; }
/** * This is for debugging and testing. * <p> * * @return the length of the data file. * @throws IOException */ protected long getDataFileSize() throws IOException { long size = 0; storageLock.readLock().lock(); try { if (dataFile != null) { size = dataFile.length(); } } finally { storageLock.readLock().unlock(); } return size; }
/** * Initializes an empty disk cache. * <p> * * @throws IOException */ private void initializeEmptyStore() throws IOException { initializeKeyMap(); if (dataFile.length() > 0) { dataFile.reset(); } }
/** * Initializes an empty disk cache. * <p> * @throws IOException */ private void initializeEmptyStore() throws IOException { initializeKeyMap(); if ( dataFile.length() > 0 ) { dataFile.reset(); } }
new IndexedDiskElementDescriptor(0, (int) keyFile.length() - IndexedDisk.HEADER_SIZE_BYTES));
keyFile.readObject( new IndexedDiskElementDescriptor( 0, (int) keyFile.length() - IndexedDisk.HEADER_SIZE_BYTES ) );
try fileLength = dataFile.length();
try fileLength = dataFile.length();
Long.valueOf(this.dataFile != null ? this.dataFile.length() : -1L) ) );
.add(new StatElement<Long>("Data File Length", Long.valueOf(this.dataFile != null ? this.dataFile.length() : -1L)));
else if (keyFile.length() > 0)
else if ( keyFile.length() > 0 )
ded = new IndexedDiskElementDescriptor( dataFile.length(), data.length );
ded = new IndexedDiskElementDescriptor(dataFile.length(), data.length);