// server, run it in local.
response = server.scan(entityGroupInfo.getEntityGroupName(),
action, scannerId == -1 ? false : true, scannerId, false);
scannerId = response.getScannerId();
} else {// rpc
ClientProtocol clientProtocol = connection.getClient(
serverName.getHostname(), serverName.getPort());
response = clientProtocol.scan(null,
RequestConverter.buildScanRequest(action, scannerId, false));
scannerId = response.getScannerId();
}
if (nameDataTypePairs.isEmpty()) {
nameDataTypePairs.addAll(response.getMetaList());
}
resultList.addAll(response.getResultList());
if (limit != -1) {
queryResultProtos.addAll(resultList);
resultList.clear();
if (localScan) {
server.scan(null, action, true, scannerId, true);
} else {
ClientProtocol clientProtocol = connection.getClient(
serverName.getHostname(), serverName.getPort());
clientProtocol.scan(null,
RequestConverter.buildScanRequest(action, scannerId, true));
}
lastScan = true;
scannerId = -1;
closed = true;
break;
} else {
if (response.getResultList().size() == 0 && resultList.size() == 0) {
if (localScan) {
server.scan(null, action, true, scannerId, true);
} else {
ClientProtocol clientProtocol = connection.getClient(
serverName.getHostname(), serverName.getPort());
clientProtocol.scan(null,
RequestConverter.buildScanRequest(action, scannerId, true));
}
lastScan = true;
scannerId = -1;
closed = true;