- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.gobblin.writer.WatermarkAwareWriter.getUnacknowledgedWatermark()
方法的一些代码示例,展示了WatermarkAwareWriter.getUnacknowledgedWatermark()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WatermarkAwareWriter.getUnacknowledgedWatermark()
方法的具体详情如下:
包路径:org.apache.gobblin.writer.WatermarkAwareWriter
类名称:WatermarkAwareWriter
方法名:getUnacknowledgedWatermark
暂无
代码示例来源:origin: apache/incubator-gobblin
public Map<String, CheckpointableWatermark> getUnacknowledgedWatermark() {
return watermarkAwareWriter.get().getUnacknowledgedWatermark();
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public Map<String, CheckpointableWatermark> getUnacknowledgedWatermark() {
Preconditions.checkState(isWatermarkCapable());
return watermarkAwareWriter.get().getUnacknowledgedWatermark();
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public Map<String, CheckpointableWatermark> getUnacknowledgedWatermark() {
WatermarkTracker watermarkTracker = new MultiWriterWatermarkTracker();
for (Map.Entry<GenericRecord, DataWriter<D>> entry : this.partitionWriters.asMap().entrySet()) {
Map<String, CheckpointableWatermark> unacknowledgedWatermark =
((WatermarkAwareWriter) entry.getValue()).getUnacknowledgedWatermark();
if (!unacknowledgedWatermark.isEmpty()) {
watermarkTracker.unacknowledgedWatermarks(unacknowledgedWatermark);
}
}
return watermarkTracker.getAllUnacknowledgedWatermarks();
}
代码示例来源:origin: apache/incubator-gobblin
@Override
public Map<String, CheckpointableWatermark> getCommittableWatermark() {
// The committable watermark from a collection of commitable and unacknowledged watermarks is the highest
// committable watermark that is less than the lowest unacknowledged watermark
WatermarkTracker watermarkTracker = new MultiWriterWatermarkTracker();
for (Map.Entry<GenericRecord, DataWriter<D>> entry : this.partitionWriters.asMap().entrySet()) {
if (entry.getValue() instanceof WatermarkAwareWriter) {
Map<String, CheckpointableWatermark> commitableWatermarks =
((WatermarkAwareWriter) entry.getValue()).getCommittableWatermark();
if (!commitableWatermarks.isEmpty()) {
watermarkTracker.committedWatermarks(commitableWatermarks);
}
Map<String, CheckpointableWatermark> unacknowledgedWatermark =
((WatermarkAwareWriter) entry.getValue()).getUnacknowledgedWatermark();
if (!unacknowledgedWatermark.isEmpty()) {
watermarkTracker.unacknowledgedWatermarks(unacknowledgedWatermark);
}
}
}
return watermarkTracker.getAllCommitableWatermarks(); //TODO: Change this to use List of committables instead
}
代码示例来源:origin: apache/incubator-gobblin
public void testWatermarkComputation(Long committed, Long unacknowledged, Long expected) throws IOException {
State state = new State();
state.setProp(ConfigurationKeys.WRITER_PARTITIONER_CLASS, TestPartitioner.class.getCanonicalName());
String defaultSource = "default";
WatermarkAwareWriter mockDataWriter = mock(WatermarkAwareWriter.class);
when(mockDataWriter.isWatermarkCapable()).thenReturn(true);
when(mockDataWriter.getCommittableWatermark()).thenReturn(Collections.singletonMap(defaultSource,
new DefaultCheckpointableWatermark(defaultSource, new LongWatermark(committed))));
when(mockDataWriter.getUnacknowledgedWatermark()).thenReturn(Collections.singletonMap(defaultSource,
new DefaultCheckpointableWatermark(defaultSource, new LongWatermark(unacknowledged))));
PartitionAwareDataWriterBuilder builder = mock(PartitionAwareDataWriterBuilder.class);
when(builder.validatePartitionSchema(any(Schema.class))).thenReturn(true);
when(builder.forPartition(any(GenericRecord.class))).thenReturn(builder);
when(builder.withWriterId(any(String.class))).thenReturn(builder);
when(builder.build()).thenReturn(mockDataWriter);
PartitionedDataWriter writer = new PartitionedDataWriter<String, String>(builder, state);
RecordEnvelope<String> recordEnvelope = new RecordEnvelope<String>("0");
recordEnvelope.addCallBack(
new AcknowledgableWatermark(new DefaultCheckpointableWatermark(defaultSource, new LongWatermark(0))));
writer.writeEnvelope(recordEnvelope);
Map<String, CheckpointableWatermark> watermark = writer.getCommittableWatermark();
System.out.println(watermark.toString());
if (expected == null) {
Assert.assertTrue(watermark.isEmpty(), "Expected watermark to be absent");
} else {
Assert.assertTrue(watermark.size() == 1);
Assert.assertEquals((long) expected, ((LongWatermark) watermark.values().iterator().next().getWatermark()).getValue());
}
}
代码示例来源:origin: org.apache.gobblin/gobblin-core-base
public Map<String, CheckpointableWatermark> getUnacknowledgedWatermark() {
return watermarkAwareWriter.get().getUnacknowledgedWatermark();
}
代码示例来源:origin: org.apache.gobblin/gobblin-core-base
@Override
public Map<String, CheckpointableWatermark> getUnacknowledgedWatermark() {
Preconditions.checkState(isWatermarkCapable());
return watermarkAwareWriter.get().getUnacknowledgedWatermark();
}
代码示例来源:origin: org.apache.gobblin/gobblin-core
@Override
public Map<String, CheckpointableWatermark> getUnacknowledgedWatermark() {
WatermarkTracker watermarkTracker = new MultiWriterWatermarkTracker();
for (Map.Entry<GenericRecord, DataWriter<D>> entry : this.partitionWriters.asMap().entrySet()) {
Map<String, CheckpointableWatermark> unacknowledgedWatermark =
((WatermarkAwareWriter) entry.getValue()).getUnacknowledgedWatermark();
if (!unacknowledgedWatermark.isEmpty()) {
watermarkTracker.unacknowledgedWatermarks(unacknowledgedWatermark);
}
}
return watermarkTracker.getAllUnacknowledgedWatermarks();
}
代码示例来源:origin: org.apache.gobblin/gobblin-core
@Override
public Map<String, CheckpointableWatermark> getCommittableWatermark() {
// The committable watermark from a collection of commitable and unacknowledged watermarks is the highest
// committable watermark that is less than the lowest unacknowledged watermark
WatermarkTracker watermarkTracker = new MultiWriterWatermarkTracker();
for (Map.Entry<GenericRecord, DataWriter<D>> entry : this.partitionWriters.asMap().entrySet()) {
if (entry.getValue() instanceof WatermarkAwareWriter) {
Map<String, CheckpointableWatermark> commitableWatermarks =
((WatermarkAwareWriter) entry.getValue()).getCommittableWatermark();
if (!commitableWatermarks.isEmpty()) {
watermarkTracker.committedWatermarks(commitableWatermarks);
}
Map<String, CheckpointableWatermark> unacknowledgedWatermark =
((WatermarkAwareWriter) entry.getValue()).getUnacknowledgedWatermark();
if (!unacknowledgedWatermark.isEmpty()) {
watermarkTracker.unacknowledgedWatermarks(unacknowledgedWatermark);
}
}
}
return watermarkTracker.getAllCommitableWatermarks(); //TODO: Change this to use List of committables instead
}
我有一个函数可以将数据写入任何实现接口(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
我是一名优秀的程序员,十分优秀!