本文整理匯總了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;
}