Code review comment: We moved this part to the mailing list because it pertains to the design and the FLIP-150 that hasn't been updated and finalized.

Code under review:
private void switchEnumerator() {

        Object enumeratorState = null;
        if (currentEnumerator != null) {
            try {
                enumeratorState = currentEnumerator.snapshotState(-1);
                currentEnumerator.close();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            currentEnumerator = null;
            currentSourceIndex++;
        }

        SplitEnumeratorContextProxy delegatingContext =
                new SplitEnumeratorContextProxy(currentSourceIndex, context, assignments);
        Source<?, ? extends SourceSplit, Object> source =
                (Source) sourceChain.sources.get(currentSourceIndex).f0;
        HybridSource.CheckpointConverter<Object, Object> converter =
                (HybridSource.CheckpointConverter) sourceChain.sources.get(currentSourceIndex).f1;
        try {
            if (converter != null) {
                currentEnumerator =
                        source.restoreEnumerator(
                                delegatingContext, converter.apply(enumeratorState));
            } else {
                currentEnumerator = source.createEnumerator(delegatingContext);
            }
        } catch (Exception e) {
            throw new RuntimeException(
                    "Failed to create enumerator for sourceIndex=" + currentSourceIndex, e);
        }
        LOG.info("Starting enumerator for sourceIndex={}", currentSourceIndex);
        currentEnumerator.start();
    }

Line commented on: enumeratorState = currentEnumerator.snapshotState(-1);

Revised code:
private void switchEnumerator() {

        SplitEnumerator<SourceSplit, Object> previousEnumerator = currentEnumerator;
        if (currentEnumerator != null) {
            try {
                currentEnumerator.close();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            currentEnumerator = null;
            currentSourceIndex++;
        }

        HybridSource.SourceSwitchContext<?> switchContext =
                new HybridSource.SourceSwitchContext<Object>() {
                    @Override
                    public Object getPreviousEnumerator() {
                        return previousEnumerator;
                    }
                };

        Source<?, ? extends SourceSplit, Object> source =
                switchedSources.computeIfAbsent(
                        currentSourceIndex,
                        k -> {
                            return sources.get(currentSourceIndex).factory.create(switchContext);
                        });
        switchedSources.put(currentSourceIndex, source);
        SplitEnumeratorContextProxy delegatingContext =
                new SplitEnumeratorContextProxy(currentSourceIndex, context, readerSourceIndex);
        try {
            if (restoredEnumeratorState == null) {
                currentEnumerator = source.createEnumerator(delegatingContext);
            } else {
                LOG.info("Restoring enumerator for sourceIndex={}", currentSourceIndex);
                currentEnumerator =
                        source.restoreEnumerator(delegatingContext, restoredEnumeratorState);
                restoredEnumeratorState = null;
            }
        } catch (Exception e) {
            throw new RuntimeException(
                    "Failed to create enumerator for sourceIndex=" + currentSourceIndex, e);
        }
        LOG.info("Starting enumerator for sourceIndex={}", currentSourceIndex);
        currentEnumerator.start();
    }