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


Java PooledByteBufAllocator.DEFAULT属性代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:23,代码来源:AllocatorStatsGenerator.java

示例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;
}
 
开发者ID:elder-oss,项目名称:sourcerer,代码行数:14,代码来源:EventStoreEventRepository.java

示例3: getAllocator

/**
 * A Netty {@code ByteBufAllocator} that will be used for all connections.
 */
@Default
public ByteBufAllocator getAllocator() {
  return PooledByteBufAllocator.DEFAULT;
}
 
开发者ID:HubSpot,项目名称:NioSmtpClient,代码行数:7,代码来源:AbstractSmtpSessionFactoryConfig.java

示例4: alloc

@Override
public ByteBufAllocator alloc() {
    return PooledByteBufAllocator.DEFAULT;
}
 
开发者ID:apache,项目名称:incubator-pulsar,代码行数:4,代码来源:DoubleByteBuf.java


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