public CompressedChecksummedDataInput(ChannelProxy channel, ICompressor compressor, long filePosition) { super(channel, compressor.preferredBufferType()); this.compressor = compressor; this.sourcePosition = this.filePosition = filePosition; }
public CompressedChecksummedDataInput(ChannelProxy channel, ICompressor compressor, long filePosition) { super(channel, compressor.preferredBufferType()); this.compressor = compressor; this.sourcePosition = this.filePosition = filePosition; }
public CompressedChecksummedDataInput(ChannelProxy channel, ICompressor compressor, long filePosition) { super(channel, compressor.preferredBufferType()); this.compressor = compressor; this.sourcePosition = this.filePosition = filePosition; }
@Override public BufferType preferredBufferType() { return metadata.compressor().preferredBufferType(); }
@Override public BufferType preferredBufferType() { return metadata.compressor().preferredBufferType(); }
@Override public BufferType preferredBufferType() { return metadata.compressor().preferredBufferType(); }
@Override public BufferType preferredBufferType() { return metadata.compressor().preferredBufferType(); }
protected void writeBuffer(ByteBuffer bb) throws IOException { int originalSize = bb.remaining(); int estimatedSize = compressor.initialCompressedBufferLength(originalSize) + METADATA_SIZE; if (compressionBuffer == null || compressionBuffer.capacity() < estimatedSize) { compressionBuffer = compressor.preferredBufferType().allocate(estimatedSize); } compressionBuffer.clear(); compressionBuffer.position(METADATA_SIZE); compressor.compress(bb, compressionBuffer); int compressedSize = compressionBuffer.position() - METADATA_SIZE; compressionBuffer.rewind(); compressionBuffer.putInt(originalSize); compressionBuffer.putInt(compressedSize); compressionBuffer.rewind(); compressionBuffer.limit(compressedSize + METADATA_SIZE); super.writeBuffer(compressionBuffer); }
public ByteBuffer allocateBuffer(int size) { return metadata.compressor().preferredBufferType().allocate(size); }
public ByteBuffer allocateBuffer(int size) { return metadata.compressor().preferredBufferType().allocate(size); }
public ByteBuffer allocateBuffer(int size) { return metadata.compressor().preferredBufferType().allocate(size); }
protected void writeBuffer(ByteBuffer bb) throws IOException { int originalSize = bb.remaining(); int estimatedSize = compressor.initialCompressedBufferLength(originalSize) + METADATA_SIZE; if (compressionBuffer == null || compressionBuffer.capacity() < estimatedSize) { compressionBuffer = compressor.preferredBufferType().allocate(estimatedSize); } compressionBuffer.clear(); compressionBuffer.position(METADATA_SIZE); compressor.compress(bb, compressionBuffer); int compressedSize = compressionBuffer.position() - METADATA_SIZE; compressionBuffer.rewind(); compressionBuffer.putInt(originalSize); compressionBuffer.putInt(compressedSize); compressionBuffer.rewind(); compressionBuffer.limit(compressedSize + METADATA_SIZE); super.writeBuffer(compressionBuffer); }
protected void writeBuffer(ByteBuffer bb) throws IOException { int originalSize = bb.remaining(); int estimatedSize = compressor.initialCompressedBufferLength(originalSize) + METADATA_SIZE; if (compressionBuffer == null || compressionBuffer.capacity() < estimatedSize) { compressionBuffer = compressor.preferredBufferType().allocate(estimatedSize); } compressionBuffer.clear(); compressionBuffer.position(METADATA_SIZE); compressor.compress(bb, compressionBuffer); int compressedSize = compressionBuffer.position() - METADATA_SIZE; compressionBuffer.rewind(); compressionBuffer.putInt(originalSize); compressionBuffer.putInt(compressedSize); compressionBuffer.rewind(); compressionBuffer.limit(compressedSize + METADATA_SIZE); super.writeBuffer(compressionBuffer); }
public ByteBuffer allocateBuffer(int size) { return metadata.compressor().preferredBufferType().allocate(size); }
/** * Constructs a new segment file. */ CompressedSegment(CommitLog commitLog, AbstractCommitLogSegmentManager manager) { super(commitLog, manager); this.compressor = commitLog.configuration.getCompressor(); manager.getBufferPool().setPreferredReusableBufferType(compressor.preferredBufferType()); }
/** * Constructs a new segment file. */ CompressedSegment(CommitLog commitLog, AbstractCommitLogSegmentManager manager) { super(commitLog, manager); this.compressor = commitLog.configuration.getCompressor(); manager.getBufferPool().setPreferredReusableBufferType(compressor.preferredBufferType()); }
/** * Constructs a new segment file. */ CompressedSegment(CommitLog commitLog, AbstractCommitLogSegmentManager manager) { super(commitLog, manager); this.compressor = commitLog.configuration.getCompressor(); manager.getBufferPool().setPreferredReusableBufferType(compressor.preferredBufferType()); }
ByteBuffer createBuffer(CommitLog commitLog) { return manager.getBufferPool().createBuffer(commitLog.configuration.getCompressor().preferredBufferType()); }
ByteBuffer createBuffer(CommitLog commitLog) { return manager.getBufferPool().createBuffer(commitLog.configuration.getCompressor().preferredBufferType()); }
ByteBuffer createBuffer(CommitLog commitLog) { return manager.getBufferPool().createBuffer(commitLog.configuration.getCompressor().preferredBufferType()); }