下面列出了怎么用org.apache.hadoop.io.TestGenericWritable.Baz的API类实例代码及写法,或者点击链接到github查看源代码。
@Test
public void testWritableConfigurable() throws Exception {
//set the configuration parameter
conf.set(CONF_TEST_KEY, CONF_TEST_VALUE);
//reuse TestGenericWritable inner classes to test
//writables that also implement Configurable.
FooGenericWritable generic = new FooGenericWritable();
generic.setConf(conf);
Baz baz = new Baz();
generic.set(baz);
Baz result = SerializationTestUtil.testSerialization(conf, baz);
assertEquals(baz, result);
assertNotNull(result.getConf());
}
@Test
public void testWritableConfigurable() throws Exception {
//set the configuration parameter
conf.set(CONF_TEST_KEY, CONF_TEST_VALUE);
//reuse TestGenericWritable inner classes to test
//writables that also implement Configurable.
FooGenericWritable generic = new FooGenericWritable();
generic.setConf(conf);
Baz baz = new Baz();
generic.set(baz);
Baz result = SerializationTestUtil.testSerialization(conf, baz);
assertEquals(baz, result);
assertNotNull(result.getConf());
}
public void testWritableConfigurable() throws Exception {
//set the configuration parameter
conf.set(CONF_TEST_KEY, CONF_TEST_VALUE);
//reuse TestGenericWritable inner classes to test
//writables that also implement Configurable.
FooGenericWritable generic = new FooGenericWritable();
generic.setConf(conf);
Baz baz = new Baz();
generic.set(baz);
Baz result = testSerialization(conf, baz);
assertNotNull(result.getConf());
}
public void testWritableConfigurable() throws Exception {
//set the configuration parameter
conf.set(CONF_TEST_KEY, CONF_TEST_VALUE);
//reuse TestGenericWritable inner classes to test
//writables that also implement Configurable.
FooGenericWritable generic = new FooGenericWritable();
generic.setConf(conf);
Baz baz = new Baz();
generic.set(baz);
Baz result = testSerialization(conf, baz);
assertNotNull(result.getConf());
}