/** * Create and setup a {@link WALCellCodec} from the * CompressionContext. * Cell Codec classname is read from {@link Configuration}. * Fully prepares the codec for use. * @param conf {@link Configuration} to read for the user-specified codec. If none is specified, * uses a {@link WALCellCodec}. * @param compression compression the codec should use * @return a {@link WALCellCodec} ready for use. * @throws UnsupportedOperationException if the codec cannot be instantiated */ public static WALCellCodec create(Configuration conf, CompressionContext compression) throws UnsupportedOperationException { String cellCodecClsName = getWALCellCodecClass(conf).getName(); return ReflectionUtils.instantiateWithCustomCtor(cellCodecClsName, new Class[] { Configuration.class, CompressionContext.class }, new Object[] { conf, compression }); }
/** * Create and setup a {@link WALCellCodec} from the {@code cellCodecClsName} and * CompressionContext, if {@code cellCodecClsName} is specified. * Otherwise Cell Codec classname is read from {@link Configuration}. * Fully prepares the codec for use. * @param conf {@link Configuration} to read for the user-specified codec. If none is specified, * uses a {@link WALCellCodec}. * @param cellCodecClsName name of codec * @param compression compression the codec should use * @return a {@link WALCellCodec} ready for use. * @throws UnsupportedOperationException if the codec cannot be instantiated */ public static WALCellCodec create(Configuration conf, String cellCodecClsName, CompressionContext compression) throws UnsupportedOperationException { if (cellCodecClsName == null) { cellCodecClsName = getWALCellCodecClass(conf).getName(); } return ReflectionUtils.instantiateWithCustomCtor(cellCodecClsName, new Class[] { Configuration.class, CompressionContext.class }, new Object[] { conf, compression }); }
String codecCls = WALCellCodec.getWALCellCodecClass(conf).getName(); try { TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(),
private WALHeader buildWALHeader0(Configuration conf, WALHeader.Builder builder) { if (!builder.hasWriterClsName()) { builder.setWriterClsName(getWriterClassName()); } if (!builder.hasCellCodecClsName()) { builder.setCellCodecClsName( WALCellCodec.getWALCellCodecClass(conf).getName()); } return builder.build(); }
/** * Create and setup a {@link WALCellCodec} from the {@code cellCodecClsName} and * CompressionContext, if {@code cellCodecClsName} is specified. * Otherwise Cell Codec classname is read from {@link Configuration}. * Fully prepares the codec for use. * @param conf {@link Configuration} to read for the user-specified codec. If none is specified, * uses a {@link WALCellCodec}. * @param compression compression the codec should use * @return a {@link WALCellCodec} ready for use. * @throws UnsupportedOperationException if the codec cannot be instantiated */ public static WALCellCodec create(Configuration conf, String cellCodecClsName, CompressionContext compression) throws UnsupportedOperationException { if (cellCodecClsName == null) { cellCodecClsName = getWALCellCodecClass(conf); } return ReflectionUtils.instantiateWithCustomCtor(cellCodecClsName, new Class[] { Configuration.class, CompressionContext.class }, new Object[] { conf, compression }); }
/** * Create and setup a {@link WALCellCodec} from the * CompressionContext. * Cell Codec classname is read from {@link Configuration}. * Fully prepares the codec for use. * @param conf {@link Configuration} to read for the user-specified codec. If none is specified, * uses a {@link WALCellCodec}. * @param compression compression the codec should use * @return a {@link WALCellCodec} ready for use. * @throws UnsupportedOperationException if the codec cannot be instantiated */ public static WALCellCodec create(Configuration conf, CompressionContext compression) throws UnsupportedOperationException { String cellCodecClsName = getWALCellCodecClass(conf); return ReflectionUtils.instantiateWithCustomCtor(cellCodecClsName, new Class[] { Configuration.class, CompressionContext.class }, new Object[] { conf, compression }); }
protected WALHeader buildWALHeader(Configuration conf, WALHeader.Builder builder) throws IOException { if (!builder.hasWriterClsName()) { builder.setWriterClsName(ProtobufLogWriter.class.getSimpleName()); } if (!builder.hasCellCodecClsName()) { builder.setCellCodecClsName(WALCellCodec.getWALCellCodecClass(conf)); } return builder.build(); }
String codecCls = WALCellCodec.getWALCellCodecClass(conf); try { TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(), Class.forName(codecCls));
String codecCls = WALCellCodec.getWALCellCodecClass(conf).getName(); try { TableMapReduceUtil.addDependencyJarsForClasses(job.getConfiguration(), Class.forName(codecCls));