org.elasticsearch.client.indices.DataStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-rest-high-level-client Show documentation
Show all versions of elasticsearch-rest-high-level-client Show documentation
Elasticsearch subproject :client:rest-high-level
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
package org.elasticsearch.client.indices;
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.xcontent.ConstructingObjectParser;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xcontent.XContentParser;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
public final class DataStream {
private final String name;
private final String timeStampField;
private final List indices;
private final long generation;
private final boolean hidden;
private final boolean system;
ClusterHealthStatus dataStreamStatus;
@Nullable
String indexTemplate;
@Nullable
String ilmPolicyName;
@Nullable
private final Map metadata;
private final boolean replicated;
public DataStream(
String name,
String timeStampField,
List indices,
long generation,
ClusterHealthStatus dataStreamStatus,
@Nullable String indexTemplate,
@Nullable String ilmPolicyName,
@Nullable Map metadata,
boolean hidden,
boolean system,
boolean replicated
) {
this.name = name;
this.timeStampField = timeStampField;
this.indices = indices;
this.generation = generation;
this.dataStreamStatus = dataStreamStatus;
this.indexTemplate = indexTemplate;
this.ilmPolicyName = ilmPolicyName;
this.metadata = metadata;
this.hidden = hidden;
this.system = system;
this.replicated = replicated;
}
public String getName() {
return name;
}
public String getTimeStampField() {
return timeStampField;
}
public List getIndices() {
return indices;
}
public long getGeneration() {
return generation;
}
public ClusterHealthStatus getDataStreamStatus() {
return dataStreamStatus;
}
public String getIndexTemplate() {
return indexTemplate;
}
public String getIlmPolicyName() {
return ilmPolicyName;
}
public Map getMetadata() {
return metadata;
}
public boolean isHidden() {
return hidden;
}
public boolean isSystem() {
return system;
}
public boolean isReplicated() {
return replicated;
}
public static final ParseField NAME_FIELD = new ParseField("name");
public static final ParseField TIMESTAMP_FIELD_FIELD = new ParseField("timestamp_field");
public static final ParseField INDICES_FIELD = new ParseField("indices");
public static final ParseField GENERATION_FIELD = new ParseField("generation");
public static final ParseField STATUS_FIELD = new ParseField("status");
public static final ParseField INDEX_TEMPLATE_FIELD = new ParseField("template");
public static final ParseField ILM_POLICY_FIELD = new ParseField("ilm_policy");
public static final ParseField METADATA_FIELD = new ParseField("_meta");
public static final ParseField HIDDEN_FIELD = new ParseField("hidden");
public static final ParseField SYSTEM_FIELD = new ParseField("system");
public static final ParseField REPLICATED = new ParseField("replicated");
@SuppressWarnings("unchecked")
private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>("data_stream", args -> {
String dataStreamName = (String) args[0];
String timeStampField = (String) ((Map, ?>) args[1]).get("name");
List indices = ((List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy