本文整理汇总了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)));
}
示例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)));
}
示例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;
}
示例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;
}
示例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);
}