@Test(dependsOnMethods = "testSerializeState") public void testDeserializeState() throws IOException { WorkUnit workUnit1 = WorkUnit.createEmpty(); WorkUnit workUnit2 = WorkUnit.createEmpty(); SerializationUtils.deserializeState(this.fs, new Path(this.outputPath, "wu1"), workUnit1); SerializationUtils.deserializeState(this.fs, new Path(this.outputPath, "wu2"), workUnit2); 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 static <T extends State> void deserializeState(FileSystem fs, Path jobStateFilePath, T state) throws IOException { try (InputStream is = fs.open(jobStateFilePath)) { deserializeStateFromInputStream(is, state); } }
SerializationUtils { public static <T extends State> void deserializeState(FileSystem fs, Path jobStateFilePath, T state) throws IOException { try (InputStream is = fs.open(jobStateFilePath)) { deserializeStateFromInputStream(is, state); } } }
SerializationUtils { public static <T extends State> void deserializeState(FileSystem fs, Path jobStateFilePath, T state) throws IOException { try (InputStream is = fs.open(jobStateFilePath)) { deserializeStateFromInputStream(is, state); } }  }
SerializationUtils { public static <T extends State> void deserializeState(FileSystem fs, Path jobStateFilePath, T state) throws IOException { try (InputStream is = fs.open(jobStateFilePath)) { deserializeStateFromInputStream(is, state); } }  static String serialize(T obj); static String serialize(T obj, BaseEncoding enc); static byte[] serializeIntoBytes(T obj); static T deserialize(String serialized, Class<T> clazz); static T deserialize(String serialized, Class<T> clazz, BaseEncoding enc); static T deserializeFromBytes(byte[] serialized, Class<T> clazz); static void serializeState(FileSystem fs, Path jobStateFilePath, T state); static void serializeState(FileSystem fs, Path jobStateFilePath, T state, short replication); static void deserializeState(FileSystem fs, Path jobStateFilePath, T state); static void deserializeStateFromInputStream(InputStream is, T state); }
SerializationUtils { public static <T extends State> void deserializeState(FileSystem fs, Path jobStateFilePath, T state) throws IOException { try (InputStream is = fs.open(jobStateFilePath)) { deserializeStateFromInputStream(is, state); } }  static String serialize(T obj); static String serialize(T obj, BaseEncoding enc); static byte[] serializeIntoBytes(T obj); static T deserialize(String serialized, Class<T> clazz); static T deserialize(String serialized, Class<T> clazz, BaseEncoding enc); static T deserializeFromBytes(byte[] serialized, Class<T> clazz); static void serializeState(FileSystem fs, Path jobStateFilePath, T state); static void serializeState(FileSystem fs, Path jobStateFilePath, T state, short replication); static void deserializeState(FileSystem fs, Path jobStateFilePath, T state); static void deserializeStateFromInputStream(InputStream is, T state);  }