@Override public void readFields(DataInput in) throws IOException { daysSinceEpoch = WritableUtils.readVInt(in); }
/** */ @Override public void readFields(DataInput in) throws IOException { keyId = WritableUtils.readVInt(in); expiryDate = WritableUtils.readVLong(in); int len = WritableUtils.readVIntInRange(in, -1, MAX_KEY_LEN); if (len == -1) { keyBytes = null; } else { keyBytes = new byte[len]; in.readFully(keyBytes); } }
private static byte[] readBytes(DataInput in) throws IOException { int size = WritableUtils.readVInt(in); byte[] result = new byte[size]; in.readFully(result, 0, size); return result; }
@Override public void readFields(DataInput in) throws IOException { value = WritableUtils.readVInt(in); }
@HiveDecimalWritableVersionV1 @Override public void readFields(DataInput in) throws IOException { scale = WritableUtils.readVInt(in); int byteArrayLen = WritableUtils.readVInt(in); if (internalStorage.length != byteArrayLen) { internalStorage = new byte[byteArrayLen]; } in.readFully(internalStorage); }
private static List<String> readStringArray(DataInput in) throws IOException { int count = WritableUtils.readVInt(in); if (count == 0) { return null; } List<String> values = Lists.newArrayListWithCapacity(count); for (int i = 0; i < count; i++) { values.add(readString(in)); } return values; }
public static DelegationTokenInformation decodeDelegationTokenInformation(byte[] tokenBytes) throws IOException { DataInputStream in = new DataInputStream(new ByteArrayInputStream(tokenBytes)); DelegationTokenInformation token = new DelegationTokenInformation(0, null); int len = WritableUtils.readVInt(in); token.password = new byte[len]; in.readFully(token.password); token.renewDate = in.readLong(); return token; }
public static DelegationTokenInformation decodeDelegationTokenInformation(byte[] tokenBytes) throws IOException { DataInputStream in = new DataInputStream(new ByteArrayInputStream(tokenBytes)); DelegationTokenInformation token = new DelegationTokenInformation(0, null); int len = WritableUtils.readVInt(in); token.password = new byte[len]; in.readFully(token.password); token.renewDate = in.readLong(); return token; }
@Override public void readFields(DataInput in) throws IOException { // read totalMonths from DataInput set(WritableUtils.readVInt(in)); }
@Override public void readFields(DataInput in) throws IOException { date.setTimeInDays(WritableUtils.readVInt(in)); }
@Override public void readFields(DataInput in) throws IOException { id = WritableUtils.readVInt(in); expirationDate = WritableUtils.readVLong(in); int keyLength = WritableUtils.readVInt(in); if (keyLength < 0) { secret = null; } else { byte[] keyBytes = new byte[keyLength]; in.readFully(keyBytes); secret = AuthenticationTokenSecretManager.createSecretKey(keyBytes); } } }
public void readFields(DataInput in, int maxLength) throws IOException { int newLength = WritableUtils.readVInt(in); if (newLength < 0) { throw new IOException("tried to deserialize " + newLength + " bytes of data! newLength must be non-negative."); } else if (newLength >= maxLength) { throw new IOException("tried to deserialize " + newLength + " bytes of data, but maxLength = " + maxLength); } readWithKnownLength(in, newLength); }
/** Skips over one Text in the input. */ public static void skip(DataInput in) throws IOException { int length = WritableUtils.readVInt(in); WritableUtils.skipFully(in, length); }
/** deserialize */ @Override public void readFields(DataInput in) throws IOException { int newLength = WritableUtils.readVInt(in); readWithKnownLength(in, newLength); }
/** * Read byte-array written with a WritableableUtils.vint prefix. * @param in Input to read from. * @return byte array read off <code>in</code> * @throws IOException e */ public static byte [] readByteArray(final DataInput in) throws IOException { int len = WritableUtils.readVInt(in); if (len < 0) { throw new NegativeArraySizeException(Integer.toString(len)); } byte [] result = new byte[len]; in.readFully(result, 0, len); return result; }
private static List<Permission> readWritableUserPermission(DataInput in, Configuration conf) throws IOException, ClassNotFoundException { assert WritableUtils.readVInt(in) == LIST_CODE; int length = in.readInt(); List<Permission> list = new ArrayList<>(length); for (int i = 0; i < length; i++) { assert WritableUtils.readVInt(in) == WRITABLE_CODE; assert WritableUtils.readVInt(in) == WRITABLE_NOT_ENCODED; String className = Text.readString(in); Class<? extends Writable> clazz = conf.getClassByName(className).asSubclass(Writable.class); Writable instance = WritableFactories.newInstance(clazz, conf); instance.readFields(in); list.add((Permission) instance); } return list; }
@Override public void readFields(DataInput in) throws IOException { // read totalSeconds, nanos from DataInput set(WritableUtils.readVLong(in), WritableUtils.readVInt(in)); }
@Override public void readFields(DataInput in) throws IOException { clear(); int size = WritableUtils.readVInt(in); for(int i=0; i < size; ++i) { String key = org.apache.hadoop.io.Text.readString(in); String value = org.apache.hadoop.io.Text.readString(in); set(key, value); String sources[] = WritableUtils.readCompressedStringArray(in); if(sources != null) { updatingResource.put(key, sources); } } }
@Override public void readFields(DataInput in) throws IOException { clear(); int size = WritableUtils.readVInt(in); for(int i=0; i < size; ++i) { String key = org.apache.hadoop.io.Text.readString(in); String value = org.apache.hadoop.io.Text.readString(in); set(key, value); String sources[] = WritableUtils.readCompressedStringArray(in); if (sources != null) { putIntoUpdatingResource(key, sources); } } }
@Override public void readFields(DataInput in) throws IOException { clear(); int size = WritableUtils.readVInt(in); for(int i=0; i < size; ++i) { String key = org.apache.hadoop.io.Text.readString(in); String value = org.apache.hadoop.io.Text.readString(in); set(key, value); String sources[] = WritableUtils.readCompressedStringArray(in); if (sources != null) { putIntoUpdatingResource(key, sources); } } }