public static Runnable writeSnapshotCompletion(String path, String nonce, int hostId, final VoltLogger logger, boolean isTruncationSnapshot) throws IOException {

        final File f = new VoltFile(path, constructCompletionFilenameForNonce(nonce, hostId));
        if (f.exists()) {
            if (!f.delete()) {
                if (isTruncationSnapshot) {
                    VoltDB.crashLocalVoltDB("Unexpected exception while attempting to remove old Completion file for truncation snapshot");
                }
                throw new IOException("Failed to replace existing " + f.getName());
            }
        }
        return new Runnable() {
            @Override
            public void run() {
                try {
                    f.createNewFile();
                } catch (IOException e) {
                    if (isTruncationSnapshot) {
                        VoltDB.crashLocalVoltDB("Unexpected exception while attempting to create Completion file for truncation snapshot",
                                true, e);
                    }
                    throw new RuntimeException("Failed to create .complete file for " + f.getName(), e);
                }
            }
        };
    }
public static Runnable writeSnapshotCompletion ( String path , String nonce , int hostId , final VoltLogger logger , boolean isTruncationSnapshot ) throws IOException { final File f = new VoltFile ( path , constructCompletionFilenameForNonce ( nonce , hostId ) ) ; if ( f . exists ( ) ) { if ( ! f . delete ( ) ) { if ( isTruncationSnapshot ) { VoltDB . crashLocalVoltDB ( "Unexpected exception while attempting to remove old Completion file for truncation snapshot" ) ; } throw new IOException ( "Failed to replace existing " + f . getName ( ) ) ; } } return new Runnable ( ) { @ Override public void run ( ) { try { f . createNewFile ( ) ; } catch ( IOException e ) { if ( isTruncationSnapshot ) { VoltDB . crashLocalVoltDB ( "Unexpected exception while attempting to create Completion file for truncation snapshot" , true , e ) ; } throw new RuntimeException ( "Failed to create .complete file for " + f . getName ( ) , e ) ; } } } ; }
Write the .complete file for finished snapshot