use of com.pamirs.pradar.exception.PressureMeasureError in project LinkAgent by shulieTech.
the class DeleteIndexRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
DeleteIndexRequest req = (DeleteIndexRequest) 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 write business index ! " + index);
}
if (!Pradar.isClusterTestPrefix(index)) {
index = Pradar.addClusterTestPrefixLower(index);
indexes[i] = index;
}
}
req.indices(indexes);
return Arrays.asList(indexes);
}
use of com.pamirs.pradar.exception.PressureMeasureError in project LinkAgent by shulieTech.
the class DeleteIndexTemplateRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
DeleteIndexTemplateRequest req = (DeleteIndexTemplateRequest) target;
String name = req.name();
/**
* 如果在白名单中则不允许写
*/
if (GlobalConfig.getInstance().getSearchWhiteList().contains(name)) {
throw new PressureMeasureError("Cluster Test request can't delete index template ! " + name);
}
if (!Pradar.isClusterTestPrefix(name)) {
name = Pradar.addClusterTestPrefixLower(name);
}
req.name(name);
return Arrays.asList(name);
}
use of com.pamirs.pradar.exception.PressureMeasureError in project LinkAgent by shulieTech.
the class DeleteRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
DeleteRequest req = (DeleteRequest) target;
String index = req.index();
/**
* 如果在白名单中则不允许写
*/
if (GlobalConfig.getInstance().getSearchWhiteList().contains(index)) {
throw new PressureMeasureError("Cluster Test request can't write business index ! " + index);
}
if (!Pradar.isClusterTestPrefix(index)) {
index = Pradar.addClusterTestPrefixLower(req.index());
}
req.index(index);
return Arrays.asList(index);
}
use of com.pamirs.pradar.exception.PressureMeasureError in project LinkAgent by shulieTech.
the class DeleteWarmerRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
DeleteWarmerRequest req = (DeleteWarmerRequest) 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;
}
}
req.indices(indices);
return Arrays.asList(indices);
}
use of com.pamirs.pradar.exception.PressureMeasureError in project LinkAgent by shulieTech.
the class UpgradeRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
UpgradeRequest req = (UpgradeRequest) 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;
}
}
req.indices(indices);
return Arrays.asList(indices);
}
Aggregations