當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。