public class MetaDataCreateIndexService extends AbstractComponent
Modifier and Type | Field and Description |
---|---|
static int |
MAX_INDEX_NAME_BYTES |
deprecationLogger, logger, settings
Constructor and Description |
---|
MetaDataCreateIndexService(Settings settings,
ClusterService clusterService,
IndicesService indicesService,
AllocationService allocationService,
AliasValidator aliasValidator,
Environment env,
IndexScopedSettings indexScopedSettings,
ThreadPool threadPool) |
Modifier and Type | Method and Description |
---|---|
void |
createIndex(CreateIndexClusterStateUpdateRequest request,
ActionListener<CreateIndexClusterStateUpdateResponse> listener)
Creates an index in the cluster state and waits for the specified number of shard copies to
become active (as specified in
CreateIndexClusterStateUpdateRequest.waitForActiveShards() )
before sending the response on the listener. |
static void |
validateIndexName(java.lang.String index,
ClusterState state)
Validate the name for an index against some static rules and a cluster state.
|
static void |
validateIndexOrAliasName(java.lang.String index,
java.util.function.BiFunction<java.lang.String,java.lang.String,? extends java.lang.RuntimeException> exceptionCtor)
Validate the name for an index or alias against some static rules.
|
void |
validateIndexSettings(java.lang.String indexName,
Settings settings) |
logDeprecatedSetting, logRemovedSetting, nodeName
public static final int MAX_INDEX_NAME_BYTES
@Inject public MetaDataCreateIndexService(Settings settings, ClusterService clusterService, IndicesService indicesService, AllocationService allocationService, AliasValidator aliasValidator, Environment env, IndexScopedSettings indexScopedSettings, ThreadPool threadPool)
public static void validateIndexName(java.lang.String index, ClusterState state)
public static void validateIndexOrAliasName(java.lang.String index, java.util.function.BiFunction<java.lang.String,java.lang.String,? extends java.lang.RuntimeException> exceptionCtor)
public void createIndex(CreateIndexClusterStateUpdateRequest request, ActionListener<CreateIndexClusterStateUpdateResponse> listener)
CreateIndexClusterStateUpdateRequest.waitForActiveShards()
)
before sending the response on the listener. If the index creation was successfully applied on
the cluster state, then ClusterStateUpdateResponse.isAcknowledged()
will return
true, otherwise it will return false and no waiting will occur for started shards
(CreateIndexClusterStateUpdateResponse.isShardsAcked()
will also be false). If the index
creation in the cluster state was successful and the requisite shard copies were started before
the timeout, then CreateIndexClusterStateUpdateResponse.isShardsAcked()
will
return true, otherwise if the operation timed out, then it will return false.request
- the index creation cluster state update requestlistener
- the listener on which to send the index creation cluster state update responsepublic void validateIndexSettings(java.lang.String indexName, Settings settings) throws IndexCreationException
IndexCreationException