protected Object readWithoutConversion(Object old, Schema expected, ResolvingDecoder in) throws IOException { switch (expected.getType()) { case RECORD: return readRecord(old, expected, in); case ENUM: return readEnum(expected, in); case ARRAY: return readArray(old, expected, in); case MAP: return readMap(old, expected, in); case UNION: return read(old, expected.getTypes().get(in.readIndex()), in); case FIXED: return readFixed(old, expected, in); case STRING: return readString(old, expected, in); case BYTES: return readBytes(old, expected, in); case INT: return readInt(old, expected, in); case LONG: return in.readLong(); case FLOAT: return in.readFloat(); case DOUBLE: return in.readDouble(); case BOOLEAN: return in.readBoolean(); case NULL: in.readNull(); return null; default: throw new AvroRuntimeException("Unknown type: " + expected); } }
protected Object readWithoutConversion(Object old, Schema expected, ResolvingDecoder in) throws IOException { switch (expected.getType()) { case RECORD: return readRecord(old, expected, in); case ENUM: return readEnum(expected, in); case ARRAY: return readArray(old, expected, in); case MAP: return readMap(old, expected, in); case UNION: return read(old, expected.getTypes().get(in.readIndex()), in); case FIXED: return readFixed(old, expected, in); case STRING: return readString(old, expected, in); case BYTES: return readBytes(old, expected, in); case INT: return readInt(old, expected, in); case LONG: return in.readLong(); case FLOAT: return in.readFloat(); case DOUBLE: return in.readDouble(); case BOOLEAN: return in.readBoolean(); case NULL: in.readNull(); return null; default: throw new AvroRuntimeException("Unknown type: " + expected); } }
this.match = org.apache.avro.ipc.HandshakeMatch.values()[in.readEnum()]; if (in.readIndex() != 1) { in.readNull(); this.serverProtocol = null; if (in.readIndex() != 1) { in.readNull(); this.serverHash = null; if (in.readIndex() != 1) { in.readNull(); this.meta = null; if (in.readIndex() != 1) { in.readNull(); this.serverProtocol = null; if (in.readIndex() != 1) { in.readNull(); this.serverHash = null; if (in.readIndex() != 1) { in.readNull(); this.meta = null;
if (in.readIndex() != 1) { in.readNull(); this.nullableString = null; if (in.readIndex() != 1) { in.readNull(); this.nullableLong = null; if (in.readIndex() != 1) { in.readNull(); this.nullableInt = null; if (in.readIndex() != 1) { in.readNull(); this.nullableMap = null; if (in.readIndex() != 1) { in.readNull(); this.nullableArray = null; if (in.readIndex() != 1) { in.readNull(); this.nullableRecord = null; if (in.readIndex() != 1) { in.readNull(); this.nullableEnum = null; switch (fieldOrder[i].pos()) {
@Override protected Object read(Object old, org.apache.avro.Schema expected, ResolvingDecoder in) throws IOException { if (expected.getType() != org.apache.avro.Schema.Type.UNION) { return super.read(old, expected, in); } // For Union type Schema tmpSchema = currentSchema; try { int idx = in.readIndex(); currentSchema = currentSchema.getUnionSchema(idx); return read(old, expected.getTypes().get(idx), in); } finally { currentSchema = tmpSchema; } }
@Override protected Object read(Object old, org.apache.avro.Schema expected, ResolvingDecoder in) throws IOException { if (expected.getType() != org.apache.avro.Schema.Type.UNION) { return super.read(old, expected, in); } // For Union type Schema tmpSchema = currentSchema; try { int idx = in.readIndex(); currentSchema = currentSchema.getUnionSchema(idx); return read(old, expected.getTypes().get(idx), in); } finally { currentSchema = tmpSchema; } }
protected Object readWithoutConversion(Object old, Schema expected, ResolvingDecoder in) throws IOException { switch (expected.getType()) { case RECORD: return readRecord(old, expected, in); case ENUM: return readEnum(expected, in); case ARRAY: return readArray(old, expected, in); case MAP: return readMap(old, expected, in); case UNION: return read(old, expected.getTypes().get(in.readIndex()), in); case FIXED: return readFixed(old, expected, in); case STRING: return readString(old, expected, in); case BYTES: return readBytes(old, expected, in); case INT: return readInt(old, expected, in); case LONG: return in.readLong(); case FLOAT: return in.readFloat(); case DOUBLE: return in.readDouble(); case BOOLEAN: return in.readBoolean(); case NULL: in.readNull(); return null; default: throw new AvroRuntimeException("Unknown type: " + expected); } }
/** Called to read data.*/ protected Object read(Object old, Schema expected, ResolvingDecoder in) throws IOException { switch (expected.getType()) { case RECORD: return readRecord(old, expected, in); case ENUM: return readEnum(expected, in); case ARRAY: return readArray(old, expected, in); case MAP: return readMap(old, expected, in); case UNION: return read(old, expected.getTypes().get(in.readIndex()), in); case FIXED: return readFixed(old, expected, in); case STRING: return readString(old, expected, in); case BYTES: return readBytes(old, in); case INT: return readInt(old, expected, in); case LONG: return in.readLong(); case FLOAT: return in.readFloat(); case DOUBLE: return in.readDouble(); case BOOLEAN: return in.readBoolean(); case NULL: in.readNull(); return null; default: throw new AvroRuntimeException("Unknown type: " + expected); } }
/** Called to read data.*/ protected Object read(Object old, Schema expected, ResolvingDecoder in) throws IOException { switch (expected.getType()) { case RECORD: return readRecord(old, expected, in); case ENUM: return readEnum(expected, in); case ARRAY: return readArray(old, expected, in); case MAP: return readMap(old, expected, in); case UNION: return read(old, expected.getTypes().get(in.readIndex()), in); case FIXED: return readFixed(old, expected, in); case STRING: return readString(old, expected, in); case BYTES: return readBytes(old, expected, in); case INT: return readInt(old, expected, in); case LONG: return in.readLong(); case FLOAT: return in.readFloat(); case DOUBLE: return in.readDouble(); case BOOLEAN: return in.readBoolean(); case NULL: in.readNull(); return null; default: throw new AvroRuntimeException("Unknown type: " + expected); } }
/** Called to read data.*/ protected Object read(Object old, Schema expected, ResolvingDecoder in) throws IOException { switch (expected.getType()) { case RECORD: return readRecord(old, expected, in); case ENUM: return readEnum(expected, in); case ARRAY: return readArray(old, expected, in); case MAP: return readMap(old, expected, in); case UNION: return read(old, expected.getTypes().get(in.readIndex()), in); case FIXED: return readFixed(old, expected, in); case STRING: return readString(old, expected, in); case BYTES: return readBytes(old, in); case INT: return readInt(old, expected, in); case LONG: return in.readLong(); case FLOAT: return in.readFloat(); case DOUBLE: return in.readDouble(); case BOOLEAN: return in.readBoolean(); case NULL: in.readNull(); return null; default: throw new AvroRuntimeException("Unknown type: " + expected); } }