@Override public void run() { try { state.doneProcess(); state.taskMetrics.asyncCallbackCompleted().inc(); TaskCallbackImpl callbackImpl = (TaskCallbackImpl) callback; containerMetrics.processNs().update(clock.nanoTime() - callbackImpl.timeCreatedNs); log.trace("Got callback complete for task {}, ssp {}", callbackImpl.taskName, callbackImpl.envelope.getSystemStreamPartition()); List<TaskCallbackImpl> callbacksToUpdate = callbackManager.updateCallback(callbackImpl); for (TaskCallbackImpl callbackToUpdate : callbacksToUpdate) { IncomingMessageEnvelope envelope = callbackToUpdate.envelope; log.trace("Update offset for ssp {}, offset {}", envelope.getSystemStreamPartition(), envelope.getOffset()); // update offset task.offsetManager().update(task.taskName(), envelope.getSystemStreamPartition(), envelope.getOffset()); // update coordinator coordinatorRequests.update(callbackToUpdate.coordinator); } } catch (Throwable t) { log.error("Error marking process as complete.", t); abort(t); } finally { resume(); } } }, workNanos);
@Override public void run() { try { state.doneProcess(); state.taskMetrics.asyncCallbackCompleted().inc(); TaskCallbackImpl callbackImpl = (TaskCallbackImpl) callback; containerMetrics.processNs().update(clock.nanoTime() - callbackImpl.timeCreatedNs); log.trace("Got callback complete for task {}, ssp {}", callbackImpl.taskName, callbackImpl.envelope.getSystemStreamPartition()); List<TaskCallbackImpl> callbacksToUpdate = callbackManager.updateCallback(callbackImpl); for (TaskCallbackImpl callbackToUpdate : callbacksToUpdate) { IncomingMessageEnvelope envelope = callbackToUpdate.envelope; log.trace("Update offset for ssp {}, offset {}", envelope.getSystemStreamPartition(), envelope.getOffset()); // update offset task.offsetManager().update(task.taskName(), envelope.getSystemStreamPartition(), envelope.getOffset()); // update coordinator coordinatorRequests.update(callbackToUpdate.coordinator); } } catch (Throwable t) { log.error("Error marking process as complete.", t); abort(t); } finally { resume(); } } }, workNanos);
@Override public void run() { try { state.doneProcess(); state.taskMetrics.asyncCallbackCompleted().inc(); TaskCallbackImpl callbackImpl = (TaskCallbackImpl) callback; containerMetrics.processNs().update(clock.nanoTime() - callbackImpl.timeCreatedNs); log.trace("Got callback complete for task {}, ssp {}", callbackImpl.taskName, callbackImpl.envelope.getSystemStreamPartition()); List<TaskCallbackImpl> callbacksToUpdate = callbackManager.updateCallback(callbackImpl); for (TaskCallbackImpl callbackToUpdate : callbacksToUpdate) { IncomingMessageEnvelope envelope = callbackToUpdate.envelope; log.trace("Update offset for ssp {}, offset {}", envelope.getSystemStreamPartition(), envelope.getOffset()); // update offset task.offsetManager().update(task.taskName(), envelope.getSystemStreamPartition(), envelope.getOffset()); // update coordinator coordinatorRequests.update(callbackToUpdate.coordinator); } } catch (Throwable t) { log.error("Error marking process as complete.", t); abort(t); } finally { resume(); } } }, workNanos);
@Override public void run() { try { state.doneProcess(); state.taskMetrics.asyncCallbackCompleted().inc(); TaskCallbackImpl callbackImpl = (TaskCallbackImpl) callback; containerMetrics.processNs().update(clock.nanoTime() - callbackImpl.timeCreatedNs); log.trace("Got callback complete for task {}, ssp {}", callbackImpl.taskName, callbackImpl.envelope.getSystemStreamPartition()); List<TaskCallbackImpl> callbacksToUpdate = callbackManager.updateCallback(callbackImpl); for (TaskCallbackImpl callbackToUpdate : callbacksToUpdate) { IncomingMessageEnvelope envelope = callbackToUpdate.envelope; log.trace("Update offset for ssp {}, offset {}", envelope.getSystemStreamPartition(), envelope.getOffset()); // update offset task.offsetManager().update(task.taskName(), envelope.getSystemStreamPartition(), envelope.getOffset()); // update coordinator coordinatorRequests.update(callbackToUpdate.coordinator); } } catch (Throwable t) { log.error("Error marking process as complete.", t); abort(t); } finally { resume(); } } }, workNanos);
@Override public void run() { try { state.doneProcess(); state.taskMetrics.asyncCallbackCompleted().inc(); TaskCallbackImpl callbackImpl = (TaskCallbackImpl) callback; containerMetrics.processNs().update(clock.nanoTime() - callbackImpl.timeCreatedNs); log.trace("Got callback complete for task {}, ssp {}", callbackImpl.taskName, callbackImpl.envelope.getSystemStreamPartition()); List<TaskCallbackImpl> callbacksToUpdate = callbackManager.updateCallback(callbackImpl); for (TaskCallbackImpl callbackToUpdate : callbacksToUpdate) { IncomingMessageEnvelope envelope = callbackToUpdate.envelope; log.trace("Update offset for ssp {}, offset {}", envelope.getSystemStreamPartition(), envelope.getOffset()); // update offset task.offsetManager().update(task.taskName(), envelope.getSystemStreamPartition(), envelope.getOffset()); // update coordinator coordinatorRequests.update(callbackToUpdate.coordinator); } } catch (Throwable t) { log.error("Error marking process as complete.", t); abort(t); } finally { resume(); } } }, workNanos);
assertEquals(5L, containerMetrics.envelopes().getCount()); assertEquals(3L, containerMetrics.processes().getCount()); assertEquals(2L, t0.metrics().asyncCallbackCompleted().getCount()); assertEquals(1L, t1.metrics().asyncCallbackCompleted().getCount());