protected void updateSnapshot()

in src/com/amazon/kinesis/streaming/agent/tailing/SourceFileTracker.java [426:444]


    protected void updateSnapshot(TrackedFileList newSnapshot, int currentFileIndex) throws IOException {
        if(LOGGER.isTraceEnabled() && newSnapshot != currentSnapshot) { // identity intended
            LOGGER.trace("Updating file snapshot:\n\tCurrent File Index: {}\n\tExisting snapshot:\n\t\t{}\n\tNew snapshot:\n\t\t{}",
                    currentFileIndex,
                    currentSnapshot == null || currentSnapshot.isEmpty() ? "<none>" : Joiner.on("\n\t\t").join(currentSnapshot),
                    newSnapshot == null || newSnapshot.isEmpty() ? "<none>" : Joiner.on("\n\t\t").join(newSnapshot));
        }
        TrackedFileList newPendingFiles = newSnapshot.subList(0, currentFileIndex);
        if(LOGGER.isTraceEnabled()) {
            LOGGER.trace("Updating pendig files:\n\tCurrent File Index: {}\n\tExisting pending:\n\t\t{}\n\tNew pending:\n\t\t{}",
                    currentFileIndex,
                    pendingFiles == null || pendingFiles.isEmpty() ? "<none>" : Joiner.on("\n\t\t").join(pendingFiles),
                    newPendingFiles == null || newPendingFiles.isEmpty() ? "<none>" : Joiner.on("\n\t\t").join(newPendingFiles));
        }

        // finally, update the files
        this.currentSnapshot = newSnapshot;
        this.pendingFiles = newPendingFiles;
    }