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


Java SplittableBufferedWriter类代码示例

本文整理汇总了Java中com.cloudera.sqoop.io.SplittableBufferedWriter的典型用法代码示例。如果您正苦于以下问题:Java SplittableBufferedWriter类的具体用法?Java SplittableBufferedWriter怎么用?Java SplittableBufferedWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createHdfsSink

import com.cloudera.sqoop.io.SplittableBufferedWriter; //导入依赖的package包/类
/**
 * Open a file in HDFS for write to hold the data associated with a table.
 * Creates any necessary directories, and returns the OutputStream to write
 * to. The caller is responsible for calling the close() method on the
 * returned stream.
 */
public static SplittableBufferedWriter createHdfsSink(Configuration conf,
    SqoopOptions options, ImportJobContext context) throws IOException {

  Path destDir = context.getDestination();
  FileSystem fs = destDir.getFileSystem(conf);

  LOG.debug("Writing to filesystem: " + fs.getUri());
  LOG.debug("Creating destination directory " + destDir);
  fs.mkdirs(destDir);

  // This Writer will be closed by the caller.
  return new SplittableBufferedWriter(
      new SplittingOutputStream(conf, destDir, "part-m-",
      options.getDirectSplitSize(), getCodec(conf, options)));
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:22,代码来源:DirectImportUtils.java

示例2: createHdfsSink

import com.cloudera.sqoop.io.SplittableBufferedWriter; //导入依赖的package包/类
/**
 * Open a file in HDFS for write to hold the data associated with a table.
 * Creates any necessary directories, and returns the OutputStream to write
 * to. The caller is responsible for calling the close() method on the
 * returned stream.
 */
public static SplittableBufferedWriter createHdfsSink(Configuration conf,
    SqoopOptions options, ImportJobContext context) throws IOException {

  Path destDir = context.getDestination();
  FileSystem fs = destDir.getFileSystem(conf);

  LOG.debug("Writing to filesystem: " + fs.getUri());
  LOG.debug("Creating destination directory " + destDir);
  fs.mkdirs(destDir);

  // This Writer will be closed by the caller.
  return new SplittableBufferedWriter(
      new SplittingOutputStream(conf, destDir, "data-",
      options.getDirectSplitSize(), getCodec(conf, options)));
}
 
开发者ID:infinidb,项目名称:sqoop,代码行数:22,代码来源:DirectImportUtils.java

示例3: PostgresqlStreamThread

import com.cloudera.sqoop.io.SplittableBufferedWriter; //导入依赖的package包/类
PostgresqlStreamThread(final InputStream is,
    final SplittableBufferedWriter w,
    final SqoopOptions opts, final PerfCounters ctrs) {
  this.stream = is;
  this.writer = w;
  this.options = opts;
  this.counters = ctrs;
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:9,代码来源:DirectPostgresqlManager.java

示例4: PostgresqlAsyncSink

import com.cloudera.sqoop.io.SplittableBufferedWriter; //导入依赖的package包/类
PostgresqlAsyncSink(final SplittableBufferedWriter w,
    final SqoopOptions opts, final PerfCounters ctrs) {
  this.writer = w;
  this.options = opts;
  this.counters = ctrs;
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:7,代码来源:DirectPostgresqlManager.java

示例5: createHdfsSink

import com.cloudera.sqoop.io.SplittableBufferedWriter; //导入依赖的package包/类
public static SplittableBufferedWriter createHdfsSink(Configuration conf,
    SqoopOptions options, ImportJobContext context) throws IOException {
  return org.apache.sqoop.util.DirectImportUtils.createHdfsSink(conf,
      options, context);
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:6,代码来源:DirectImportUtils.java


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