Java Code Examples for org.elasticsearch.cluster.metadata.IndexMetaData#State

The following examples show how to use org.elasticsearch.cluster.metadata.IndexMetaData#State . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DDLClusterStateHelpers.java    From crate with Apache License 2.0 5 votes vote down vote up
static Set<IndexMetaData> indexMetaDataSetFromIndexNames(MetaData metaData,
                                                         String[] indices,
                                                         IndexMetaData.State state) {
    Set<IndexMetaData> indicesMetaData = new HashSet<>();
    for (String indexName : indices) {
        IndexMetaData indexMetaData = metaData.index(indexName);
        if (indexMetaData != null && indexMetaData.getState() != state) {
            indicesMetaData.add(indexMetaData);
        }
    }
    return indicesMetaData;
}
 
Example 2
Source File: DocIndexMetaData.java    From crate with Apache License 2.0 5 votes vote down vote up
DocIndexMetaData(Functions functions, IndexMetaData metaData, RelationName ident) throws IOException {
    this.functions = functions;
    this.ident = ident;
    this.numberOfShards = metaData.getNumberOfShards();
    Settings settings = metaData.getSettings();
    this.numberOfReplicas = NumberOfReplicas.fromSettings(settings);
    this.mappingMap = getMappingMap(metaData);
    this.tableParameters = metaData.getSettings();

    Map<String, Object> metaMap = Maps.get(mappingMap, "_meta");
    indicesMap = Maps.getOrDefault(metaMap, "indices", ImmutableMap.of());
    List<List<String>> partitionedByList = Maps.getOrDefault(metaMap, "partitioned_by", List.of());
    this.partitionedBy = getPartitionedBy(partitionedByList);
    generatedColumns = Maps.getOrDefault(metaMap, "generated_columns", ImmutableMap.of());
    IndexMetaData.State state = isClosed(metaData, mappingMap, !partitionedByList.isEmpty()) ?
        IndexMetaData.State.CLOSE : IndexMetaData.State.OPEN;
    supportedOperations = Operation.buildFromIndexSettingsAndState(metaData.getSettings(), state);
    versionCreated = IndexMetaData.SETTING_INDEX_VERSION_CREATED.get(settings);
    versionUpgraded = settings.getAsVersion(IndexMetaData.SETTING_VERSION_UPGRADED, null);
    closed = state == IndexMetaData.State.CLOSE;

    this.expressionAnalyzer = new ExpressionAnalyzer(
        functions,
        CoordinatorTxnCtx.systemTransactionContext(),
        ParamTypeHints.EMPTY,
        FieldProvider.UNSUPPORTED,
        null);
}
 
Example 3
Source File: CreateIndexClusterStateUpdateRequest.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public IndexMetaData.State state() {
    return state;
}
 
Example 4
Source File: CreateIndexClusterStateUpdateRequest.java    From crate with Apache License 2.0 4 votes vote down vote up
public IndexMetaData.State state() {
    return state;
}
 
Example 5
Source File: CloseTableClusterStateTaskExecutor.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
protected IndexMetaData.State indexState() {
    return IndexMetaData.State.CLOSE;
}
 
Example 6
Source File: OpenTableClusterStateTaskExecutor.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
protected IndexMetaData.State indexState() {
    return IndexMetaData.State.OPEN;
}
 
Example 7
Source File: AbstractOpenCloseTableClusterStateTaskExecutor.java    From crate with Apache License 2.0 votes vote down vote up
protected abstract IndexMetaData.State indexState();