@Test public void testSerializeToFile() throws IOException { try (ParallelRunner parallelRunner = new ParallelRunner(2, this.fs)) { WorkUnit workUnit1 = WorkUnit.createEmpty(); workUnit1.setProp("foo", "bar"); workUnit1.setProp("a", 10); parallelRunner.serializeToFile(workUnit1, new Path(this.outputPath, "wu1")); WorkUnit workUnit2 = WorkUnit.createEmpty(); workUnit2.setProp("foo", "baz"); workUnit2.setProp("b", 20); parallelRunner.serializeToFile(workUnit2, new Path(this.outputPath, "wu2")); } }
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)); }
ParallelRunner implements Closeable { 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)); } }
ParallelRunner implements Closeable { 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)); } ParallelRunner(int threads, FileSystem fs);  ParallelRunner(int threads, FileSystem fs, FailPolicy failPolicy); }
ParallelRunner implements Closeable { 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)); } ParallelRunner(int threads, FileSystem fs);  ParallelRunner(int threads, FileSystem fs, FailPolicy failPolicy); void serializeToFile(final T state, final Path outputFilePath); void deserializeFromFile(final T state, final Path inputFilePath); void deserializeFromSequenceFile(final Class<? extends Writable> keyClass,
      final Class<T> stateClass, final Path inputFilePath, final Collection<T> states, final boolean deleteAfter); void deletePath(final Path path, final boolean recursive); void renamePath(final Path src, final Path dst, final Optional<String> group); void movePath(final Path src, final FileSystem dstFs, final Path dst, final Optional<String> group); void movePath(final Path src, final FileSystem dstFs, final Path dst, final boolean overwrite,
      final Optional<String> group); void submitCallable(Callable<Void> callable, String name); void waitForTasks(long timeoutInMills); void waitForTasks(); @Override void close(); }
ParallelRunner implements Closeable { 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)); } ParallelRunner(int threads, FileSystem fs);  ParallelRunner(int threads, FileSystem fs, FailPolicy failPolicy); void serializeToFile(final T state, final Path outputFilePath); void deserializeFromFile(final T state, final Path inputFilePath); void deserializeFromSequenceFile(final Class<? extends Writable> keyClass,
      final Class<T> stateClass, final Path inputFilePath, final Collection<T> states, final boolean deleteAfter); void deletePath(final Path path, final boolean recursive); void renamePath(final Path src, final Path dst, final Optional<String> group); void movePath(final Path src, final FileSystem dstFs, final Path dst, final Optional<String> group); void movePath(final Path src, final FileSystem dstFs, final Path dst, final boolean overwrite,
      final Optional<String> group); void submitCallable(Callable<Void> callable, String name); void waitForTasks(long timeoutInMills); void waitForTasks(); @Override void close(); static final String PARALLEL_RUNNER_THREADS_KEY; static final int DEFAULT_PARALLEL_RUNNER_THREADS; }