use of org.apache.storm.shade.org.apache.commons.lang.IllegalClassException in project storm by apache.
the class WindowsStateUpdater method updateState.
@Override
public void updateState(WindowsState state, List<TridentTuple> tuples, TridentCollector collector) {
Long currentTxId = state.getCurrentTxId();
LOG.debug("Removing triggers using WindowStateUpdater, txnId: [{}] ", currentTxId);
for (TridentTuple tuple : tuples) {
try {
Object fieldValue = tuple.getValueByField(WindowTridentProcessor.TRIGGER_FIELD_NAME);
if (!(fieldValue instanceof WindowTridentProcessor.TriggerInfo)) {
throw new IllegalClassException(WindowTridentProcessor.TriggerInfo.class, fieldValue.getClass());
}
WindowTridentProcessor.TriggerInfo triggerInfo = (WindowTridentProcessor.TriggerInfo) fieldValue;
String triggerCompletedKey = WindowTridentProcessor.getWindowTriggerInprocessIdPrefix(triggerInfo.windowTaskId) + currentTxId;
LOG.debug("Removing trigger key [{}] and trigger completed key [{}] from store: [{}]", triggerInfo, triggerCompletedKey, windowsStore);
windowsStore.removeAll(Lists.newArrayList(triggerInfo.generateTriggerKey(), triggerCompletedKey));
} catch (Exception ex) {
LOG.warn(ex.getMessage());
collector.reportError(ex);
throw new FailedException(ex);
}
}
}
Aggregations