Package org.apache.cassandra.net
Class BufferPoolAllocator.Wrapped
- java.lang.Object
-
- io.netty.buffer.ByteBuf
-
- io.netty.buffer.AbstractByteBuf
-
- io.netty.buffer.AbstractReferenceCountedByteBuf
-
- io.netty.buffer.UnpooledDirectByteBuf
-
- io.netty.buffer.UnpooledUnsafeDirectByteBuf
-
- org.apache.cassandra.net.BufferPoolAllocator.Wrapped
-
- All Implemented Interfaces:
io.netty.util.ReferenceCounted,java.lang.Comparable<io.netty.buffer.ByteBuf>
- Enclosing class:
- BufferPoolAllocator
public static class BufferPoolAllocator.Wrapped extends io.netty.buffer.UnpooledUnsafeDirectByteBufA simple extension to UnpooledUnsafeDirectByteBuf that returns buffers to BufferPool on deallocate, and permits extracting the buffer from it to take ownership and use directly.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBufferadopt()protected java.nio.ByteBufferallocateDirect(int initialCapacity)io.netty.buffer.ByteBufcapacity(int newCapacity)voiddeallocate()protected voidfreeDirect(java.nio.ByteBuffer buffer)-
Methods inherited from class io.netty.buffer.UnpooledUnsafeDirectByteBuf
_getByte, _getInt, _getIntLE, _getLong, _getLongLE, _getShort, _getShortLE, _getUnsignedMedium, _getUnsignedMediumLE, _setByte, _setInt, _setIntLE, _setLong, _setLongLE, _setMedium, _setMediumLE, _setShort, _setShortLE, copy, getByte, getBytes, getInt, getLong, getShort, getUnsignedMedium, hasMemoryAddress, memoryAddress, newSwappedByteBuf, setByte, setBytes, setBytes, setBytes, setBytes, setInt, setLong, setMedium, setShort, setZero, writeZero
-
Methods inherited from class io.netty.buffer.UnpooledDirectByteBuf
alloc, array, arrayOffset, capacity, getBytes, getBytes, getBytes, getBytes, getBytes, hasArray, internalNioBuffer, isContiguous, isDirect, nioBuffer, nioBufferCount, nioBuffers, order, readBytes, readBytes, readBytes, readBytes, readBytes, setBytes, setBytes, unwrap
-
Methods inherited from class io.netty.buffer.AbstractReferenceCountedByteBuf
refCnt, release, release, resetRefCnt, retain, retain, setRefCnt, touch, touch
-
Methods inherited from class io.netty.buffer.AbstractByteBuf
adjustMarkers, asReadOnly, bytesBefore, bytesBefore, bytesBefore, checkDstIndex, checkDstIndex, checkIndex, checkIndex, checkNewCapacity, checkReadableBytes, checkSrcIndex, clear, compareTo, copy, discardReadBytes, discardSomeReadBytes, duplicate, ensureAccessible, ensureWritable, ensureWritable, equals, forEachByte, forEachByte, forEachByteDesc, forEachByteDesc, getBoolean, getBytes, getBytes, getBytes, getChar, getCharSequence, getDouble, getFloat, getIntLE, getLongLE, getMedium, getMediumLE, getShortLE, getUnsignedByte, getUnsignedInt, getUnsignedIntLE, getUnsignedMediumLE, getUnsignedShort, getUnsignedShortLE, hashCode, indexOf, isReadable, isReadable, isReadOnly, isWritable, isWritable, markReaderIndex, markWriterIndex, maxCapacity, maxCapacity, maxWritableBytes, nioBuffer, nioBuffers, order, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readCharSequence, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readRetainedSlice, readShort, readShortLE, readSlice, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, resetReaderIndex, resetWriterIndex, retainedDuplicate, retainedSlice, retainedSlice, setBoolean, setBytes, setBytes, setBytes, setChar, setCharSequence, setDouble, setFloat, setIndex, setIntLE, setLongLE, setMediumLE, setShortLE, skipBytes, slice, slice, toString, toString, toString, trimIndicesToCapacity, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeCharSequence, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLE
-
-
-
-
Method Detail
-
capacity
public io.netty.buffer.ByteBuf capacity(int newCapacity)
- Overrides:
capacityin classio.netty.buffer.UnpooledDirectByteBuf
-
allocateDirect
protected java.nio.ByteBuffer allocateDirect(int initialCapacity)
- Overrides:
allocateDirectin classio.netty.buffer.UnpooledDirectByteBuf
-
freeDirect
protected void freeDirect(java.nio.ByteBuffer buffer)
- Overrides:
freeDirectin classio.netty.buffer.UnpooledDirectByteBuf
-
deallocate
public void deallocate()
- Overrides:
deallocatein classio.netty.buffer.UnpooledDirectByteBuf
-
adopt
public java.nio.ByteBuffer adopt()
-
-