hollow/src/main/java/com/netflix/hollow/core/write/HollowBlobWriter.java
public void writeSnapshot(OutputStream os) throws IOException {
        stateEngine.prepareForWrite();

        DataOutputStream dos = new DataOutputStream(os);
        writeHeader(dos, stateEngine.getSchemas(), false);

        VarInt.writeVInt(dos, stateEngine.getOrderedTypeStates().size());

        SimultaneousExecutor executor = new SimultaneousExecutor(getClass(), "write-snapshot");

        for(final HollowTypeWriteState typeState : stateEngine.getOrderedTypeStates()) {
            executor.execute(new Runnable() {
                public void run() {
                    typeState.calculateSnapshot();
                }
            });
        }

        try {
            executor.awaitSuccessfulCompletion();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        for(HollowTypeWriteState typeState : stateEngine.getOrderedTypeStates()) {
            HollowSchema schema = typeState.getSchema();
            schema.writeTo(dos);

            writeNumShards(dos, typeState.getNumShards());

            typeState.writeSnapshot(dos);
        }
        os.flush();
    }
public void writeSnapshot(OutputStream os) throws IOException {
        stateEngine.prepareForWrite();

        DataOutputStream dos = new DataOutputStream(os);
        writeHeader(dos, stateEngine.getSchemas(), false);

        VarInt.writeVInt(dos, stateEngine.getOrderedTypeStates().size());

        SimultaneousExecutor executor = new SimultaneousExecutor(getClass(), "write-snapshot");

        for(final HollowTypeWriteState typeState : stateEngine.getOrderedTypeStates()) {
            executor.execute(new Runnable() {
                public void run() {
                    typeState.calculateSnapshot();
                }
            });
        }

        try {
            executor.awaitSuccessfulCompletion();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        for(HollowTypeWriteState typeState : stateEngine.getOrderedTypeStates()) {
            HollowSchema schema = typeState.getSchema();
            schema.writeTo(dos);

            writeNumShards(dos, typeState.getNumShards());

            typeState.writeSnapshot(dos);
        }
        os.flush();
    }
public void writeSnapshot ( OutputStream os ) throws IOException { stateEngine . prepareForWrite ( ) ; DataOutputStream dos = new DataOutputStream ( os ) ; writeHeader ( dos , stateEngine . getSchemas ( ) , false ) ; VarInt . writeVInt ( dos , stateEngine . getOrderedTypeStates ( ) . size ( ) ) ; SimultaneousExecutor executor = new SimultaneousExecutor ( getClass ( ) , "write-snapshot" ) ; for ( final HollowTypeWriteState typeState : stateEngine . getOrderedTypeStates ( ) ) { executor . execute ( new Runnable ( ) { public void run ( ) { typeState . calculateSnapshot ( ) ; } } ) ; } try { executor . awaitSuccessfulCompletion ( ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } for ( HollowTypeWriteState typeState : stateEngine . getOrderedTypeStates ( ) ) { HollowSchema schema = typeState . getSchema ( ) ; schema . writeTo ( dos ) ; writeNumShards ( dos , typeState . getNumShards ( ) ) ; typeState . writeSnapshot ( dos ) ; } os . flush ( ) ; }
Write the current state as a snapshot blob.
@param os the output stream to write the snapshot blob
@throws IOException if the snapshot blob could not be written
Write the current state as a snapshot blob .