Source:
public void onPartitionsAssigned(final Collection<TopicPartition> assignment) { log.debug("at state {}: partitions assigned at the end of consumer rebalance.\n" + "\tcurrent suspended active tasks: {}\n" + "\tcurrent suspended standby tasks: {}\n", streamThread.state, assignment, taskManager.suspendedActiveTaskIds(), taskManager.suspendedStandbyTaskIds()); if (streamThread.assignmentErrorCode.get() == StreamsPartitionAssignor.Error.INCOMPLETE_SOURCE_TOPIC_METADATA.code()) { log.error("Received error code - shutdown", streamThread.assignmentErrorCode.get()); streamThread.shutdown(); return; } final long start = time.milliseconds(); try { if (streamThread.setState(State.PARTITIONS_ASSIGNED) == null) { log.error("State transition from to PARTITIONS_ASSIGNED failed. " + "Will skip the task initialization", streamThread.state()); } else if (streamThread.assignmentErrorCode.get() != StreamsPartitionAssignor.Error.NONE.code()) { log.error("Encountered assignment error during partition assignment: {}. " + "Will skip the task initialization", streamThread.assignmentErrorCode); } else { log.debug("Creating tasks based on assignment."); taskManager.createTasks(assignment); } } catch (final Throwable t) { log.error( "Error caught during partition assignment, " + "will abort the current process and re-throw at the end of rebalance: {}", t ); streamThread.setRebalanceException(t); } finally { log.info("partition assignment took ms.\n" + "\tcurrent active tasks: {}\n" + "\tcurrent standby tasks: {}\n" + "\tprevious active tasks: {}\n", time.milliseconds() - start, taskManager.activeTaskIds(), taskManager.standbyTaskIds(), taskManager.prevActiveTaskIds()); } }

Target:
public void onPartitionsAssigned(final Collection<TopicPartition> assignment) { log.debug("at state {}: partitions assigned at the end of consumer rebalance.\n" + "\tcurrent suspended active tasks: {}\n" + "\tcurrent suspended standby tasks: {}\n", streamThread.state, assignment, taskManager.suspendedActiveTaskIds(), taskManager.suspendedStandbyTaskIds()); if (streamThread.assignmentErrorCode.get() == StreamsPartitionAssignor.Error.INCOMPLETE_SOURCE_TOPIC_METADATA.code()) { log.error("Received error code - shutdown", streamThread.assignmentErrorCode.get()); streamThread.shutdown(); return; } final long start = time.milliseconds(); try { if (streamThread.setState(State.PARTITIONS_ASSIGNED) == null) { log.debug( "Skipping task creation in rebalance because we are already in state.", streamThread.state() ); } else if (streamThread.assignmentErrorCode.get() != StreamsPartitionAssignor.Error.NONE.code()) { log.debug( "Encountered assignment error during partition assignment: {}. Skipping task initialization", streamThread.assignmentErrorCode ); } else { log.debug("Creating tasks based on assignment."); taskManager.createTasks(assignment); } } catch (final Throwable t) { log.error( "Error caught during partition assignment, " + "will abort the current process and re-throw at the end of rebalance", t); streamThread.setRebalanceException(t); } finally { log.info("partition assignment took ms.\n" + "\tcurrent active tasks: {}\n" + "\tcurrent standby tasks: {}\n" + "\tprevious active tasks: {}\n", time.milliseconds() - start, taskManager.activeTaskIds(), taskManager.standbyTaskIds(), taskManager.prevActiveTaskIds()); } }