use of com.netflix.titus.grpc.protogen.JobChangeNotification.SnapshotEnd in project titus-control-plane by Netflix.
the class CellWithFixedJobsService method observeJobs.
@Override
public void observeJobs(ObserveJobsQuery query, StreamObserver<JobChangeNotification> responseObserver) {
// TODO: query criteria (filters) are not implemented
for (Job job : jobsIndex.values()) {
JobChangeNotification.JobUpdate update = JobChangeNotification.JobUpdate.newBuilder().setJob(job).build();
JobChangeNotification notification = JobChangeNotification.newBuilder().setJobUpdate(update).build();
responseObserver.onNext(notification);
}
SnapshotEnd snapshotEnd = SnapshotEnd.newBuilder().build();
JobChangeNotification marker = JobChangeNotification.newBuilder().setSnapshotEnd(snapshotEnd).build();
responseObserver.onNext(marker);
final Subscription subscription = updates.subscribe(responseObserver::onNext, responseObserver::onError, responseObserver::onCompleted);
GrpcUtil.attachCancellingCallback(responseObserver, subscription);
}
Aggregations