/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject */ public Instance retrieve(SeedObject hv) throws AvroSerdeException { return retrieve(hv, null); }
return typeInfoCache.retrieve(schema, seenSchemas);
/** * Convert an Avro Schema into an equivalent Hive TypeInfo. * @param schema to record. Must be of record type. * @return TypeInfo matching the Avro schema * @throws AvroSerdeException for any problems during conversion. */ public static TypeInfo generateTypeInfo(Schema schema) throws AvroSerdeException { return typeInfoCache.retrieve(schema); }
/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject */ public Instance retrieve(SeedObject hv) throws AvroSerdeException { return retrieve(hv, null); }
public V retrieve(K hv) throws AvroSerdeException { return retrieve(hv, null); }
/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject */ public Instance retrieve(SeedObject hv) throws AvroSerdeException { return retrieve(hv, null); }
/** * Retrieve (or create if it doesn't exist) the correct Instance for this * SeedObject */ public Instance retrieve(SeedObject hv) throws AvroSerdeException { return retrieve(hv, null); }
public GenericRecord reencode(GenericRecord r, Schema readerSchema) throws AvroSerdeException { baos.reset(); BinaryEncoder be = EncoderFactory.get().directBinaryEncoder(baos, null); gdw.setSchema(r.getSchema()); try { gdw.write(r, be); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); binaryDecoder = DecoderFactory.defaultFactory().createBinaryDecoder(bais, binaryDecoder); ReaderWriterSchemaPair pair = new ReaderWriterSchemaPair(r.getSchema(), readerSchema); GenericDatumReader<GenericRecord> gdr = gdrCache.retrieve(pair); return gdr.read(r, binaryDecoder); } catch (IOException e) { throw new AvroSerdeException("Exception trying to re-encode record to new schema", e); } } }
return typeInfoCache.retrieve(schema, seenSchemas);
return typeInfoCache.retrieve(schema, seenSchemas);
return typeInfoCache.retrieve(schema, seenSchemas);
return typeInfoCache.retrieve(schema, seenSchemas);