@Override
public void fail(Object msgId) {
try {
if (msgId != null && ConsumerRecord.class.isInstance(msgId)) {
flowedMsgCount--;
ConsumerRecord<String, byte[]> record = getMessageId(msgId);
String recordString = new String(record.value());
JSONObject jsonObject = JSONObject.parseObject(recordString);
String dataSourceInfo = jsonObject.getString(DataPullConstants.DATA_SOURCE_INFO);
String dsKey = FullPullHelper.getDataSourceKey(JSONObject.parseObject(dataSourceInfo));
String splitIndex = jsonObject.getString(DataPullConstants.DATA_CHUNK_SPLIT_INDEX);
LOG.error("Spout got fail!, record offset is:{}, {}: split index is {}", record.offset(), dsKey, splitIndex);
if (!failAndBreakTuplesSet.contains(dataSourceInfo)) {
String errMsg = String.format("Spout got fail!, record offset is:%s, %s: split index is %s", record.offset(), dsKey, splitIndex);
FullPullHelper.finishPullReport(zkService, dataSourceInfo, FullPullHelper.getCurrentTimeStampString(),
Constants.DataTableStatus.DATA_STATUS_ABORT, errMsg);
FullPullHelper.updatePendingTasksTrackInfo(zkService, dsName, dataSourceInfo, DataPullConstants.FULLPULL_PENDING_TASKS_OP_REMOVE_WATCHING);
}
failAndBreakTuplesSet.add(dataSourceInfo);
}
processedCount++;
super.fail(msgId);
} catch (Exception e) {
LOG.error("DataPullingSpout:Fail ack throwed exception!", e);
}
}