use of com.alibaba.maxgraph.proto.groot.GetTailOffsetsRequest in project GraphScope by alibaba.
the class IngestProgressClient method getTailOffsets.
public List<Long> getTailOffsets(List<Integer> queueIds) {
GetTailOffsetsRequest req = GetTailOffsetsRequest.newBuilder().addAllQueueId(queueIds).build();
GetTailOffsetsResponse tailOffsetsResponse = stub.getTailOffsets(req);
return tailOffsetsResponse.getOffsetsList();
}
use of com.alibaba.maxgraph.proto.groot.GetTailOffsetsRequest in project GraphScope by alibaba.
the class IngestProgressServiceTest method testIngestProgressService.
@Test
void testIngestProgressService() {
SnapshotManager snapshotManager = mock(SnapshotManager.class);
when(snapshotManager.getTailOffsets(Arrays.asList(1))).thenReturn(Arrays.asList(10L));
IngestProgressService ingestProgressService = new IngestProgressService(snapshotManager);
GetTailOffsetsRequest request = GetTailOffsetsRequest.newBuilder().addQueueId(1).build();
ingestProgressService.getTailOffsets(request, new StreamObserver<GetTailOffsetsResponse>() {
@Override
public void onNext(GetTailOffsetsResponse response) {
List<Long> offsetsList = response.getOffsetsList();
assertEquals(offsetsList.size(), 1);
assertEquals(offsetsList.get(0), 10L);
}
@Override
public void onError(Throwable t) {
throw new RuntimeException(t);
}
@Override
public void onCompleted() {
}
});
verify(snapshotManager).getTailOffsets(Arrays.asList(1));
}
Aggregations