use of org.elasticsearch.action.admin.indices.upgrade.post.ShardUpgradeRequest in project LinkAgent by shulieTech.
the class ShardUpgradeRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
ShardUpgradeRequest req = (ShardUpgradeRequest) target;
String[] indices = req.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 delete index template ! " + index);
}
if (!Pradar.isClusterTestPrefix(index)) {
index = Pradar.addClusterTestPrefixLower(index);
indices[i] = index;
}
}
return Arrays.asList(indices);
}
Aggregations