当前位置: 首页>>代码示例>>Java>>正文


Java AvroJob.getInputKeySchema方法代码示例

本文整理汇总了Java中org.apache.avro.mapreduce.AvroJob.getInputKeySchema方法的典型用法代码示例。如果您正苦于以下问题:Java AvroJob.getInputKeySchema方法的具体用法?Java AvroJob.getInputKeySchema怎么用?Java AvroJob.getInputKeySchema使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.avro.mapreduce.AvroJob的用法示例。


在下文中一共展示了AvroJob.getInputKeySchema方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRecordReader

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
@Override
public RecordReader<AvroKey<K>, AvroValue<V>> createRecordReader(
    InputSplit split, TaskAttemptContext context)
    throws IOException, InterruptedException {
  Schema keyReaderSchema = AvroJob.getInputKeySchema(context.getConfiguration());
  if (null == keyReaderSchema) {
    LOG.warn("Key reader schema was not set. " +
        "Use AvroJob.setInputKeySchema() if desired.");
    LOG.info("Using a key reader schema equal to the writer schema.");
  }
  Schema valueReaderSchema = AvroJob.getInputValueSchema(context.getConfiguration());
  if (null == valueReaderSchema) {
    LOG.warn("Value reader schema was not set. " +
        "Use AvroJob.setInputValueSchema() if desired.");
    LOG.info("Using a value reader schema equal to the writer schema.");
  }
  return new AvroKeyValueRecordReader<K, V>(keyReaderSchema, valueReaderSchema);
}
 
开发者ID:cloudera,项目名称:RecordServiceClient,代码行数:19,代码来源:AvroKeyValueInputFormat.java

示例2: createRecordReader

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
@Override
public RecordReader<AvroKey<T>, NullWritable> createRecordReader(InputSplit inputSplit, TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
    Schema readerSchema = AvroJob.getInputKeySchema(taskAttemptContext.getConfiguration());
    if(null == readerSchema) {
        LOG.warn("Reader schema was not set. Use AvroJob.setInputKeySchema() if desired.");
    }
    return new ErrorHandlingAvroKeyRecordReader(readerSchema);
}
 
开发者ID:Comcast,项目名称:spark-util,代码行数:9,代码来源:AtlasAvroKeyInputFormat.java

示例3: DelegatingAvroRecordReader

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
public DelegatingAvroRecordReader(CombineFileSplit split,
		TaskAttemptContext context, Integer splitIndex) {
	Schema readerSchema = AvroJob.getInputKeySchema(context.getConfiguration());
	if (null == readerSchema) {
	  logger().warn("Reader schema was not set. Use AvroJob.setInputKeySchema() if desired.");
	  logger().info("Using a reader schema equal to the writer schema.");
	}
	this.splitIndex = splitIndex;
	delegate = new AvroKeyRecordReaderSkipBad<>(readerSchema);
}
 
开发者ID:conversant,项目名称:mara,代码行数:11,代码来源:CombineAvroKeyFileInputFormat.java

示例4: createRecordReader

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
@Override
public RecordReader<AvroKey<T>, NullWritable> createRecordReader(
    InputSplit split, TaskAttemptContext context)
    throws IOException, InterruptedException {
  Schema readerSchema = AvroJob.getInputKeySchema(context.getConfiguration());
  if (null == readerSchema) {
    LOG.warn("Reader schema was not set. Use AvroJob.setInputKeySchema() if desired.");
    LOG.info("Using a reader schema equal to the writer schema.");
    LOG.info("Using GenericRecords instead of SpecificRecords.");
  }
  return new AvroKeyRecordReader<T>(readerSchema);
}
 
开发者ID:cloudera,项目名称:RecordServiceClient,代码行数:13,代码来源:AvroKeyInputFormat.java

示例5: createRecordReader

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
@Override
public RecordReader<Text, Text> createRecordReader(
		InputSplit split, TaskAttemptContext context) throws IOException,
		InterruptedException {
	Schema readerSchema = AvroJob.getInputKeySchema(context.getConfiguration());
	return new AvroBatchRecordReader<T>(readerSchema);
}
 
开发者ID:therelaxist,项目名称:spring-usc,代码行数:8,代码来源:AvroKeyBatchInputFormat.java

示例6: getSchema

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
private static Schema getSchema(CombineFileSplit split, TaskAttemptContext cx, Integer idx) throws IOException {
  Schema schema = AvroJob.getInputKeySchema(cx.getConfiguration());
  if (schema != null) {
    return schema;
  }

  Path path = split.getPath(idx);
  FileSystem fs = path.getFileSystem(cx.getConfiguration());
  return AvroUtils.getSchemaFromDataFile(path, fs);
}
 
开发者ID:apache,项目名称:incubator-gobblin,代码行数:11,代码来源:AvroKeyCombineFileRecordReader.java

示例7: createRecordReader

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public RecordReader<AvroKey<T>, NullWritable> createRecordReader(InputSplit inputSplit,
                                                                 TaskAttemptContext context) throws IOException
{
  Schema readerSchema = AvroJob.getInputKeySchema(context.getConfiguration());
  if (null == readerSchema) {
    LOG.warn("Reader schema was not set. Use AvroJob.setInputKeySchema() if desired.");
    LOG.info("Using a reader schema equal to the writer schema.");
  }
      
  Object c = CombinedAvroKeyRecordReader.class;
  return new CombineFileRecordReader<AvroKey<T>, NullWritable>((CombineFileSplit) inputSplit, context, (Class<? extends RecordReader<AvroKey<T>, NullWritable>>)c);
}
 
开发者ID:apache,项目名称:incubator-datafu,代码行数:15,代码来源:CombinedAvroKeyInputFormat.java

示例8: AvroKeyCombineFileRecordReader

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
public AvroKeyCombineFileRecordReader(CombineFileSplit split, TaskAttemptContext cx, Integer idx) {
  this(split, AvroJob.getInputKeySchema(cx.getConfiguration()), idx);
}
 
开发者ID:Hanmourang,项目名称:Gobblin,代码行数:4,代码来源:AvroKeyCombineFileRecordReader.java

示例9: CombinedAvroKeyRecordReader

import org.apache.avro.mapreduce.AvroJob; //导入方法依赖的package包/类
public CombinedAvroKeyRecordReader(CombineFileSplit inputSplit, TaskAttemptContext context, Integer idx)
{
  super(AvroJob.getInputKeySchema(context.getConfiguration()));
  this.inputSplit = inputSplit;
  this.idx = idx;            
}
 
开发者ID:apache,项目名称:incubator-datafu,代码行数:7,代码来源:CombinedAvroKeyInputFormat.java


注:本文中的org.apache.avro.mapreduce.AvroJob.getInputKeySchema方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。