本文整理汇总了Java中io.netty.buffer.PooledByteBufAllocator.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java PooledByteBufAllocator.DEFAULT属性的具体用法?Java PooledByteBufAllocator.DEFAULT怎么用?Java PooledByteBufAllocator.DEFAULT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类io.netty.buffer.PooledByteBufAllocator
的用法示例。
在下文中一共展示了PooledByteBufAllocator.DEFAULT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generate
public static AllocatorStats generate(String allocatorName) {
PooledByteBufAllocator allocator = null;
if ("default".equals(allocatorName)) {
allocator = PooledByteBufAllocator.DEFAULT;
} else if ("ml-cache".equals(allocatorName)) {
allocator = EntryCacheImpl.allocator;
} else {
throw new IllegalArgumentException("Invalid allocator name : " + allocatorName);
}
AllocatorStats stats = new AllocatorStats();
stats.directArenas = allocator.directArenas().stream().map(x -> newPoolArenaStats(x))
.collect(Collectors.toList());
stats.heapArenas = allocator.heapArenas().stream().map(x -> newPoolArenaStats(x)).collect(Collectors.toList());
stats.numDirectArenas = allocator.numDirectArenas();
stats.numHeapArenas = allocator.numHeapArenas();
stats.numThreadLocalCaches = allocator.numThreadLocalCaches();
stats.normalCacheSize = allocator.normalCacheSize();
stats.smallCacheSize = allocator.smallCacheSize();
stats.tinyCacheSize = allocator.tinyCacheSize();
return stats;
}
示例2: EventStoreEventRepository
public EventStoreEventRepository(
final String streamPrefix,
final EsConnection connection,
final Class<T> eventClass,
final ObjectMapper objectMapper,
final EventNormalizer<T> normalizer) {
this.streamPrefix = streamPrefix;
this.eventClass = eventClass;
this.normalizer = normalizer;
this.connection = connection;
this.objectMapper = objectMapper;
this.maxSerializedEventSize = DEFAULT_MAX_SERIALIZED_EVENT_SIZE;
this.bufferAllocator = PooledByteBufAllocator.DEFAULT;
}
示例3: getAllocator
/**
* A Netty {@code ByteBufAllocator} that will be used for all connections.
*/
@Default
public ByteBufAllocator getAllocator() {
return PooledByteBufAllocator.DEFAULT;
}
示例4: alloc
@Override
public ByteBufAllocator alloc() {
return PooledByteBufAllocator.DEFAULT;
}