本文整理汇总了Java中org.elasticsearch.action.admin.indices.status.IndicesStatusResponse类的典型用法代码示例。如果您正苦于以下问题:Java IndicesStatusResponse类的具体用法?Java IndicesStatusResponse怎么用?Java IndicesStatusResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IndicesStatusResponse类属于org.elasticsearch.action.admin.indices.status包,在下文中一共展示了IndicesStatusResponse类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: get
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; //导入依赖的package包/类
@Override
public synchronized Matrix get(int index) {
IndicesStatusResponse response = client.admin().indices().prepareStatus().execute().actionGet();
Set<String> indexSet = new TreeSet<String>(response.getIndices().keySet());
List<String> indexList = new ArrayList<String>(indexSet);
return Matrix.Factory.linkToValue(indexList.get(index));
}
开发者ID:ujmp,项目名称:universal-java-matrix-package,代码行数:8,代码来源:ElasticsearchIndexListMatrix.java
示例2: getIndexStatus
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; //导入依赖的package包/类
public IndexStatus[] getIndexStatus() {
String[] indices = this.getClusterState().metaData().getConcreteAllIndices();
IndicesStatusRequestBuilder builder = client.admin().indices().prepareStatus(indices);
IndicesStatusResponse response = builder.execute().actionGet();
Map<String, IndexStatus> map = response.getIndices();
return map.values().toArray(new IndexStatus[map.size()]);
}
开发者ID:DemandCube,项目名称:NeverwinterDP-Commons,代码行数:8,代码来源:ESClient.java
示例3: run
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; //导入依赖的package包/类
@Override
public void run() {
log.info("I am going to do some clean up for index window: " + window);
final IndicesStatusResponse indicesStatusResponse = client.admin()
.indices().prepareStatus().execute().actionGet();
final Set<String> allIndices = indicesStatusResponse.getIndices()
.keySet();
final Set<String> toBeRemoved = getToBeRemovedIndices(allIndices);
if (toBeRemoved.isEmpty()) {
log.info("All good... no index to be removed.");
return;
}
for (final String index : toBeRemoved) {
log.info("This index is going to be removed: " + index);
try {
final DeleteIndexResponse deleteResponse = client.admin()
.indices().delete(new DeleteIndexRequest(index))
.actionGet();
if (deleteResponse.isAcknowledged()) {
log.info("Delete successful for: " + index);
} else {
log.info("Delete not successful for: " + index);
}
} catch (final Exception e) {
log.error("Something went wrong while deleting index " + index,
e);
}
}
}
开发者ID:spotify,项目名称:elasticsearch-index-window,代码行数:30,代码来源:IndexWindowRunner.java
示例4: clearIndices
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; //导入依赖的package包/类
public static void clearIndices(Client esClient) {
IndicesStatusRequest req = Requests.indicesStatusRequest((String[]) null);
IndicesStatusResponse statuses = indicesAdmin(esClient).status(req).actionGet();
for (String index : statuses.getIndices().keySet()) {
indicesAdmin(esClient).delete(Requests.deleteIndexRequest(index)).actionGet();
}
}
开发者ID:atlasapi,项目名称:atlas-deer,代码行数:8,代码来源:ElasticSearchHelper.java
示例5: toXContent
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; //导入依赖的package包/类
@Override
protected XContentBuilder toXContent(IndicesStatusRequest request, IndicesStatusResponse response, XContentBuilder builder) throws IOException {
builder.startObject();
builder.field(Fields.OK, true);
buildBroadcastShardsHeader(builder, response);
response.toXContent(builder, ToXContent.EMPTY_PARAMS);
builder.endObject();
return builder;
}
开发者ID:javanna,项目名称:elasticshell,代码行数:10,代码来源:StatusRequestBuilder.java
示例6: size
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; //导入依赖的package包/类
@Override
public synchronized int size() {
IndicesStatusResponse response = client.admin().indices().prepareStatus().execute().actionGet();
return response.getIndices().size();
}
开发者ID:ujmp,项目名称:universal-java-matrix-package,代码行数:6,代码来源:ElasticsearchIndexListMatrix.java
示例7: doExecute
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; //导入依赖的package包/类
@Override
protected ActionFuture<IndicesStatusResponse> doExecute(IndicesStatusRequest request) {
return client.admin().indices().status(request);
}
开发者ID:javanna,项目名称:elasticshell,代码行数:5,代码来源:StatusRequestBuilder.java
注:本文中的org.elasticsearch.action.admin.indices.status.IndicesStatusResponse类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论