Class Netty4Utils
java.lang.Object
org.elasticsearch.transport.netty4.Netty4Utils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsetAvailableProcessors(int availableProcessors)Set the number of available processors that Netty uses for sizing various resources (e.g., thread pools).static io.netty.buffer.ByteBuftoByteBuf(org.elasticsearch.common.bytes.BytesReference reference)Turns the given BytesReference into a ByteBuf.static org.elasticsearch.common.bytes.BytesReferencetoBytesReference(io.netty.buffer.ByteBuf buffer)Wraps the given ChannelBuffer with a BytesReference
-
Constructor Details
-
Netty4Utils
public Netty4Utils()
-
-
Method Details
-
setAvailableProcessors
public static void setAvailableProcessors(int availableProcessors)Set the number of available processors that Netty uses for sizing various resources (e.g., thread pools).- Parameters:
availableProcessors- the number of available processors- Throws:
IllegalStateException- if available processors was set previously and the specified value does not match the already-set value
-
toByteBuf
public static io.netty.buffer.ByteBuf toByteBuf(org.elasticsearch.common.bytes.BytesReference reference)Turns the given BytesReference into a ByteBuf. Note: the returned ByteBuf will reference the internal pages of the BytesReference. Don't free the bytes of reference before the ByteBuf goes out of scope. -
toBytesReference
public static org.elasticsearch.common.bytes.BytesReference toBytesReference(io.netty.buffer.ByteBuf buffer)Wraps the given ChannelBuffer with a BytesReference
-