public Object remove(K key) { synchronized (_lock) { return _rotatingMap.remove(key); } }
private void fail(long batchId) { List<Object> ids = (List<Object>) idsMap.remove(batchId); if (ids != null) { for (Object id : ids) { _spout.fail(id); } } }
private void ack(long batchId) { List<Object> ids = (List<Object>) idsMap.remove(batchId); if (ids != null) { for (Object id : ids) { _spout.ack(id); } } }
@Override public void success(TransactionAttempt tx) { @SuppressWarnings("unchecked") List<Message> messages = (List<Message>) batchMessageMap.remove(tx.getTransactionId()); if (messages != null) { if (!messages.isEmpty()) { LOG.debug("Success for batch with transaction id " + tx.getTransactionId() + "/" + tx.getAttemptId() + " for " + name); } for (Message msg : messages) { String messageId = "UnknownId"; try { messageId = msg.getJMSMessageID(); msg.acknowledge(); LOG.trace("Acknowledged message " + messageId); } catch (JMSException e) { LOG.warn("Failed to acknowledge message " + messageId, e); } } } else { LOG.warn("No messages found in batch with transaction id " + tx.getTransactionId() + "/" + tx.getAttemptId()); } }
Long id = (Long) tuple.getValue(0); Long timeDeltaMs = (Long) tuple.getValue(1); TupleInfo tupleInfo = pending.remove(id); if (tupleInfo != null && tupleInfo.getMessageId() != null) { if (taskId != tupleInfo.getTaskId()) {
private boolean finishBatch(TrackedBatch tracked, Tuple finishTuple) { boolean success = true; try { _bolt.finishBatch(tracked.info); String stream = COORD_STREAM(tracked.info.batchGroup); for (Integer task : tracked.condition.targetTasks) { _collector .emitDirect(task, stream, finishTuple, new Values(tracked.info.batchId, Utils.get(tracked.taskEmittedTuples, task, 0))); } if (tracked.delayedAck != null) { _collector.ack(tracked.delayedAck); tracked.delayedAck = null; } } catch (FailedException e) { failBatch(tracked, e); success = false; } _batches.remove(tracked.info.batchId.getId()); return success; }
_batches.remove(id.getId()); tracked = null; } else if (id.getAttemptId() < tracked.attemptId) {
public Object remove(K key) { synchronized(_lock) { return _rotatingMap.remove(key); } }
private void fail(long batchId) { List<Object> ids = (List<Object>) idsMap.remove(batchId); if(ids!=null) { for(Object id: ids) { _spout.fail(id); } } }
private void ack(long batchId) { List<Object> ids = (List<Object>) idsMap.remove(batchId); if(ids!=null) { for(Object id: ids) { _spout.ack(id); } } }
@Override protected void removeQuery(String id) { // Only update count if query was in queries or postFinishBuffer. if (queries.containsKey(id) || postFinishBuffer.containsKey(id)) { updateCount(activeQueriesCount, -1L); } queries.remove(id); postFinishBuffer.remove(id); bufferedMetadata.remove(id); // It should not be in the preStartBuffer under normal operations but could be if it was killed. preStartBuffer.remove(id); }
@Override protected void removeQuery(String id) { // Only update count if query was in queries or postFinishBuffer. if (queries.containsKey(id) || postFinishBuffer.containsKey(id)) { updateCount(activeQueriesCount, -1L); } queries.remove(id); postFinishBuffer.remove(id); bufferedMetadata.remove(id); // It should not be in the preStartBuffer under normal operations but could be if it was killed. preStartBuffer.remove(id); }
private void startDelayed(Map.Entry<String, Querier> query) { String id = query.getKey(); Querier querier = query.getValue(); preStartBuffer.remove(id); // Make the query start again to mark the correct start for the query. querier.restart(); queries.put(id, querier); // Now it's active updateCount(activeQueriesCount, 1L); log.info("Started delayed query {}", id); }
private void startDelayed(Map.Entry<String, Querier> query) { String id = query.getKey(); Querier querier = query.getValue(); preStartBuffer.remove(id); // Make the query start again to mark the correct start for the query. querier.restart(); queries.put(id, querier); // Now it's active updateCount(activeQueriesCount, 1L); log.info("Started delayed query {}", id); }
@Override public void success(TransactionAttempt tx) { @SuppressWarnings("unchecked") List<Message> messages = (List<Message>) batchMessageMap.remove(tx.getTransactionId()); if (messages != null) { if (!messages.isEmpty()) { LOG.debug("Success for batch with transaction id "+tx.getTransactionId()+"/"+tx.getAttemptId()+" for "+name); } for (Message msg: messages) { String messageId = "UnknownId"; try { messageId = msg.getJMSMessageID(); msg.acknowledge(); LOG.trace("Acknowledged message "+messageId); } catch (JMSException e) { LOG.warn("Failed to acknowledge message "+messageId, e); } } } else { LOG.warn("No messages found in batch with transaction id "+tx.getTransactionId()+"/"+tx.getAttemptId()); } }
@Override public void success(TransactionAttempt tx) { @SuppressWarnings("unchecked") List<Message> messages = (List<Message>) batchMessageMap.remove(tx.getTransactionId()); if (messages != null) { if (!messages.isEmpty()) { LOG.debug("Success for batch with transaction id "+tx.getTransactionId()+"/"+tx.getAttemptId()+" for "+name); } for (Message msg: messages) { String messageId = "UnknownId"; try { messageId = msg.getJMSMessageID(); msg.acknowledge(); LOG.trace("Acknowledged message "+messageId); } catch (JMSException e) { LOG.warn("Failed to acknowledge message "+messageId, e); } } } else { LOG.warn("No messages found in batch with transaction id "+tx.getTransactionId()+"/"+tx.getAttemptId()); } }
private boolean finishBatch(TrackedBatch tracked, Tuple finishTuple) { boolean success = true; try { _bolt.finishBatch(tracked.info); String stream = COORD_STREAM(tracked.info.batchGroup); for(Integer task: tracked.condition.targetTasks) { _collector.emitDirect(task, stream, finishTuple, new Values(tracked.info.batchId, Utils.get(tracked.taskEmittedTuples, task, 0))); } if(tracked.delayedAck!=null) { _collector.ack(tracked.delayedAck); tracked.delayedAck = null; } } catch(FailedException e) { failBatch(tracked, e); success = false; } _batches.remove(tracked.info.batchId.getId()); return success; }
_batches.remove(id.getId()); tracked = null; } else if(id.getAttemptId() < tracked.attemptId) {