use of org.elasticsearch.client.indices.CloseIndexRequest in project LinkAgent by shulieTech.
the class CloseIndexRequestIndexRename0 method reindex0.
@Override
public List<String> reindex0(Object target) {
CloseIndexRequest req = (CloseIndexRequest) target;
String[] indexes = req.indices();
for (int i = 0, len = indexes.length; i < len; i++) {
String index = indexes[i];
/**
* 如果在白名单中则不允许写
*/
if (GlobalConfig.getInstance().getSearchWhiteList().contains(index)) {
throw new PressureMeasureError("Cluster Test request can't refresh business index ! " + index);
}
if (!Pradar.isClusterTestPrefix(index)) {
index = Pradar.addClusterTestPrefixLower(index);
indexes[i] = index;
}
}
try {
Reflect.on(req).set("indices", indexes);
} catch (ReflectException e) {
throw new PressureMeasureError("can't found field indices from " + CloseIndexRequest.class.getName());
}
return Arrays.asList(indexes);
}
use of org.elasticsearch.client.indices.CloseIndexRequest in project graylog2-server by Graylog2.
the class ClientES7 method closeIndex.
@Override
public void closeIndex(String index) {
final CloseIndexRequest closeIndexRequest = new CloseIndexRequest(index);
client.execute((c, requestOptions) -> c.indices().close(closeIndexRequest, requestOptions));
}
use of org.elasticsearch.client.indices.CloseIndexRequest in project graylog2-server by Graylog2.
the class IndicesAdapterES7 method close.
@Override
public void close(String index) {
final CloseIndexRequest request = new CloseIndexRequest(index);
client.execute((c, requestOptions) -> c.indices().close(request, requestOptions), "Unable to close index " + index);
}
Aggregations