Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A new
_shard_stores
API provides store information for shard copies…
… of indices. Store information reports on which nodes shard copies exist, the shard copy version, indicating how recent they are, and any exceptions encountered while opening the shard index or from earlier engine failure. closes #10952
- Loading branch information
Showing
32 changed files
with
1,703 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
...n/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoreRequestBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.action.admin.indices.shards; | ||
|
||
import org.elasticsearch.action.Action; | ||
import org.elasticsearch.action.support.IndicesOptions; | ||
import org.elasticsearch.action.support.master.MasterNodeReadOperationRequestBuilder; | ||
import org.elasticsearch.client.ElasticsearchClient; | ||
|
||
/** | ||
* Request builder for {@link IndicesShardStoresRequest} | ||
*/ | ||
public class IndicesShardStoreRequestBuilder extends MasterNodeReadOperationRequestBuilder<IndicesShardStoresRequest, IndicesShardStoresResponse, IndicesShardStoreRequestBuilder> { | ||
|
||
public IndicesShardStoreRequestBuilder(ElasticsearchClient client, Action<IndicesShardStoresRequest, IndicesShardStoresResponse, IndicesShardStoreRequestBuilder> action, String... indices) { | ||
super(client, action, new IndicesShardStoresRequest(indices)); | ||
} | ||
|
||
/** | ||
* Sets the indices for the shard stores request | ||
*/ | ||
public IndicesShardStoreRequestBuilder setIndices(String... indices) { | ||
request.indices(indices); | ||
return this; | ||
} | ||
|
||
/** | ||
* Specifies what type of requested indices to ignore and wildcard indices expressions | ||
* By default, expands wildcards to both open and closed indices | ||
*/ | ||
public IndicesShardStoreRequestBuilder setIndicesOptions(IndicesOptions indicesOptions) { | ||
request.indicesOptions(indicesOptions); | ||
return this; | ||
} | ||
|
||
/** | ||
* Set statuses to filter shards to get stores info on. | ||
* @param shardStatuses acceptable values are "green", "yellow", "red" and "all" | ||
* see {@link org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus} for details | ||
*/ | ||
public IndicesShardStoreRequestBuilder setShardStatuses(String... shardStatuses) { | ||
request.shardStatuses(shardStatuses); | ||
return this; | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...src/main/java/org/elasticsearch/action/admin/indices/shards/IndicesShardStoresAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.action.admin.indices.shards; | ||
|
||
import org.elasticsearch.action.Action; | ||
import org.elasticsearch.client.ElasticsearchClient; | ||
|
||
/** | ||
* Action for {@link TransportIndicesShardStoresAction} | ||
* | ||
* Exposes shard store information for requested indices. | ||
* Shard store information reports which nodes hold shard copies, how recent they are | ||
* and any exceptions on opening the shard index or from previous engine failures | ||
*/ | ||
public class IndicesShardStoresAction extends Action<IndicesShardStoresRequest, IndicesShardStoresResponse, IndicesShardStoreRequestBuilder> { | ||
|
||
public static final IndicesShardStoresAction INSTANCE = new IndicesShardStoresAction(); | ||
public static final String NAME = "indices:monitor/shard_stores"; | ||
|
||
private IndicesShardStoresAction() { | ||
super(NAME); | ||
} | ||
|
||
@Override | ||
public IndicesShardStoresResponse newResponse() { | ||
return new IndicesShardStoresResponse(); | ||
} | ||
|
||
@Override | ||
public IndicesShardStoreRequestBuilder newRequestBuilder(ElasticsearchClient client) { | ||
return new IndicesShardStoreRequestBuilder(client, this); | ||
} | ||
} |
Oops, something went wrong.