use of org.apache.beam.runners.dataflow.worker.windmill.Windmill.ComputationCommitWorkRequest in project beam by apache.
the class FakeWindmillServer method commitWork.
@Override
public CommitWorkResponse commitWork(Windmill.CommitWorkRequest request) {
LOG.debug("commitWorkRequest: {}", request);
validateCommitWorkRequest(request);
for (ComputationCommitWorkRequest computationRequest : request.getRequestsList()) {
for (WorkItemCommitRequest commit : computationRequest.getRequestsList()) {
commitsReceived.put(commit.getWorkToken(), commit);
}
}
CommitWorkResponse response = CommitWorkResponse.newBuilder().build();
LOG.debug("commitWorkResponse: {}", response);
return response;
}
use of org.apache.beam.runners.dataflow.worker.windmill.Windmill.ComputationCommitWorkRequest in project beam by apache.
the class FakeWindmillServer method validateCommitWorkRequest.
private void validateCommitWorkRequest(Windmill.CommitWorkRequest request) {
for (ComputationCommitWorkRequest computationRequest : request.getRequestsList()) {
for (WorkItemCommitRequest commit : computationRequest.getRequestsList()) {
errorCollector.checkThat(commit.hasWorkToken(), equalTo(true));
errorCollector.checkThat(commit.getShardingKey(), allOf(greaterThan(0L), lessThan(Long.MAX_VALUE)));
errorCollector.checkThat(commit.getCacheToken(), not(equalTo(0L)));
}
}
}
Aggregations