当前位置: 首页>>代码示例>>Java>>正文


Java Recycler类代码示例

本文整理汇总了Java中io.netty.util.Recycler的典型用法代码示例。如果您正苦于以下问题:Java Recycler类的具体用法?Java Recycler怎么用?Java Recycler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Recycler类属于io.netty.util包,在下文中一共展示了Recycler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RecyclableLinkedBuffer

import io.netty.util.Recycler; //导入依赖的package包/类
/**
 * @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;
    }
  };
}
 
开发者ID:scalecube,项目名称:RabbitMQ-gateway,代码行数:16,代码来源:RecyclableLinkedBuffer.java

示例2: turnOffNettyRecycler

import io.netty.util.Recycler; //导入依赖的package包/类
/**
 * 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");
  }
}
 
开发者ID:benson-git,项目名称:ibole-microservice,代码行数:18,代码来源:GrpcClientInitializer.java

示例3: recycle

import io.netty.util.Recycler; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void recycle() {
    Recycler.Handle recyclerHandle = this.recyclerHandle;
    if (recyclerHandle != null) {
        ((Recycler<Object>) recycler()).recycle(this, recyclerHandle);
    }
}
 
开发者ID:kyle-liu,项目名称:netty4study,代码行数:8,代码来源:PooledByteBuf.java

示例4: Builder

import io.netty.util.Recycler; //导入依赖的package包/类
private Builder(Recycler.Handle handle)
{
    this.recycleHandle = handle;
    this.values = new Object[16];
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:6,代码来源:BTree.java

示例5: TreeBuilder

import io.netty.util.Recycler; //导入依赖的package包/类
private TreeBuilder(Recycler.Handle handle)
{
    this.recycleHandle = handle;
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:TreeBuilder.java

示例6: TotoroTransForm

import io.netty.util.Recycler; //导入依赖的package包/类
public TotoroTransForm(Recycler.Handle<TransForm> handle) {
    this.handle = handle;
}
 
开发者ID:zhongchengxcr,项目名称:canal-elasticsearch,代码行数:4,代码来源:TotoroTransForm.java

示例7: ElasticsearchMetadata

import io.netty.util.Recycler; //导入依赖的package包/类
public ElasticsearchMetadata(Recycler.Handle<ElasticsearchMetadata> handle) {
    this.handle = handle;
}
 
开发者ID:zhongchengxcr,项目名称:canal-elasticsearch,代码行数:4,代码来源:ElasticsearchMetadata.java

示例8: EsEntry

import io.netty.util.Recycler; //导入依赖的package包/类
public EsEntry(Recycler.Handle<EsEntry> handle) {
    this.handle = handle;
}
 
开发者ID:zhongchengxcr,项目名称:canal-elasticsearch,代码行数:4,代码来源:ElasticsearchMetadata.java

示例9: EsRowData

import io.netty.util.Recycler; //导入依赖的package包/类
public EsRowData(Recycler.Handle<EsRowData> handle) {
    this.handle = handle;
}
 
开发者ID:zhongchengxcr,项目名称:canal-elasticsearch,代码行数:4,代码来源:ElasticsearchMetadata.java

示例10: EsEntryArrayList

import io.netty.util.Recycler; //导入依赖的package包/类
public EsEntryArrayList(Recycler.Handle<EsEntryArrayList> handle) {
    this.handle = handle;
}
 
开发者ID:zhongchengxcr,项目名称:canal-elasticsearch,代码行数:4,代码来源:EsEntryArrayList.java

示例11: EsColumnHashMap

import io.netty.util.Recycler; //导入依赖的package包/类
public EsColumnHashMap(Recycler.Handle<EsColumnHashMap> handle) {
    this.handle = handle;
}
 
开发者ID:zhongchengxcr,项目名称:canal-elasticsearch,代码行数:4,代码来源:EsColumnHashMap.java

示例12: EsRowDataArrayList

import io.netty.util.Recycler; //导入依赖的package包/类
public EsRowDataArrayList(Recycler.Handle<EsRowDataArrayList> handle) {
    this.handle = handle;
}
 
开发者ID:zhongchengxcr,项目名称:canal-elasticsearch,代码行数:4,代码来源:EsRowDataArrayList.java

示例13: Segment

import io.netty.util.Recycler; //导入依赖的package包/类
private Segment(Recycler.Handle<Segment> recyclerHandle) {
    this.recyclerHandle = recyclerHandle;
}
 
开发者ID:szhnet,项目名称:kcp-netty,代码行数:4,代码来源:Kcp.java

示例14: UkcpPacket

import io.netty.util.Recycler; //导入依赖的package包/类
private UkcpPacket(Recycler.Handle<UkcpPacket> recyclerHandle) {
    this.recyclerHandle = recyclerHandle;
}
 
开发者ID:szhnet,项目名称:kcp-netty,代码行数:4,代码来源:UkcpPacket.java

示例15: CodecOutputList

import io.netty.util.Recycler; //导入依赖的package包/类
private CodecOutputList(Recycler.Handle<CodecOutputList<T>> handle) {
    this.handle = handle;
}
 
开发者ID:szhnet,项目名称:kcp-netty,代码行数:4,代码来源:CodecOutputList.java


注:本文中的io.netty.util.Recycler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。