@Test(dependsOnMethods = "testSerializeToFile") public void testDeserializeFromFile() throws IOException { WorkUnit workUnit1 = WorkUnit.createEmpty(); WorkUnit workUnit2 = WorkUnit.createEmpty(); try (ParallelRunner parallelRunner = new ParallelRunner(2, this.fs)) { parallelRunner.deserializeFromFile(workUnit1, new Path(this.outputPath, "wu1")); parallelRunner.deserializeFromFile(workUnit2, new Path(this.outputPath, "wu2")); } Assert.assertEquals(workUnit1.getPropertyNames().size(), 2); Assert.assertEquals(workUnit1.getProp("foo"), "bar"); Assert.assertEquals(workUnit1.getPropAsInt("a"), 10); Assert.assertEquals(workUnit2.getPropertyNames().size(), 2); Assert.assertEquals(workUnit2.getProp("foo"), "baz"); Assert.assertEquals(workUnit2.getPropAsInt("b"), 20); }
public <T extends State> void deserializeFromFile(final T state, final Path inputFilePath) { this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { SerializationUtils.deserializeState(ParallelRunner.this.fs, inputFilePath, state); return null; } }), "Deserialize state from " + inputFilePath)); }
ParallelRunner implements Closeable { public <T extends State> void deserializeFromFile(final T state, final Path inputFilePath) { this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { SerializationUtils.deserializeState(ParallelRunner.this.fs, inputFilePath, state); return null; } }), "Deserialize state from " + inputFilePath)); } }
ParallelRunner implements Closeable { public <T extends State> void deserializeFromFile(final T state, final Path inputFilePath) { this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { SerializationUtils.deserializeState(ParallelRunner.this.fs, inputFilePath, state); return null; } }), "Deserialize state from " + inputFilePath)); } ParallelRunner(int threads, FileSystem fs);  ParallelRunner(int threads, FileSystem fs, FailPolicy failPolicy); }
ParallelRunner implements Closeable { public <T extends State> void deserializeFromFile(final T state, final Path inputFilePath) { this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { SerializationUtils.deserializeState(ParallelRunner.this.fs, inputFilePath, state); return null; } }), "Deserialize state from " + inputFilePath)); } 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 deserializeFromFile(final T state, final Path inputFilePath) { this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { SerializationUtils.deserializeState(ParallelRunner.this.fs, inputFilePath, state); return null; } }), "Deserialize state from " + inputFilePath)); } 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; }