com.hazelcast.config.Config.getNativeMemoryConfig()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中com.hazelcast.config.Config.getNativeMemoryConfig()方法的一些代码示例,展示了Config.getNativeMemoryConfig()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Config.getNativeMemoryConfig()方法的具体详情如下:
包路径:com.hazelcast.config.Config
类名称:Config
方法名:getNativeMemoryConfig

Config.getNativeMemoryConfig介绍

[英]Returns the native memory configuration for this hazelcast instance. The native memory configuration defines the how native memory is used and the limits on its usage.
[中]返回此hazelcast实例的本机内存配置。本机内存配置定义本机内存的使用方式及其使用限制。

代码示例

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public NativeMemoryConfig getNativeMemoryConfig() {
  return staticConfig.getNativeMemoryConfig();
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@Override
public NativeMemoryConfig getNativeMemoryConfig() {
  return staticConfig.getNativeMemoryConfig();
}

代码示例来源:origin: hazelcast/hazelcast-jet

private boolean hasPooledMemoryAllocator() {
  NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
  NativeMemoryConfig nativeMemoryConfig = nodeEngine.getConfig().getNativeMemoryConfig();
  return nativeMemoryConfig != null && nativeMemoryConfig.getAllocatorType() == POOLED;
}

代码示例来源:origin: com.hazelcast/hazelcast-all

private boolean hasPooledMemoryAllocator() {
  NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
  NativeMemoryConfig nativeMemoryConfig = nodeEngine.getConfig().getNativeMemoryConfig();
  return nativeMemoryConfig != null && nativeMemoryConfig.getAllocatorType() == POOLED;
}

代码示例来源:origin: hazelcast/hazelcast-code-samples

private EnterpriseCacheTestServer(String memory) {
  this.memorySize = MemorySize.parse(memory, MemoryUnit.GIGABYTES);
  InputStream configInputStream = EnterpriseCacheTestServer.class.getResourceAsStream("/hazelcast-hd-memory.xml");
  Config config = new XmlConfigBuilder(configInputStream).build();
  config.setLicenseKey(ENTERPRISE_LICENSE_KEY);
  NativeMemoryConfig memoryConfig = config.getNativeMemoryConfig();
  if (!memoryConfig.isEnabled()) {
    memoryConfig.setSize(memorySize).setEnabled(true);
    memoryConfig.setAllocatorType(NativeMemoryConfig.MemoryAllocatorType.POOLED);
  }
  instance = Hazelcast.newHazelcastInstance(config);
  memoryStats = MemoryStatsUtil.getMemoryStats(instance);
  logger = instance.getLoggingService().getLogger(EnterpriseCacheTestServer.class);
}

代码示例来源:origin: hazelcast/hazelcast-jet

@Override
public DistributedObject createDistributedObject(String name) {
  Config config = nodeEngine.getConfig();
  MapConfig mapConfig = config.findMapConfig(name);
  MergePolicyProvider mergePolicyProvider = mapServiceContext.getMergePolicyProvider();
  checkMapConfig(mapConfig, mergePolicyProvider);
  Object mergePolicy = mergePolicyProvider.getMergePolicy(mapConfig.getMergePolicyConfig().getPolicy());
  checkMergePolicySupportsInMemoryFormat(name, mergePolicy, mapConfig.getInMemoryFormat(),
      true, nodeEngine.getLogger(getClass()));
  if (mapConfig.isNearCacheEnabled()) {
    initDefaultMaxSizeForOnHeapMaps(mapConfig.getNearCacheConfig());
    checkNearCacheConfig(name, mapConfig.getNearCacheConfig(), config.getNativeMemoryConfig(), false);
    return new NearCachedMapProxyImpl(name, mapServiceContext.getService(), nodeEngine, mapConfig);
  } else {
    return new MapProxyImpl(name, mapServiceContext.getService(), nodeEngine, mapConfig);
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

@Override
public DistributedObject createDistributedObject(String name) {
  Config config = nodeEngine.getConfig();
  MapConfig mapConfig = config.findMapConfig(name);
  MergePolicyProvider mergePolicyProvider = mapServiceContext.getMergePolicyProvider();
  checkMapConfig(mapConfig, mergePolicyProvider);
  Object mergePolicy = mergePolicyProvider.getMergePolicy(mapConfig.getMergePolicyConfig().getPolicy());
  checkMergePolicySupportsInMemoryFormat(name, mergePolicy, mapConfig.getInMemoryFormat(),
      nodeEngine.getClusterService().getClusterVersion(), true, nodeEngine.getLogger(getClass()));
  if (mapConfig.isNearCacheEnabled()) {
    initDefaultMaxSizeForOnHeapMaps(mapConfig.getNearCacheConfig());
    checkNearCacheConfig(name, mapConfig.getNearCacheConfig(), config.getNativeMemoryConfig(), false);
    return new NearCachedMapProxyImpl(name, mapServiceContext.getService(), nodeEngine, mapConfig);
  } else {
    return new MapProxyImpl(name, mapServiceContext.getService(), nodeEngine, mapConfig);
  }
}

代码示例来源:origin: com.hazelcast/hazelcast-all

private static void nativeMemoryXmlGenerator(XmlGenerator gen, Config config) {
  NativeMemoryConfig nativeMemoryConfig = config.getNativeMemoryConfig();
  if (nativeMemoryConfig == null) {
    gen.node("native-memory", null, "enabled", "false");
    return;
  }
  gen.open("native-memory",
      "enabled", nativeMemoryConfig.isEnabled(),
      "allocator-type", nativeMemoryConfig.getAllocatorType())
      .node("size", null,
          "unit", nativeMemoryConfig.getSize().getUnit(),
          "value", nativeMemoryConfig.getSize().getValue())
      .node("min-block-size", nativeMemoryConfig.getMinBlockSize())
      .node("page-size", nativeMemoryConfig.getPageSize())
      .node("metadata-space-percentage", nativeMemoryConfig.getMetadataSpacePercentage())
      .close();
}

代码示例来源:origin: hazelcast/hazelcast-jet

private static void nativeMemoryXmlGenerator(XmlGenerator gen, Config config) {
  NativeMemoryConfig nativeMemoryConfig = config.getNativeMemoryConfig();
  if (nativeMemoryConfig == null) {
    gen.node("native-memory", null, "enabled", "false");
    return;
  }
  gen.open("native-memory",
      "enabled", nativeMemoryConfig.isEnabled(),
      "allocator-type", nativeMemoryConfig.getAllocatorType())
      .node("size", null,
          "unit", nativeMemoryConfig.getSize().getUnit(),
          "value", nativeMemoryConfig.getSize().getValue())
      .node("min-block-size", nativeMemoryConfig.getMinBlockSize())
      .node("page-size", nativeMemoryConfig.getPageSize())
      .node("metadata-space-percentage", nativeMemoryConfig.getMetadataSpacePercentage())
      .close();
}

代码示例来源:origin: com.hazelcast/hazelcast-all

handleCache(node);
} else if (NATIVE_MEMORY.isEqual(nodeName)) {
  fillNativeMemoryConfig(node, config.getNativeMemoryConfig());
} else if (JOB_TRACKER.isEqual(nodeName)) {
  handleJobTracker(node);

代码示例来源:origin: hazelcast/hazelcast-jet

handleCache(node);
} else if (NATIVE_MEMORY.isEqual(nodeName)) {
  fillNativeMemoryConfig(node, config.getNativeMemoryConfig());
} else if (JOB_TRACKER.isEqual(nodeName)) {
  handleJobTracker(node);

相关文章

微信公众号

最新文章

更多

Config类方法