use of org.elasticsearch.action.percolate.MultiPercolateRequest in project LinkAgent by shulieTech.
the class MultiPercolateRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
MultiPercolateRequest mReq = (MultiPercolateRequest) target;
List list = mReq.requests();
List<String> indexes = new ArrayList<String>();
for (Object req : list) {
if (req == null) {
continue;
}
RequestIndexRename requestIndexRename = RequestIndexRenameProvider.get(req);
if (requestIndexRename != null) {
indexes.addAll(requestIndexRename.reindex(req));
} else {
throw new PressureMeasureError("elasticsearch " + req.getClass().getName() + " is not supported!");
}
}
String[] indices = mReq.indices();
for (int i = 0, len = indices.length; i < len; i++) {
String index = indices[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);
indices[i] = index;
}
}
return indexes;
}
use of org.elasticsearch.action.percolate.MultiPercolateRequest in project LinkAgent by shulieTech.
the class MultiPercolateRequestIndexRename method getIndex0.
@Override
public List<String> getIndex0(Object target) {
MultiPercolateRequest mReq = (MultiPercolateRequest) target;
List list = mReq.requests();
List<String> indexes = new ArrayList<String>();
for (Object req : list) {
if (req == null) {
continue;
}
RequestIndexRename requestIndexRename = RequestIndexRenameProvider.get(req);
if (requestIndexRename != null) {
indexes.addAll(requestIndexRename.getIndex(req));
}
}
return indexes;
}
Aggregations