use of com.pamirs.pradar.exception.PressureMeasureError in project LinkAgent by shulieTech.
the class MultiTermVectorsRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
MultiTermVectorsRequest mreq = (MultiTermVectorsRequest) target;
List list = mreq.getRequests();
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!");
}
}
return indexes;
}
use of com.pamirs.pradar.exception.PressureMeasureError in project LinkAgent by shulieTech.
the class OpenIndexRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
OpenIndexRequest req = (OpenIndexRequest) 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 PutMappingRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
PutMappingRequest req = (PutMappingRequest) 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;
}
}
return Arrays.asList(indexes);
}
use of com.pamirs.pradar.exception.PressureMeasureError in project LinkAgent by shulieTech.
the class IndicesSegementsRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
IndicesSegmentsRequest req = (IndicesSegmentsRequest) 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 IndicesShardStoresRequestIndexRename method reindex0.
@Override
public List<String> reindex0(Object target) {
IndicesShardStoresRequest req = (IndicesShardStoresRequest) 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);
}
Aggregations