use of com.pamirs.attach.plugin.es.common.RequestIndexRename 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.attach.plugin.es.common.RequestIndexRename 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;
}
use of com.pamirs.attach.plugin.es.common.RequestIndexRename in project LinkAgent by shulieTech.
the class AbstractRestClientShadowServerInterceptor method doShadowIndexInterceptor.
protected CutOffResult doShadowIndexInterceptor(Advice advice) {
Object[] args = advice.getParameterArray();
RequestIndexRename requestIndexRename = RequestIndexRenameProvider.get(args[0]);
if (requestIndexRename == null) {
throw new PressureMeasureError("elasticsearch " + args[0].getClass().getName() + " is not supported!");
}
if (requestIndexRename.supportedDirectReindex(args[0])) {
requestIndexRename.reindex(args[0]);
} else {
Object index = requestIndexRename.indirectIndex(args[0]);
advice.changeParameter(0, index);
}
return CutOffResult.PASSED;
}
Aggregations