本文整理汇总了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;
}
};
}
示例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");
}
}
示例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);
}
}
示例4: Builder
import io.netty.util.Recycler; //导入依赖的package包/类
private Builder(Recycler.Handle handle)
{
this.recycleHandle = handle;
this.values = new Object[16];
}
示例5: TreeBuilder
import io.netty.util.Recycler; //导入依赖的package包/类
private TreeBuilder(Recycler.Handle handle)
{
this.recycleHandle = handle;
}
示例6: TotoroTransForm
import io.netty.util.Recycler; //导入依赖的package包/类
public TotoroTransForm(Recycler.Handle<TransForm> handle) {
this.handle = handle;
}
示例7: ElasticsearchMetadata
import io.netty.util.Recycler; //导入依赖的package包/类
public ElasticsearchMetadata(Recycler.Handle<ElasticsearchMetadata> handle) {
this.handle = handle;
}
示例8: EsEntry
import io.netty.util.Recycler; //导入依赖的package包/类
public EsEntry(Recycler.Handle<EsEntry> handle) {
this.handle = handle;
}
示例9: EsRowData
import io.netty.util.Recycler; //导入依赖的package包/类
public EsRowData(Recycler.Handle<EsRowData> handle) {
this.handle = handle;
}
示例10: EsEntryArrayList
import io.netty.util.Recycler; //导入依赖的package包/类
public EsEntryArrayList(Recycler.Handle<EsEntryArrayList> handle) {
this.handle = handle;
}
示例11: EsColumnHashMap
import io.netty.util.Recycler; //导入依赖的package包/类
public EsColumnHashMap(Recycler.Handle<EsColumnHashMap> handle) {
this.handle = handle;
}
示例12: EsRowDataArrayList
import io.netty.util.Recycler; //导入依赖的package包/类
public EsRowDataArrayList(Recycler.Handle<EsRowDataArrayList> handle) {
this.handle = handle;
}
示例13: Segment
import io.netty.util.Recycler; //导入依赖的package包/类
private Segment(Recycler.Handle<Segment> recyclerHandle) {
this.recyclerHandle = recyclerHandle;
}
示例14: UkcpPacket
import io.netty.util.Recycler; //导入依赖的package包/类
private UkcpPacket(Recycler.Handle<UkcpPacket> recyclerHandle) {
this.recyclerHandle = recyclerHandle;
}
示例15: CodecOutputList
import io.netty.util.Recycler; //导入依赖的package包/类
private CodecOutputList(Recycler.Handle<CodecOutputList<T>> handle) {
this.handle = handle;
}