Java 类io.netty.util.Recycler 实例源码

项目:RabbitMQ-gateway    文件:RecyclableLinkedBuffer.java   
/**
 * @param bufferSize {@link io.protostuff.LinkedBuffer}'s buffer size.
 * @param maxCapacity {@link io.netty.util.Recycler}'s.
 */
public RecyclableLinkedBuffer(final int bufferSize, int maxCapacity) {
  this.recycler = new Recycler<RecyclableLinkedBuffer>(maxCapacity) {
    @Override
    protected RecyclableLinkedBuffer newObject(Handle handle) {
      RecyclableLinkedBuffer wrapper = new RecyclableLinkedBuffer();
      wrapper.buffer = LinkedBuffer.allocate(bufferSize);
      wrapper.handle = handle;
      return wrapper;
    }
  };
}
项目:ibole-microservice    文件:GrpcClientInitializer.java   
/**
 * The netty {@link Recycler} has caused some problems for long running operations in some
 * versions of netty. As of this comment (10/21/2016), we are using netty 4.1.3.Final. The
 * Recycler uses a system property, "io.netty.recycler.maxCapacity" which needs to be set to "0"
 * to turn off potentially problematic behavior. The string gets transformed via the shading
 * process, and ends up being similar to the Recycler's package name. This method sets the value
 * to "0" if the value is not set.
 */
private static void turnOffNettyRecycler() {
  String packageName = Recycler.class.getName();
  String prefix = packageName.substring(0, packageName.indexOf(".util.Recycler"));
  final String key = prefix + ".recycler.maxCapacity";
  LOG.debug("Using prefix '{}' for io.netty.", prefix);
  if (System.getProperty(key) == null) {
    System.setProperty(key, "0");
  }
}
项目:scalecube    文件:RecyclableLinkedBuffer.java   
/**
 * @param bufferSize {@link io.protostuff.LinkedBuffer}'s buffer size.
 * @param maxCapacity {@link io.netty.util.Recycler}'s.
 */
public RecyclableLinkedBuffer(final int bufferSize, int maxCapacity) {
  this.recycler = new Recycler<RecyclableLinkedBuffer>(maxCapacity) {
    @Override
    protected RecyclableLinkedBuffer newObject(Handle handle) {
      RecyclableLinkedBuffer wrapper = new RecyclableLinkedBuffer();
      wrapper.buffer = LinkedBuffer.allocate(bufferSize);
      wrapper.handle = handle;
      return wrapper;
    }
  };
}
项目:netty4study    文件:PooledByteBuf.java   
@SuppressWarnings("unchecked")
private void recycle() {
    Recycler.Handle recyclerHandle = this.recyclerHandle;
    if (recyclerHandle != null) {
        ((Recycler<Object>) recycler()).recycle(this, recyclerHandle);
    }
}
项目:sstable-adaptor    文件:BTree.java   
private Builder(Recycler.Handle handle)
{
    this.recycleHandle = handle;
    this.values = new Object[16];
}
项目:sstable-adaptor    文件:TreeBuilder.java   
private TreeBuilder(Recycler.Handle handle)
{
    this.recycleHandle = handle;
}
项目:canal-elasticsearch    文件:TotoroTransForm.java   
public TotoroTransForm(Recycler.Handle<TransForm> handle) {
    this.handle = handle;
}
项目:canal-elasticsearch    文件:ElasticsearchMetadata.java   
public ElasticsearchMetadata(Recycler.Handle<ElasticsearchMetadata> handle) {
    this.handle = handle;
}
项目:canal-elasticsearch    文件:ElasticsearchMetadata.java   
public EsEntry(Recycler.Handle<EsEntry> handle) {
    this.handle = handle;
}
项目:canal-elasticsearch    文件:ElasticsearchMetadata.java   
public EsRowData(Recycler.Handle<EsRowData> handle) {
    this.handle = handle;
}
项目:canal-elasticsearch    文件:EsEntryArrayList.java   
public EsEntryArrayList(Recycler.Handle<EsEntryArrayList> handle) {
    this.handle = handle;
}
项目:canal-elasticsearch    文件:EsColumnHashMap.java   
public EsColumnHashMap(Recycler.Handle<EsColumnHashMap> handle) {
    this.handle = handle;
}
项目:canal-elasticsearch    文件:EsRowDataArrayList.java   
public EsRowDataArrayList(Recycler.Handle<EsRowDataArrayList> handle) {
    this.handle = handle;
}
项目:kcp-netty    文件:Kcp.java   
private Segment(Recycler.Handle<Segment> recyclerHandle) {
    this.recyclerHandle = recyclerHandle;
}
项目:kcp-netty    文件:UkcpPacket.java   
private UkcpPacket(Recycler.Handle<UkcpPacket> recyclerHandle) {
    this.recyclerHandle = recyclerHandle;
}
项目:kcp-netty    文件:CodecOutputList.java   
private CodecOutputList(Recycler.Handle<CodecOutputList<T>> handle) {
    this.handle = handle;
}
项目:sailfish    文件:RequestProtocol.java   
@Override
protected RequestProtocol newObject(Recycler.Handle<RequestProtocol> handle) {
    return new RequestProtocol(handle);
}
项目:sailfish    文件:RequestProtocol.java   
private RequestProtocol(Recycler.Handle<RequestProtocol> handle){
    this.handle = handle;
}
项目:sailfish    文件:ResponseProtocol.java   
@Override
protected ResponseProtocol newObject(Recycler.Handle<ResponseProtocol> handle) {
    return new ResponseProtocol(handle);
}
项目:sailfish    文件:ResponseProtocol.java   
public ResponseProtocol(Recycler.Handle<ResponseProtocol> handle) {
    this.handle = handle;
}
项目:sailfish    文件:DefaultMsgHandler.java   
private DefaultOutputImpl(Recycler.Handle<DefaultOutputImpl> handle) {
    this.handle = handle;
}
项目:sailfish    文件:BytesResponseFuture.java   
@Override
protected CallbackTask newObject(Recycler.Handle<CallbackTask> handle) {
    return new CallbackTask(handle);
}
项目:sailfish    文件:BytesResponseFuture.java   
@Override
protected CallbackCheckTask newObject(Recycler.Handle<CallbackCheckTask> handle) {
    return new CallbackCheckTask(handle);
}
项目:sailfish    文件:RecycleTest.java   
@Override
protected Resource newObject(Recycler.Handle<Resource> handle) {
    return new Resource(handle);
}
项目:sailfish    文件:RecycleTest.java   
private Resource(Recycler.Handle<Resource> handle) {
    this.handle = handle;
}
项目:sailfish    文件:RecycleTest.java   
@Override
protected Resource2 newObject(Recycler.Handle<Resource2> handle) {
    return new Resource2(handle);
}
项目:sailfish    文件:RecycleTest.java   
private Resource2(Recycler.Handle<Resource2> handle) {
    this.handle = handle;
}
项目:incubator-pulsar    文件:Producer.java   
protected MessagePublishContext newObject(Recycler.Handle<MessagePublishContext> handle) {
    return new MessagePublishContext(handle);
}
项目:incubator-pulsar    文件:ReplicationMetrics.java   
@Override
protected ReplicationMetrics newObject(Recycler.Handle<ReplicationMetrics> handle) {
    return new ReplicationMetrics(handle);
}
项目:incubator-pulsar    文件:DoubleByteBuf.java   
@Override
protected DoubleByteBuf newObject(Recycler.Handle<DoubleByteBuf> handle) {
    return new DoubleByteBuf(handle);
}
项目:incubator-pulsar    文件:ByteBufCodedOutputStream.java   
protected ByteBufCodedOutputStream newObject(Recycler.Handle<ByteBufCodedOutputStream> handle) {
    return new ByteBufCodedOutputStream(handle);
}
项目:incubator-pulsar    文件:ByteBufCodedInputStream.java   
protected ByteBufCodedInputStream newObject(Recycler.Handle<ByteBufCodedInputStream> handle) {
    return new ByteBufCodedInputStream(handle);
}
项目:incubator-pulsar    文件:OpReadEntry.java   
protected OpReadEntry newObject(Recycler.Handle<OpReadEntry> recyclerHandle) {
    return new OpReadEntry(recyclerHandle);
}
项目:incubator-pulsar    文件:OpAddEntry.java   
protected OpAddEntry newObject(Recycler.Handle<OpAddEntry> recyclerHandle) {
    return new OpAddEntry(recyclerHandle);
}
项目:incubator-pulsar    文件:EntryImpl.java   
private EntryImpl(Recycler.Handle<EntryImpl> recyclerHandle) {
    this.recyclerHandle = recyclerHandle;
}
项目:netty4.0.27Learn    文件:PendingWriteQueue.java   
private PendingWrite(Recycler.Handle handle) {
    this.handle = handle;
}
项目:netty4.0.27Learn    文件:AbstractChannelHandlerContext.java   
private AbstractWriteTask(Recycler.Handle handle) {
    super(handle);
}
项目:netty4.0.27Learn    文件:AbstractChannelHandlerContext.java   
private WriteTask(Recycler.Handle handle) {
    super(handle);
}
项目:netty4.0.27Learn    文件:AbstractChannelHandlerContext.java   
@Override
protected void recycle(Recycler.Handle handle) {
    RECYCLER.recycle(this, handle);
}
项目:netty4.0.27Learn    文件:AbstractChannelHandlerContext.java   
private WriteAndFlushTask(Recycler.Handle handle) {
    super(handle);
}