本文整理匯總了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);
}