- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.gobblin.writer.WriterOutputFormat
类的一些代码示例,展示了WriterOutputFormat
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriterOutputFormat
类的具体详情如下:
包路径:org.apache.gobblin.writer.WriterOutputFormat
类名称:WriterOutputFormat
[英]An enumeration of writer output formats.
[中]写入程序输出格式的枚举。
代码示例来源:origin: apache/incubator-gobblin
/**
* Get the output format of the writer of type {@link WriterOutputFormat}.
*
* @param branches number of forked branches
* @param index branch index
* @return output format of the writer
*/
public WriterOutputFormat getWriterOutputFormat(int branches, int index) {
String writerOutputFormatValue = this.taskState.getProp(
ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY, branches, index),
WriterOutputFormat.OTHER.name());
log.debug("Found writer output format value = {}", writerOutputFormatValue);
WriterOutputFormat wof = Enums.getIfPresent(WriterOutputFormat.class, writerOutputFormatValue.toUpperCase())
.or(WriterOutputFormat.OTHER);
log.debug("Returning writer output format = {}", wof);
return wof;
}
代码示例来源:origin: apache/incubator-gobblin
this.setConfiguration(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, workDir + "/event_data");
this.setConfiguration(ConfigurationKeys.DATA_PUBLISHER_METADATA_OUTPUT_DIR, workDir + "/metadata");
this.setConfiguration(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY, WriterOutputFormat.PARQUET.toString());
代码示例来源:origin: apache/incubator-gobblin
/**
* Get the file name to be used by the writer. If a {@link org.apache.gobblin.writer.partitioner.WriterPartioner} is used,
* the partition will be added as part of the file name.
*/
public String getFileName(State properties) {
String extension =
this.format.equals(WriterOutputFormat.OTHER) ? getExtension(properties) : this.format.getExtension();
String fileName = WriterUtils.getWriterFileName(properties, this.branches, this.branch, this.writerId, extension);
if (this.partition.isPresent()) {
fileName = getPartitionedFileName(properties, fileName);
}
List<StreamCodec> encoders = getEncoders();
if (!encoders.isEmpty()) {
StringBuilder filenameBuilder = new StringBuilder(fileName);
for (StreamCodec codec : encoders) {
filenameBuilder.append('.');
filenameBuilder.append(codec.getTag());
}
fileName = filenameBuilder.toString();
}
return fileName;
}
代码示例来源:origin: apache/incubator-gobblin
/**
* Write output to avro files at the given input location.
*/
@CliObjectOption(description = "Write output to Avro files. Specify the output directory as argument.")
public EmbeddedWikipediaExample avroOutput(String outputPath) {
this.setConfiguration(ConfigurationKeys.WRITER_BUILDER_CLASS, AvroDataWriterBuilder.class.getName());
this.setConfiguration(ConfigurationKeys.WRITER_DESTINATION_TYPE_KEY, Destination.DestinationType.HDFS.name());
this.setConfiguration(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY, WriterOutputFormat.AVRO.name());
this.setConfiguration(ConfigurationKeys.WRITER_PARTITIONER_CLASS, WikipediaPartitioner.class.getName());
this.setConfiguration(ConfigurationKeys.JOB_DATA_PUBLISHER_TYPE, BaseDataPublisher.class.getName());
this.setConfiguration(ConfigurationKeys.CONVERTER_CLASSES_KEY, WikipediaConverter.class.getName());
this.setConfiguration(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, outputPath);
return this;
}
代码示例来源:origin: org.apache.gobblin/gobblin-core
/**
* Get the file name to be used by the writer. If a {@link org.apache.gobblin.writer.partitioner.WriterPartioner} is used,
* the partition will be added as part of the file name.
*/
public String getFileName(State properties) {
String extension =
this.format.equals(WriterOutputFormat.OTHER) ? getExtension(properties) : this.format.getExtension();
String fileName = WriterUtils.getWriterFileName(properties, this.branches, this.branch, this.writerId, extension);
if (this.partition.isPresent()) {
fileName = getPartitionedFileName(properties, fileName);
}
List<StreamCodec> encoders = getEncoders();
if (!encoders.isEmpty()) {
StringBuilder filenameBuilder = new StringBuilder(fileName);
for (StreamCodec codec : encoders) {
filenameBuilder.append('.');
filenameBuilder.append(codec.getTag());
}
fileName = filenameBuilder.toString();
}
return fileName;
}
代码示例来源:origin: apache/incubator-gobblin
private void prepareWorkUnit(WorkUnit workUnit) {
workUnit.setProp(ConfigurationKeys.TASK_ID_KEY, TestHelper.TEST_TASK_ID);
workUnit.setProp(ConfigurationKeys.TASK_KEY_KEY, Long.toString(Id.parse(TestHelper.TEST_TASK_ID).getSequence()));
workUnit.setProp(ConfigurationKeys.SOURCE_CLASS_KEY, SimpleJsonSource.class.getName());
workUnit.setProp(ConfigurationKeys.CONVERTER_CLASSES_KEY, SimpleJsonConverter.class.getName());
workUnit.setProp(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY, WriterOutputFormat.AVRO.toString());
workUnit.setProp(ConfigurationKeys.WRITER_DESTINATION_TYPE_KEY, Destination.DestinationType.HDFS.toString());
workUnit.setProp(ConfigurationKeys.WRITER_STAGING_DIR, this.appWorkDir.toString() + Path.SEPARATOR + "staging");
workUnit.setProp(ConfigurationKeys.WRITER_OUTPUT_DIR, this.taskOutputDir.toString());
workUnit.setProp(ConfigurationKeys.WRITER_FILE_NAME, TestHelper.WRITER_FILE_NAME);
workUnit.setProp(ConfigurationKeys.WRITER_FILE_PATH, TestHelper.REL_WRITER_FILE_PATH);
workUnit.setProp(ConfigurationKeys.WRITER_BUILDER_CLASS, AvroDataWriterBuilder.class.getName());
workUnit.setProp(ConfigurationKeys.SOURCE_SCHEMA, TestHelper.SOURCE_SCHEMA);
}
}
代码示例来源:origin: apache/incubator-gobblin
jobProps.setProperty(ConfigurationKeys.TASK_LEVEL_POLICY_LIST_TYPE + ".0", "OPTIONAL,OPTIONAL");
jobProps.setProperty(ConfigurationKeys.TASK_LEVEL_POLICY_LIST_TYPE + ".1", "OPTIONAL,OPTIONAL");
jobProps.setProperty(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY + ".0", WriterOutputFormat.AVRO.name());
jobProps.setProperty(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY + ".1", WriterOutputFormat.AVRO.name());
jobProps.setProperty(ConfigurationKeys.WRITER_DESTINATION_TYPE_KEY + ".0", Destination.DestinationType.HDFS.name());
jobProps.setProperty(ConfigurationKeys.WRITER_DESTINATION_TYPE_KEY + ".1", Destination.DestinationType.HDFS.name());
代码示例来源:origin: org.apache.gobblin/gobblin-example
this.setConfiguration(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, workDir + "/event_data");
this.setConfiguration(ConfigurationKeys.DATA_PUBLISHER_METADATA_OUTPUT_DIR, workDir + "/metadata");
this.setConfiguration(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY, WriterOutputFormat.PARQUET.toString());
代码示例来源:origin: apache/incubator-gobblin
jobProps.setProperty(ConfigurationKeys.TASK_LEVEL_POLICY_LIST_TYPE + ".0", "OPTIONAL,OPTIONAL");
jobProps.setProperty(ConfigurationKeys.TASK_LEVEL_POLICY_LIST_TYPE + ".1", "OPTIONAL,OPTIONAL");
jobProps.setProperty(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY + ".0", WriterOutputFormat.AVRO.name());
jobProps.setProperty(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY + ".1", WriterOutputFormat.AVRO.name());
jobProps.setProperty(ConfigurationKeys.WRITER_DESTINATION_TYPE_KEY + ".0", Destination.DestinationType.HDFS.name());
jobProps.setProperty(ConfigurationKeys.WRITER_DESTINATION_TYPE_KEY + ".1", Destination.DestinationType.HDFS.name());
代码示例来源:origin: org.apache.gobblin/gobblin-runtime
/**
* Get the output format of the writer of type {@link WriterOutputFormat}.
*
* @param branches number of forked branches
* @param index branch index
* @return output format of the writer
*/
public WriterOutputFormat getWriterOutputFormat(int branches, int index) {
String writerOutputFormatValue = this.taskState.getProp(
ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY, branches, index),
WriterOutputFormat.OTHER.name());
log.debug("Found writer output format value = {}", writerOutputFormatValue);
WriterOutputFormat wof = Enums.getIfPresent(WriterOutputFormat.class, writerOutputFormatValue.toUpperCase())
.or(WriterOutputFormat.OTHER);
log.debug("Returning writer output format = {}", wof);
return wof;
}
代码示例来源:origin: org.apache.gobblin/gobblin-example
/**
* Write output to avro files at the given input location.
*/
@CliObjectOption(description = "Write output to Avro files. Specify the output directory as argument.")
public EmbeddedWikipediaExample avroOutput(String outputPath) {
this.setConfiguration(ConfigurationKeys.WRITER_BUILDER_CLASS, AvroDataWriterBuilder.class.getName());
this.setConfiguration(ConfigurationKeys.WRITER_DESTINATION_TYPE_KEY, Destination.DestinationType.HDFS.name());
this.setConfiguration(ConfigurationKeys.WRITER_OUTPUT_FORMAT_KEY, WriterOutputFormat.AVRO.name());
this.setConfiguration(ConfigurationKeys.WRITER_PARTITIONER_CLASS, WikipediaPartitioner.class.getName());
this.setConfiguration(ConfigurationKeys.JOB_DATA_PUBLISHER_TYPE, BaseDataPublisher.class.getName());
this.setConfiguration(ConfigurationKeys.CONVERTER_CLASSES_KEY, WikipediaConverter.class.getName());
this.setConfiguration(ConfigurationKeys.DATA_PUBLISHER_FINAL_DIR, outputPath);
return this;
}
我有一个函数可以将数据写入任何实现接口(interface)的对象,该接口(interface)使用 Write(b []byte) (n int, err error) 方法。现在在我的程序中,我写
我继承了一些 Java。我对其他类似 C 的语言有很多经验,但我对 Java 还是很陌生。在一个函数中,我的前任同时使用了 write()和 append() Writer 的方法类,但我不明白为什么
我继承了一些 Java。我对其他类似 C 的语言有很多经验,但我对 Java 还是很陌生。在一个函数中,我的前任同时使用了 write()和 append() Writer 的方法类,但我不明白为什么
假设这里唯一的区别是二进制读取器/写入器对字符串使用固定长度编码,因此可能效率较低,是否正确? 最佳答案 不存在大量其他差异,例如读取和写入行、编码...基本上是与文本相关的“帮助器”函数的负载。 关
在将有效负载发送到 Web 服务之前尝试将有效负载转换为 xml 时,我在 mule 独立版本 3.8.1 中遇到错误。 我的流程配置是这样的:
似乎有两种方法可以将 JSON 对象的内容写入编写器。我可以做 myWriter.write(myJSONObj.toString()); 或者 myJSONObj.write(myWriter);
这个问题已经有答案了: Should one call .close() on HttpServletResponse.getOutputStream()/.getWriter()? (6 个回答)
初始化记录器后: var Logger *log.Logger f, err := os.OpenFile("somefile", os.O_WRONLY|os.O_CREATE|os.O_APPEN
我正在开发一个网站,除其他外,它通过 Metaweblog API 提供博客。我已经让 API 与几个博客客户端一起工作得很好,但 Windows Live Writer 正在扼杀我。 我已经完成了网
我有一个在启动后异步运行的方法,使用 OutputStream 或 Writer 作为参数。 它充当 OutputStream 或 Writer 的记录适配器(这是我无法更改的第三方 API)。 如何
我正在使用 ruby version 1.9.3 并且在启动 thin server 时出现错误 /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1
我编辑了一个来自客户的文档,其中有一些亮点,然后决定删除评论中的亮点。 无论出于何种原因,该文档突出显示了许多项目符号和编号列表部分,当我尝试选择整个文档并将突出显示更改为“无填充”时,我无法还原这些
我正在读取 URL 的内容并将其写入文件,这按预期工作,但即使程序控制台显示多行,它也只写入一次。 代码: PrintWriter writer = new PrintWriter("the-file
在调用 XslCompiledTransform.Transform() 方法时出现此异常: The Writer is closed or in error state. 谁知道这是什么意思? 最佳
我试图制作一个系统,用于将 lua 编译脚本存储在内存中。问题是我不能做一个“lua_Writer”,变量字节码是空的。我使用 Luajit。在我的代码下方。 typedef struct {
我想将一些字符串写入文件。所以,我使用了 BufferedWriter 类。由于许多线程倾向于写入该文件,我想知道 write 和 writeLine 方法是否是原子的。 此外,我希望程序将输出写入多
我有一个套接字,我可以在其中写入一些字符数据和一些原始字节数据。对于字符数据,使用PrintWriter 更容易。对于原始字节数据,直接写入 OutputStream 会更容易。所以在我的代码中,我有
在 Golang 中是否可以将 string 转换为 io.Writer 类型? 我将在 fmt.Fprintf() 中使用此字符串,但我无法转换类型。 最佳答案 你不能写入 string,strin
我正在将数据框拧到 Excel 中。也许我做得不对, 当我使用此代码时: from datetime import datetime import numpy as np import pandas
我尝试导入 Control.Monad.Writer像这样的模块: import Control.Monad.Writer ghc版本 7.4.1 给出以下错误: Ambiguous module n
我是一名优秀的程序员,十分优秀!