jyothsnakonisa commented on code in PR #158:
URL: https://github.com/apache/cassandra-sidecar/pull/158#discussion_r1876439974
##########
client/src/main/java/org/apache/cassandra/sidecar/client/SidecarClient.java:
##########
@@ -489,6 +492,45 @@ public CompletableFuture<Void>
cleanUploadSession(SidecarInstance instance, Stri
.build());
}
+ /**
+ * Lists CDC commit logs in CDC directory for an instance
+ * @param sidecarInstance instance on which the CDC commit logs are to be
listed
+ * @return a completable future with List of cdc commitLogs on the
requested instance
+ */
+ public CompletableFuture<ListCdcSegmentsResponse>
listCdcSegments(SidecarInstance sidecarInstance)
+ {
+ return executor.executeRequestAsync(requestBuilder()
+ .singleInstanceSelectionPolicy(sidecarInstance)
+ .request(new ListCommitLogsRequest())
+ .build());
+ }
+
+ /**
+ * Streams CDC commit log segments from the requested instance.
+ *
+ * Streams the specified {@code range} of a CDC CommitLog from the given
instance and the
+ * stream is consumed by the {@link StreamConsumer consumer}.
+ *
+ * @param sidecarInstance instance on which the CDC commit logs are to be
streamed
+ * @param segment segment file name
+ * @param range range of the file to be streamed
+ * @param partitionId partition ID
+ * @param batchId batchId
+ * @param streamConsumer object that consumes the stream
+ */
+ public void streamCommitLogs(SidecarInstance sidecarInstance,
+ String segment,
+ HttpRange range,
+ String partitionId,
+ String batchId,
Review Comment:
Not sure if we require PartitionId and BatchId, they are not used by the API
but I put them here as we might need them for metrics or logging purpose.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]