@Override
    public void recordRestoration(final Time time, final long numRecords, final boolean initRemaining) {
        if (initRemaining) {
            maybeRecordSensor(numRecords, time, restoreRemainingSensor);
        } else {
            maybeRecordSensor(numRecords, time, restoreSensor);
            maybeRecordSensor(-1 * numRecords, time, restoreRemainingSensor);
        }
    }
A StreamTask is associated with a {@link AbstractPartitionGroup}, and is assigned to a StreamThread for processing.
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java