/** Read a {@link Writable}, {@link String}, primitive type, or an array of * the preceding. */ public static Object readObject(DataInput in, Configuration conf) throws IOException { return readObject(in, null, conf); }
@Override public void readFields(DataInput in) throws IOException { readObject(in, this, this.conf); }
@Override @SuppressWarnings("unchecked") public void readFields(DataInput in) throws IOException { int length = in.readInt(); if (length == -1) this.value = null; else if (length == 0) { this.elementType = (Class<E>) ObjectWritable.loadClass(conf, WritableUtils.readString(in)); this.value = EnumSet.noneOf(this.elementType); } else { E first = (E) ObjectWritable.readObject(in, conf); this.value = (EnumSet<E>) EnumSet.of(first); for (int i = 1; i < length; i++) this.value.add((E) ObjectWritable.readObject(in, conf)); } }
@Override @SuppressWarnings("deprecation") public void readFields(DataInput in) throws IOException { rpcVersion = in.readLong(); declaringClassProtocolName = UTF8.readString(in); methodName = UTF8.readString(in); clientVersion = in.readLong(); clientMethodsHash = in.readInt(); parameters = new Object[in.readInt()]; parameterClasses = new Class[parameters.length]; ObjectWritable objectWritable = new ObjectWritable(); for (int i = 0; i < parameters.length; i++) { parameters[i] = ObjectWritable.readObject(in, objectWritable, this.conf); parameterClasses[i] = objectWritable.getDeclaredClass(); } }
instance = Array.newInstance(declaredClass.getComponentType(), length); for (int i = 0; i < length; i++) { Array.set(instance, i, readObject(in, conf));
/** Read a {@link Writable}, {@link String}, primitive type, or an array of * the preceding. */ public static Object readObject(DataInput in, Configuration conf) throws IOException { return readObject(in, null, conf); }
/** Read a {@link Writable}, {@link String}, primitive type, or an array of * the preceding. */ public static Object readObject(DataInput in, Configuration conf) throws IOException { return readObject(in, null, conf); }
/** Read a {@link Writable}, {@link String}, primitive type, or an array of * the preceding. */ public static Object readObject(DataInput in, Configuration conf) throws IOException { return readObject(in, null, conf); }
/** Read a {@link Writable}, {@link String}, primitive type, or an array of * the preceding. */ public static Object readObject(DataInput in, Configuration conf) throws IOException { return readObject(in, null, conf); }
/** Read a {@link Writable}, {@link String}, primitive type, or an array of * the preceding. */ public static Object readObject(DataInput in, Configuration conf) throws IOException { return readObject(in, null, conf); }
/** Read a {@link Writable}, {@link String}, primitive type, or an array of * the preceding. */ public static Object readObject(DataInput in, Configuration conf) throws IOException { return readObject(in, null, conf); }
@Override public void readFields(DataInput in) throws IOException { readObject(in, this, this.conf); }
private void processHeader() throws IOException { /* In the current version, it is just a ticket. * Later we could introduce a "ConnectionHeader" class. */ DataInputStream in = new DataInputStream(new ByteArrayInputStream(data.array())); ticket = (UserGroupInformation) ObjectWritable.readObject(in, conf); }
public void readFields(DataInput in) throws IOException { methodName = UTF8.readString(in); parameters = new Object[in.readInt()]; parameterClasses = new Class[parameters.length]; ObjectWritable objectWritable = new ObjectWritable(); for (int i = 0; i < parameters.length; i++) { parameters[i] = ObjectWritable.readObject(in, objectWritable, this.conf); parameterClasses[i] = objectWritable.getDeclaredClass(); } }
public void readFields(DataInput in) throws IOException { methodName = UTF8.readString(in); parameters = new Object[in.readInt()]; parameterClasses = new Class[parameters.length]; ObjectWritable objectWritable = new ObjectWritable(); for (int i = 0; i < parameters.length; i++) { parameters[i] = ObjectWritable.readObject(in, objectWritable, this.conf); parameterClasses[i] = objectWritable.getDeclaredClass(); } }
public void readFields(DataInput in) throws IOException { methodName = Text.readString(in); parameters = new Object[in.readInt()]; parameterClasses = new Class[parameters.length]; ObjectWritable objectWritable = new ObjectWritable(); for (int i = 0; i < parameters.length; i++) { parameters[i] = ObjectWritable .readObject(in, objectWritable, this.conf); parameterClasses[i] = objectWritable.getDeclaredClass(); } }
public void readFields(DataInput in) throws IOException { methodName = Text.readString(in); parameters = new Object[in.readInt()]; parameterClasses = new Class[parameters.length]; ObjectWritable objectWritable = new ObjectWritable(); for (int i = 0; i < parameters.length; i++) { parameters[i] = ObjectWritable .readObject(in, objectWritable, this.conf); parameterClasses[i] = objectWritable.getDeclaredClass(); } }
@SuppressWarnings("unchecked") public void testSerializeAndDeserializeNonEmpty() throws IOException { DataOutputBuffer out = new DataOutputBuffer(); ObjectWritable.writeObject(out, nonEmptyFlagWritable, nonEmptyFlagWritable .getClass(), null); DataInputBuffer in = new DataInputBuffer(); in.reset(out.getData(), out.getLength()); EnumSet<TestEnumSet> read = ((EnumSetWritable<TestEnumSet>) ObjectWritable .readObject(in, null)).get(); assertEquals(read, nonEmptyFlag); }
@SuppressWarnings("unchecked") public void testSerializeAndDeserializeNonEmpty() throws IOException { DataOutputBuffer out = new DataOutputBuffer(); ObjectWritable.writeObject(out, nonEmptyFlagWritable, nonEmptyFlagWritable .getClass(), null); DataInputBuffer in = new DataInputBuffer(); in.reset(out.getData(), out.getLength()); EnumSet<TestEnumSet> read = ((EnumSetWritable<TestEnumSet>) ObjectWritable .readObject(in, null)).get(); assertEquals(read, nonEmptyFlag); }
@SuppressWarnings("unchecked") public void testSerializeAndDeserializeNonEmpty() throws IOException { DataOutputBuffer out = new DataOutputBuffer(); ObjectWritable.writeObject(out, nonEmptyFlagWritable, nonEmptyFlagWritable .getClass(), null); DataInputBuffer in = new DataInputBuffer(); in.reset(out.getData(), out.getLength()); EnumSet<TestEnumSet> read = ((EnumSetWritable<TestEnumSet>) ObjectWritable .readObject(in, null)).get(); assertEquals(read, nonEmptyFlag); }