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


Java RecordWriter.init方法代码示例

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


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

示例1: getRecordWriter

import org.apache.drill.exec.store.RecordWriter; //导入方法依赖的package包/类
@Override
public RecordWriter getRecordWriter(FragmentContext context, EasyWriter writer) throws IOException {
  Map<String, String> options = Maps.newHashMap();

  options.put("location", writer.getLocation());

  FragmentHandle handle = context.getHandle();
  String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
  options.put("prefix", fragmentId);

  options.put("separator", " ");
  options.put(FileSystem.FS_DEFAULT_NAME_KEY, ((FileSystemConfig)writer.getStorageConfig()).connection);

  options.put("extension", "json");
  options.put("extended", Boolean.toString(context.getOptions().getOption(ExecConstants.JSON_EXTENDED_TYPES)));

  RecordWriter recordWriter = new JsonRecordWriter();
  recordWriter.init(options);

  return recordWriter;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:22,代码来源:JSONFormatPlugin.java

示例2: getRecordWriter

import org.apache.drill.exec.store.RecordWriter; //导入方法依赖的package包/类
@Override
public RecordWriter getRecordWriter(FragmentContext context, EasyWriter writer) throws IOException {
  Map<String, String> options = Maps.newHashMap();

  options.put("location", writer.getLocation());

  FragmentHandle handle = context.getHandle();
  String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
  options.put("prefix", fragmentId);

  options.put("separator", ((ModelFormatConfig)getConfig()).getDelimiter());
  options.put(FileSystem.FS_DEFAULT_NAME_KEY, ((FileSystemConfig)writer.getStorageConfig()).connection);

  options.put("extension", ((ModelFormatConfig)getConfig()).getExtensions().get(0));

  RecordWriter recordWriter = new DrillModelWriter(/*context.getAllocator()*/);
  recordWriter.init(options);

  return recordWriter;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:21,代码来源:ModelFormatPlugin.java

示例3: getRecordWriter

import org.apache.drill.exec.store.RecordWriter; //导入方法依赖的package包/类
@Override
public RecordWriter getRecordWriter(final FragmentContext context, final EasyWriter writer) throws IOException {
  final Map<String, String> options = Maps.newHashMap();

  options.put("location", writer.getLocation());

  FragmentHandle handle = context.getHandle();
  String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
  options.put("prefix", fragmentId);

  options.put("separator", ((TextFormatConfig)getConfig()).getFieldDelimiterAsString());
  options.put(FileSystem.FS_DEFAULT_NAME_KEY, ((FileSystemConfig)writer.getStorageConfig()).connection);

  options.put("extension", ((TextFormatConfig)getConfig()).getExtensions().get(0));

  RecordWriter recordWriter = new DrillTextRecordWriter(context.getAllocator());
  recordWriter.init(options);

  return recordWriter;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:21,代码来源:TextFormatPlugin.java

示例4: getRecordWriter

import org.apache.drill.exec.store.RecordWriter; //导入方法依赖的package包/类
public RecordWriter getRecordWriter(FragmentContext context, ParquetWriter writer) throws IOException, OutOfMemoryException {
  Map<String, String> options = Maps.newHashMap();

  options.put("location", writer.getLocation());

  FragmentHandle handle = context.getHandle();
  String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
  options.put("prefix", fragmentId);

  options.put(FileSystem.FS_DEFAULT_NAME_KEY, ((FileSystemConfig)writer.getStorageConfig()).connection);

  options.put(ExecConstants.PARQUET_BLOCK_SIZE, context.getOptions().getOption(ExecConstants.PARQUET_BLOCK_SIZE).num_val.toString());
  options.put(ExecConstants.PARQUET_PAGE_SIZE, context.getOptions().getOption(ExecConstants.PARQUET_PAGE_SIZE).num_val.toString());
  options.put(ExecConstants.PARQUET_DICT_PAGE_SIZE, context.getOptions().getOption(ExecConstants.PARQUET_DICT_PAGE_SIZE).num_val.toString());

  options.put(ExecConstants.PARQUET_WRITER_COMPRESSION_TYPE,
      context.getOptions().getOption(ExecConstants.PARQUET_WRITER_COMPRESSION_TYPE).string_val);

  options.put(ExecConstants.PARQUET_WRITER_ENABLE_DICTIONARY_ENCODING,
      context.getOptions().getOption(ExecConstants.PARQUET_WRITER_ENABLE_DICTIONARY_ENCODING).bool_val.toString());

  RecordWriter recordWriter = new ParquetRecordWriter(context, writer);
  recordWriter.init(options);

  return recordWriter;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:27,代码来源:ParquetFormatPlugin.java

示例5: getRecordWriter

import org.apache.drill.exec.store.RecordWriter; //导入方法依赖的package包/类
@Override
public RecordWriter getRecordWriter(FragmentContext context, EasyWriter writer) throws IOException {
  Map<String, String> options = Maps.newHashMap();

  options.put("location", writer.getLocation());

  FragmentHandle handle = context.getHandle();
  String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
  options.put("prefix", fragmentId);

  options.put("separator", " ");
  options.put(FileSystem.FS_DEFAULT_NAME_KEY, ((FileSystemConfig)writer.getStorageConfig()).connection);

  options.put("extension", "json");
  options.put("extended", Boolean.toString(context.getOptions().getOption(ExecConstants.JSON_EXTENDED_TYPES)));
  options.put("uglify", Boolean.toString(context.getOptions().getOption(ExecConstants.JSON_WRITER_UGLIFY)));
  options.put("skipnulls", Boolean.toString(context.getOptions().getOption(ExecConstants.JSON_WRITER_SKIPNULLFIELDS)));
  options.put("enableNanInf", Boolean.toString(context.getOptions().getOption(ExecConstants.JSON_WRITER_NAN_INF_NUMBERS_VALIDATOR)));
  RecordWriter recordWriter = new JsonRecordWriter(writer.getStorageStrategy());
  recordWriter.init(options);

  return recordWriter;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:24,代码来源:JSONFormatPlugin.java

示例6: getRecordWriter

import org.apache.drill.exec.store.RecordWriter; //导入方法依赖的package包/类
@Override
public RecordWriter getRecordWriter(final FragmentContext context, final EasyWriter writer) throws IOException {
  final Map<String, String> options = Maps.newHashMap();

  options.put("location", writer.getLocation());

  FragmentHandle handle = context.getHandle();
  String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
  options.put("prefix", fragmentId);

  options.put("separator", ((TextFormatConfig)getConfig()).getFieldDelimiterAsString());
  options.put(FileSystem.FS_DEFAULT_NAME_KEY, ((FileSystemConfig)writer.getStorageConfig()).connection);

  options.put("extension", ((TextFormatConfig)getConfig()).getExtensions().get(0));

  RecordWriter recordWriter = new DrillTextRecordWriter(context.getAllocator(), writer.getStorageStrategy());
  recordWriter.init(options);

  return recordWriter;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:21,代码来源:TextFormatPlugin.java

示例7: getRecordWriter

import org.apache.drill.exec.store.RecordWriter; //导入方法依赖的package包/类
public RecordWriter getRecordWriter(FragmentContext context, ParquetWriter writer) throws IOException, OutOfMemoryException {
  Map<String, String> options = Maps.newHashMap();

  options.put("location", writer.getLocation());

  FragmentHandle handle = context.getHandle();
  String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId());
  options.put("prefix", fragmentId);

  options.put(FileSystem.FS_DEFAULT_NAME_KEY, ((FileSystemConfig)writer.getStorageConfig()).connection);

  options.put(ExecConstants.PARQUET_BLOCK_SIZE, context.getOptions().getOption(ExecConstants.PARQUET_BLOCK_SIZE).num_val.toString());
  options.put(ExecConstants.PARQUET_WRITER_USE_SINGLE_FS_BLOCK,
    context.getOptions().getOption(ExecConstants.PARQUET_WRITER_USE_SINGLE_FS_BLOCK).bool_val.toString());
  options.put(ExecConstants.PARQUET_PAGE_SIZE, context.getOptions().getOption(ExecConstants.PARQUET_PAGE_SIZE).num_val.toString());
  options.put(ExecConstants.PARQUET_DICT_PAGE_SIZE, context.getOptions().getOption(ExecConstants.PARQUET_DICT_PAGE_SIZE).num_val.toString());

  options.put(ExecConstants.PARQUET_WRITER_COMPRESSION_TYPE,
      context.getOptions().getOption(ExecConstants.PARQUET_WRITER_COMPRESSION_TYPE).string_val);

  options.put(ExecConstants.PARQUET_WRITER_ENABLE_DICTIONARY_ENCODING,
      context.getOptions().getOption(ExecConstants.PARQUET_WRITER_ENABLE_DICTIONARY_ENCODING).bool_val.toString());

  RecordWriter recordWriter = new ParquetRecordWriter(context, writer);
  recordWriter.init(options);

  return recordWriter;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:29,代码来源:ParquetFormatPlugin.java


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