本文整理汇总了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));
}
示例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()]);
}
示例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);
}
}
}
示例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();
}
}
示例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;
}
示例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();
}
示例7: doExecute
import org.elasticsearch.action.admin.indices.status.IndicesStatusResponse; //导入依赖的package包/类
@Override
protected ActionFuture<IndicesStatusResponse> doExecute(IndicesStatusRequest request) {
return client.admin().indices().status(request);
}