我们从Google Dataflow 1.9迁移到Apache Beam 0.6.应用globalwindow后,我们注意到行为更改为时间戳.在Google Dataflow 1.9中,我们会在窗口化/合并功能后在DoFn中获得正确的时间戳.现在我们为时间戳获得了一些巨大的价值,例如9223371950454775,全局窗口的默认行为是否在Apache Beam版本中发生了变化?
input.apply(name(id, "Assign To Shard"), ParDo.of(new AssignToTest()))
.apply(name(id, "Window"), Window
.<KV<Long, ObjectNode >>into(new GlobalWindows())
.triggering(Repeatedly.forever(
AfterProcessingTime
.pastFirstElementInPane()
.plusDelayOf(Duration.standardMinutes(1))))
.discardingFiredPanes())
.apply(name(id, "Group By Shard"), GroupByKey.create())
.appy(.....) }
Run Code Online (Sandbox Code Playgroud) 我正在使用一些引发异常的库,并想测试我的代码在引发异常时的行为是否正确。存根重载方法之一似乎不起作用。我收到此错误:Stubber 不能应用于无效。不存在变量类型 T 的实例类型,因此 void 向 T 确认
`public class AnotherThing {
private final Something something;
public AnotherThing(Something something) {
this.something = something;
}
public void doSomething (String s) {
something.send(s);
}
}
public class Something {
void send(String s) throws IOException{
}
void send(int i) throws IOException{
}
}
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class OverloadedTest {
@Test(expected = IllegalStateException.class)
public void testDoSomething() throws Exception { …Run Code Online (Sandbox Code Playgroud)