當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。