本文整理了Java中org.elasticsearch.common.settings.Settings.getAsMap()
方法的一些代码示例,展示了Settings.getAsMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Settings.getAsMap()
方法的具体详情如下:
包路径:org.elasticsearch.common.settings.Settings
类名称:Settings
方法名:getAsMap
[英]The settings as a flat java.util.Map.
[中]将设置设置为平面java。util。地图
代码示例来源:origin: loklak/loklak_server
public Map<String, String> nodeSettings() {
return this.elasticsearchClient.settings().getAsMap();
}
代码示例来源:origin: SonarSource/sonarqube
static String of(IndexDefinition.Index index) {
return of(index.getSettings().getAsMap(), index.getTypes());
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void defaults() {
Map<String, String> map = DefaultIndexSettings.defaults().build().getAsMap();
assertThat(map).isNotEmpty();
// test some values
assertThat(map.get("index.number_of_shards")).isEqualTo("1");
assertThat(map.get("index.analysis.analyzer." + SORTABLE_ANALYZER.getName() + ".tokenizer")).isEqualTo("keyword");
}
代码示例来源:origin: apache/usergrid
logger.trace("Creating ElasticSearch client with settings: {}", settings.getAsMap());
代码示例来源:origin: harbby/presto-connectors
/**
* Sets all the provided settings.
*/
public Builder put(Settings settings) {
removeNonArraysFieldsIfNewSettingsContainsFieldAsArray(settings.getAsMap());
map.putAll(settings.getAsMap());
return this;
}
代码示例来源:origin: harbby/presto-connectors
@Override
public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (transientSettings.getAsMap().isEmpty() && persistentSettings.getAsMap().isEmpty()) {
validationException = addValidationError("no settings to update", validationException);
}
return validationException;
}
代码示例来源:origin: harbby/presto-connectors
@Override
public ActionRequestValidationException validate() {
ActionRequestValidationException validationException = null;
if (settings.getAsMap().isEmpty()) {
validationException = addValidationError("no settings to update", validationException);
}
return validationException;
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
/**
* Returns <code>true</code> iff this setting is present in the given settings object. Otherwise <code>false</code>
*/
public boolean exists(Settings settings) {
return settings.getAsMap().containsKey(getKey());
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
private void setClusterExcludeFilters(Settings settings) {
clusterExcludeFilters = DiscoveryNodeFilters.buildFromKeyValue(OR, settings.getAsMap());
}
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
private void setClusterRequireFilters(Settings settings) {
clusterRequireFilters = DiscoveryNodeFilters.buildFromKeyValue(AND, settings.getAsMap());
}
private void setClusterIncludeFilters(Settings settings) {
代码示例来源:origin: souyunku/SpringBootExamples
private void printElasticSearchInfo() {
System.out.println("--ElasticSearch-->");
Client client = es.getClient();
Map<String, String> asMap = client.settings().getAsMap();
asMap.forEach((k, v) -> {
System.out.println(k + " = " + v);
});
System.out.println("<--ElasticSearch--");
}
代码示例来源:origin: harbby/presto-connectors
public static void writeSettingsToStream(Settings settings, StreamOutput out) throws IOException {
out.writeVInt(settings.getAsMap().size());
for (Map.Entry<String, String> entry : settings.getAsMap().entrySet()) {
out.writeString(entry.getKey());
out.writeString(entry.getValue());
}
}
代码示例来源:origin: Nasruddin/elasticsearch-spring-boot-spring-data
@GetMapping("/elastic/details")
public ResponseEntity<Map<String, String>> getElasticInformation() {
Client client = elasticsearchOperations.getClient();
Map<String, String> asMap = client.settings().getAsMap();
return ResponseEntity.ok(asMap);
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
public Node newNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) {
Settings nodeSettings = nodeSettings(settings);
System.out.println("node settings="+nodeSettings.getAsMap());
System.out.println("node plugins="+classpathPlugins);
this.node = new Node(nodeSettings, classpathPlugins);
return this.node;
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
/**
* Sets all the provided settings.
*/
public Builder put(Settings settings) {
removeNonArraysFieldsIfNewSettingsContainsFieldAsArray(settings.getAsMap());
map.putAll(settings.getAsMap());
if (settings.getSecureSettings() != null) {
setSecureSettings(settings.getSecureSettings());
}
return this;
}
代码示例来源:origin: harbby/presto-connectors
@Override
protected ClusterBlockException checkBlock(ClusterUpdateSettingsRequest request, ClusterState state) {
// allow for dedicated changes to the metadata blocks, so we don't block those to allow to "re-enable" it
if ((request.transientSettings().getAsMap().isEmpty() && request.persistentSettings().getAsMap().size() == 1 && request.persistentSettings().get(MetaData.SETTING_READ_ONLY) != null) ||
request.persistentSettings().getAsMap().isEmpty() && request.transientSettings().getAsMap().size() == 1 && request.transientSettings().get(MetaData.SETTING_READ_ONLY) != null) {
return null;
}
return state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
}
代码示例来源:origin: sirensolutions/siren
/**
* Extract the analyzer names from a datatype's settings
*/
private String[] getAnalyzers(final Settings datatypeSettings) {
String[] analyzers = new String[datatypeSettings.getAsMap().size()];
analyzers[0] = datatypeSettings.get("index_analyzer").trim();
if (analyzers.length == 2) {
analyzers[1] = datatypeSettings.get("search_analyzer").trim();
}
return analyzers;
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
public static void writeSettingsToStream(Settings settings, StreamOutput out) throws IOException {
out.writeVInt(settings.size());
for (Map.Entry<String, String> entry : settings.getAsMap().entrySet()) {
out.writeString(entry.getKey());
out.writeOptionalString(entry.getValue());
}
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
/** Creates a DiscoveryNode representing the local node. */
public static DiscoveryNode createLocal(Settings settings, TransportAddress publishAddress, String nodeId) {
Map<String, String> attributes = new HashMap<>(Node.NODE_ATTRIBUTES.get(settings).getAsMap());
Set<Role> roles = getRolesFromSettings(settings);
return new DiscoveryNode(Node.NODE_NAME_SETTING.get(settings), nodeId, publishAddress, attributes, roles, Version.CURRENT);
}
代码示例来源:origin: harbby/presto-connectors
@Override
protected ClusterBlockException checkBlock(UpdateSettingsRequest request, ClusterState state) {
// allow for dedicated changes to the metadata blocks, so we don't block those to allow to "re-enable" it
ClusterBlockException globalBlock = state.blocks().globalBlockedException(ClusterBlockLevel.METADATA_WRITE);
if (globalBlock != null) {
return globalBlock;
}
if (request.settings().getAsMap().size() == 1 && (request.settings().get(IndexMetaData.SETTING_BLOCKS_METADATA) != null || request.settings().get(IndexMetaData.SETTING_READ_ONLY) != null )) {
return null;
}
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA_WRITE, indexNameExpressionResolver.concreteIndices(state, request));
}
内容来源于网络,如有侵权,请联系作者删除!