test_class.declarator: LOG = LoggerFactory.getLogger(TestKijiCellRewriter.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(TestKijiCellRewriter.class);
test_class.type: Logger
test_class.var_name: LOG
test_class.declarator: LAYOUT_TEST1 =
        "org/kiji/mapreduce/layout/org.kiji.mapreduce.pivot.TestKijiCellRewriter.test1.json"
test_class.modifier: private static final
test_class.original_string: private static final String LAYOUT_TEST1 =
        "org/kiji/mapreduce/layout/org.kiji.mapreduce.pivot.TestKijiCellRewriter.test1.json";
test_class.type: String
test_class.var_name: LAYOUT_TEST1
test_class.declarator: LAYOUT_TEST2 =
        "org/kiji/mapreduce/layout/org.kiji.mapreduce.pivot.TestKijiCellRewriter.test2.json"
test_class.modifier: private static final
test_class.original_string: private static final String LAYOUT_TEST2 =
        "org/kiji/mapreduce/layout/org.kiji.mapreduce.pivot.TestKijiCellRewriter.test2.json";
test_class.type: String
test_class.var_name: LAYOUT_TEST2
test_class.file: kiji-mapreduce/src/test/java/org/kiji/mapreduce/pivot/TestKijiCellRewriter.java
test_class.identifier: TestKijiCellRewriter
test_class.superclass: extends KijiClientTest
test_case.body: @Test
    public void testConvertAvro() throws Exception {
      final Schema intSchema = Schema.create(Schema.Type.INT);
      final Schema longSchema = Schema.create(Schema.Type.LONG);
      final DecodedCell<Object> original = new DecodedCell<Object>(intSchema, 1);
      Assert.assertEquals(1L, KijiCellRewriter.convertAvro(original, longSchema).getData());
    }
test_case.class_method_signature: TestKijiCellRewriter.testConvertAvro()
test_case.full_signature: @Test public void testConvertAvro()
test_case.identifier: testConvertAvro
test_case.invocations: create create assertEquals getData convertAvro
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testConvertAvro()
focal_class.declarator: LOG = LoggerFactory.getLogger(KijiCellRewriter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(KijiCellRewriter.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: mColumn = null
focal_class.modifier: private
focal_class.original_string: private KijiColumnName mColumn = null;
focal_class.type: KijiColumnName
focal_class.var_name: mColumn
focal_class.declarator: mRules = null
focal_class.modifier: private
focal_class.original_string: private Map<Schema, Schema> mRules = null;
focal_class.type: Map<Schema, Schema>
focal_class.var_name: mRules
focal_class.file: kiji-mapreduce/src/main/java/org/kiji/mapreduce/pivot/KijiCellRewriter.java
focal_class.identifier: KijiCellRewriter
focal_class.class_method_signature: KijiCellRewriter.getSpecFromConf(final Configuration conf)
focal_class.full_signature: private static CellRewriteSpec getSpecFromConf(final Configuration conf)
focal_class.identifier: getSpecFromConf
focal_class.modifiers: private static
focal_class.parameters: (final Configuration conf)
focal_class.return: CellRewriteSpec
focal_class.signature: CellRewriteSpec getSpecFromConf(final Configuration conf)
focal_class.class_method_signature: KijiCellRewriter.getDataRequest()
focal_class.full_signature: @Override public KijiDataRequest getDataRequest()
focal_class.identifier: getDataRequest
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: KijiDataRequest
focal_class.signature: KijiDataRequest getDataRequest()
focal_class.class_method_signature: KijiCellRewriter.setup(KijiContext context)
focal_class.full_signature: @Override public void setup(KijiContext context)
focal_class.identifier: setup
focal_class.modifiers: @Override public
focal_class.parameters: (KijiContext context)
focal_class.return: void
focal_class.signature: void setup(KijiContext context)
focal_class.class_method_signature: KijiCellRewriter.produce(final KijiRowData row, final KijiTableContext context)
focal_class.full_signature: @Override public void produce(final KijiRowData row, final KijiTableContext context)
focal_class.identifier: produce
focal_class.modifiers: @Override public
focal_class.parameters: (final KijiRowData row, final KijiTableContext context)
focal_class.return: void
focal_class.signature: void produce(final KijiRowData row, final KijiTableContext context)
focal_class.class_method_signature: KijiCellRewriter.rewriteCell(final DecodedCell<U> cell)
focal_class.full_signature: protected DecodedCell<T> rewriteCell(final DecodedCell<U> cell)
focal_class.identifier: rewriteCell
focal_class.modifiers: protected
focal_class.parameters: (final DecodedCell<U> cell)
focal_class.return: DecodedCell<T>
focal_class.signature: DecodedCell<T> rewriteCell(final DecodedCell<U> cell)
focal_class.class_method_signature: KijiCellRewriter.convertAvro(
        DecodedCell<U> original,
        Schema schema
    )
focal_class.full_signature: public static DecodedCell<T> convertAvro(
        DecodedCell<U> original,
        Schema schema
    )
focal_class.identifier: convertAvro
focal_class.modifiers: public static
focal_class.parameters: (
        DecodedCell<U> original,
        Schema schema
    )
focal_class.return: DecodedCell<T>
focal_class.signature: DecodedCell<T> convertAvro(
        DecodedCell<U> original,
        Schema schema
    )
focal_class.superclass: extends KijiPivoter
focal_method.body: public static <T, U> DecodedCell<T> convertAvro(
        DecodedCell<U> original,
        Schema schema
    ) throws IOException {
      final ByteArrayOutputStream baos = new ByteArrayOutputStream();
  
      // Encode original datum to bytes:
      final Encoder encoder = EncoderFactory.get().directBinaryEncoder(baos, null);
      final DatumWriter<U> writer = new GenericDatumWriter<U>(original.getWriterSchema());
      writer.write(original.getData(), encoder);
      encoder.flush();
  
      // Decode bytes according to the new schema:
      final Decoder decoder = DecoderFactory.get().binaryDecoder(baos.toByteArray(), null);
      final DatumReader<T> reader =
          new GenericDatumReader<T>(original.getWriterSchema(), schema);
      final T data = reader.read(null, decoder);
  
      return new DecodedCell<T>(schema, data);
    }
focal_method.class_method_signature: KijiCellRewriter.convertAvro(
        DecodedCell<U> original,
        Schema schema
    )
focal_method.full_signature: public static DecodedCell<T> convertAvro(
        DecodedCell<U> original,
        Schema schema
    )
focal_method.identifier: convertAvro
focal_method.invocations: directBinaryEncoder get getWriterSchema write getData flush binaryDecoder get toByteArray getWriterSchema read
focal_method.modifiers: public static
focal_method.parameters: (
        DecodedCell<U> original,
        Schema schema
    )
focal_method.return: DecodedCell<T>
focal_method.signature: DecodedCell<T> convertAvro(
        DecodedCell<U> original,
        Schema schema
    )