if (ret.getClientStatus() != null && ret.getClientStatus().getStatus() >= 400 &&
ret.getClientStatus().getStatus() < 600) {
throw new TDHSBatchException(
new TDHSResponse(ret.getClientStatus(), null, ret.getData(), charsetName));
} else {
throw new TDHSException("unknown response code! [" + (ret.getClientStatus() != null ?
String.valueOf(ret.getClientStatus().getStatus()) : "") + "]");
}
}
if (ret.getBatchNumber() != batchRequest.size()) {
throw new TDHSException(
"unmatch batch size! request is[" + String.valueOf(batchRequest.size()) + "], response is [" +
String.valueOf(ret.getBatchNumber()) + "]");
}
TDHSResponse result[] = new TDHSResponse[batchRequest.size()];
int i = 0;
for (internal_struct is : batchRequest) {
result[i++] =
do_response(responses.get(is.getPacket().getSeqId()), is.getMetaData(), is.getCharsetName());
}
return result;
} catch (InterruptedException e) {
throw new TDHSException(e);
}
}