private void setIndexBuffer(long index, boolean prefetch) throws IOException { if (indexBuffer != null) { indexBuffer.release(); } indexBuffer = IndexedChronicle.this.indexFileCache.acquire(index); indexPositionAddr = indexStartAddr = indexBuffer.address(); indexStartOffset = index * indexBlockSize; }
private void setDataBuffer(long dataLookup) throws IOException { if (dataBuffer != null) { dataBuffer.release(); } dataBuffer = IndexedChronicle.this.dataFileCache.acquire(dataLookup); dataStartAddr = dataBuffer.address(); }
private void setIndexBuffer(long index, boolean prefetch) throws IOException { if (indexBuffer != null) { indexBuffer.release(); } indexBuffer = IndexedChronicle.this.indexFileCache.acquire(index); indexPositionAddr = indexStartAddr = indexBuffer.address(); indexStartOffset = index * indexBlockSize; }
public static long countIndices(final VanillaMappedBytes buffer) { long indices = 0; for (long offset = 0;(buffer.limit() - buffer.address() + offset) < 8;offset += 8) { if(buffer.readLong(offset) != 0) { indices++; } else { break; } } return indices; }
private void setDataBuffer(long dataLookup) throws IOException { if (dataBuffer != null) { dataBuffer.release(); } dataBuffer = IndexedChronicle.this.dataFileCache.acquire(dataLookup); dataStartAddr = dataBuffer.address(); }
int offset = (int) (startAddr - dataBytes.address()); long dataOffset = dataBytes.index() * builder.dataBlockSize() + offset; long indexValue = ((long) lastThreadId << INDEX_DATA_OFFSET_BITS) + dataOffset;
NativeBytes.UNSAFE.putOrderedInt(null, startAddr - 4, length); int offset = (int) (startAddr - dataBytes.address()); long dataOffset = dataBytes.index() * config.dataBlockSize() + offset; long indexValue = ((long) appenderThreadId << INDEX_DATA_OFFSET_BITS) + dataOffset;