@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, ClusteringPolicy.class); }
@Override public void readFields(DataInput in) throws IOException { wrapped = PolymorphicWritable.read(in, Mapping.class); } }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, ClusteringPolicy.class); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, Cluster.class); }
@Override public void readFields(DataInput in) throws IOException { wrapped = PolymorphicWritable.read(in, Mapping.class); } }
@Override public void readFields(DataInput in) throws IOException { wrapped = PolymorphicWritable.read(in, Mapping.class); } }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, Cluster.class); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, Cluster.class); }
@Override public void readFields(DataInput in) throws IOException { value = PolymorphicWritable.read(in, ClusteringPolicy.class); }
public static <T extends Writable> T readBinary(InputStream in, Class<T> clazz) throws IOException { DataInput dataIn = new DataInputStream(in); try { return PolymorphicWritable.read(dataIn, clazz); } finally { Closeables.close(in, false); } }
public static <T extends Writable> T readBinary(InputStream in, Class<T> clazz) throws IOException { DataInput dataIn = new DataInputStream(in); try { return PolymorphicWritable.read(dataIn, clazz); } finally { Closeables.close(in, false); } }
public static <T extends Writable> T readBinary(InputStream in, Class<T> clazz) throws IOException { DataInput dataIn = new DataInputStream(in); try { return PolymorphicWritable.read(dataIn, clazz); } finally { Closeables.close(in, false); } }
@Override public void readFields(DataInput input) throws IOException { setThreadCount(input.readInt()); int n = input.readInt(); population = Lists.newArrayList(); for (int i = 0; i < n; i++) { State<T, U> state = (State<T, U>) PolymorphicWritable.read(input, State.class); population.add(state); } } }
@Override public void readFields(DataInput input) throws IOException { setThreadCount(input.readInt()); int n = input.readInt(); population = new ArrayList<>(); for (int i = 0; i < n; i++) { State<T, U> state = (State<T, U>) PolymorphicWritable.read(input, State.class); population.add(state); } } }
@Override public void readFields(DataInput in) throws IOException { int n = in.readInt(); map.clear(); for (int i = 0; i < n; i++) { String key = in.readUTF(); map.put(key, PolymorphicWritable.read(in, OnlineAuc.class)); } policy = GlobalOnlineAuc.ReplacementPolicy.values()[in.readInt()]; windowSize = in.readInt(); } }
public void readFields(DataInput dataInput) throws IOException { int n = dataInput.readInt(); for (int i = 0; i < n; i++) { Text tmp = new Text(); tmp.readFields(dataInput); categories.add(tmp.toString()); } model = PolymorphicWritable.read(dataInput, OnlineLogisticRegression.class); }
@Override public void readFields(DataInput in) throws IOException { int n = in.readInt(); map.clear(); for (int i = 0; i < n; i++) { String key = in.readUTF(); map.put(key, PolymorphicWritable.read(in, OnlineAuc.class)); } policy = GlobalOnlineAuc.ReplacementPolicy.values()[in.readInt()]; windowSize = in.readInt(); } }
@Override public void readFields(DataInput input) throws IOException { setThreadCount(input.readInt()); int n = input.readInt(); population = Lists.newArrayList(); for (int i = 0; i < n; i++) { State<T, U> state = (State<T, U>) PolymorphicWritable.read(input, State.class); population.add(state); } } }
@Override public void readFields(DataInput in) throws IOException { int n = in.readInt(); map.clear(); for (int i = 0; i < n; i++) { String key = in.readUTF(); map.put(key, PolymorphicWritable.read(in, OnlineAuc.class)); } policy = GlobalOnlineAuc.ReplacementPolicy.values()[in.readInt()]; windowSize = in.readInt(); } }
private static <T extends Writable> T roundTrip(T m, Class<T> clazz) throws IOException { ByteArrayOutputStream buf = new ByteArrayOutputStream(1000); DataOutputStream dos = new DataOutputStream(buf); try { PolymorphicWritable.write(dos, m); } finally { Closeables.close(dos, false); } return PolymorphicWritable.read(new DataInputStream(new ByteArrayInputStream(buf.toByteArray())), clazz); }