public <T extends State> void serializeToFile(final T state, final Path outputFilePath) {
    // Use a Callable with a Void return type to allow exceptions to be thrown
    this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() {

      @Override
      public Void call() throws Exception {
        SerializationUtils.serializeState(ParallelRunner.this.fs, outputFilePath, state);
        return null;
      }
    }), "Serialize state to " + outputFilePath));
  }
public < T extends State > void serializeToFile ( final T state , final Path outputFilePath ) { this . futures . add ( new NamedFuture ( this . executor . submit ( new Callable < Void > ( ) { @ Override public Void call ( ) throws Exception { SerializationUtils . serializeState ( ParallelRunner . this . fs , outputFilePath , state ) ; return null ; } } ) , "Serialize state to " + outputFilePath ) ) ; }
Serialize a {@link State} object into a file.

<p>
This method submits a task to serialize the {@link State} object and returns immediately
after the task is submitted.
</p>

@param state the {@link State} object to be serialized
@param outputFilePath the file to write the serialized {@link State} object to
@param <T> the {@link State} object type