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

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

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

Config.getListConfig介绍

[英]Returns the ListConfig for the given name, creating one if necessary and adding it to the collection of known configurations.

The configuration is found by matching the configuration name pattern to the provided name without the partition qualifier (the part of the name after '@'). If no configuration matches, it will create one by cloning the "default" configuration and add it to the configuration collection.

This method is intended to easily and fluently create and add configurations more specific than the default configuration without explicitly adding it by invoking #addListConfig(ListConfig).

Because it adds new configurations if they are not already present, this method is intended to be used before this config is used to create a hazelcast instance. Afterwards, newly added configurations may be ignored.
[中]返回给定名称的ListConfig,必要时创建一个,并将其添加到已知配置的集合中。
通过将配置名称模式与不带分区限定符的提供名称(名称中“@”之后的部分)匹配,可以找到配置。如果没有匹配的配置,它将通过克隆“默认”配置创建一个配置,并将其添加到配置集合中。
此方法旨在轻松流畅地创建和添加比默认配置更具体的配置,而无需通过调用#addListConfig(ListConfig)显式添加。
因为如果新配置尚未出现,它会添加新配置,所以此方法将在使用此配置创建hazelcast实例之前使用。之后,可能会忽略新添加的配置。

代码示例

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

@Override
public ListConfig getStaticConfig(@Nonnull Config staticConfig, @Nonnull String name) {
  return staticConfig.getListConfig(name);
}

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

@Override
public ListConfig getStaticConfig(@Nonnull Config staticConfig, @Nonnull String name) {
  return staticConfig.getListConfig(name);
}

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

/**
 * Returns a read-only {@link com.hazelcast.core.IList} configuration for
 * the given name.
 * <p>
 * The name is matched by pattern to the configuration and by stripping the
 * partition ID qualifier from the given {@code name}.
 * If there is no config found by the name, it will return the configuration
 * with the name {@code default}.
 *
 * @param name name of the list config
 * @return the list configuration
 * @throws ConfigurationException if ambiguous configurations are found
 * @see StringPartitioningStrategy#getBaseName(java.lang.String)
 * @see #setConfigPatternMatcher(ConfigPatternMatcher)
 * @see #getConfigPatternMatcher()
 * @see EvictionConfig#setSize(int)
 */
public ListConfig findListConfig(String name) {
  name = getBaseName(name);
  ListConfig config = lookupByPattern(configPatternMatcher, listConfigs, name);
  if (config != null) {
    return config.getAsReadOnly();
  }
  return getListConfig("default").getAsReadOnly();
}

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

/**
 * Returns a read-only {@link com.hazelcast.core.IList} configuration for
 * the given name.
 * <p>
 * The name is matched by pattern to the configuration and by stripping the
 * partition ID qualifier from the given {@code name}.
 * If there is no config found by the name, it will return the configuration
 * with the name {@code default}.
 *
 * @param name name of the list config
 * @return the list configuration
 * @throws ConfigurationException if ambiguous configurations are found
 * @see StringPartitioningStrategy#getBaseName(java.lang.String)
 * @see #setConfigPatternMatcher(ConfigPatternMatcher)
 * @see #getConfigPatternMatcher()
 * @see EvictionConfig#setSize(int)
 */
public ListConfig findListConfig(String name) {
  name = getBaseName(name);
  ListConfig config = lookupByPattern(configPatternMatcher, listConfigs, name);
  if (config != null) {
    return config.getAsReadOnly();
  }
  return getListConfig("default").getAsReadOnly();
}

相关文章

Config类方法