List of usage examples for org.apache.hadoop.io WritableFactory newInstance
Writable newInstance();
From source file:com.taobao.adfs.distributed.rpc.WritableFactories.java
License:Apache License
/** Create a new instance of a class with a defined factory. */ public static Writable newInstance(Class<? extends Writable> c, Configuration conf) { WritableFactory factory = WritableFactories.getFactory(c); if (factory != null) { Writable result = factory.newInstance(); if (result instanceof Configurable) { ((Configurable) result).setConf(conf); }/*from w w w . j av a 2s.co m*/ return result; } else { return ReflectionUtils.newInstance(c, conf); } }