yifan-c commented on code in PR #61:
URL: https://github.com/apache/cassandra-sidecar/pull/61#discussion_r1262839024


##########
client/src/main/java/org/apache/cassandra/sidecar/client/retry/RetryPolicy.java:
##########
@@ -55,31 +54,6 @@ public abstract void 
onResponse(CompletableFuture<HttpResponse> responseFuture,
                                     boolean canRetryOnADifferentHost,
                                     RetryAction retryAction);
 
-    /**
-     * Returns a {@link RetriesExhaustedException} with the number of {@code 
attempts} performed before the retries.
-     *
-     * @param attempts the number of attempts for the request
-     * @param request  the HTTP request
-     * @return a {@link RetriesExhaustedException} with the number of {@code 
attempts} performed before the retries
-     */
-    RetriesExhaustedException retriesExhausted(int attempts, Request request)
-    {
-        return new RetriesExhaustedException(attempts, request);
-    }
-
-    /**
-     * Returns a {@link RetriesExhaustedException} with the number of {@code 
attempts} performed before the retries.
-     *
-     * @param attempts  the number of attempts for the request
-     * @param request   the HTTP request
-     * @param throwable the underlying exception
-     * @return a {@link RetriesExhaustedException} with the number of {@code 
attempts} performed before the retries
-     */
-    RetriesExhaustedException retriesExhausted(int attempts, Request request, 
Throwable throwable)
-    {
-        return new RetriesExhaustedException(attempts, request, throwable);
-    }
-

Review Comment:
   The exception creation methods are more helpful to be publicly accessible. 
They should not be limited to the RetryPolicy and its subclasses. Additionally, 
it is a lot of javadoc copy-and-paste by having creation method in the 
constructors and here. 



##########
client/src/main/java/org/apache/cassandra/sidecar/client/retry/RetryPolicy.java:
##########
@@ -55,31 +54,6 @@ public abstract void 
onResponse(CompletableFuture<HttpResponse> responseFuture,
                                     boolean canRetryOnADifferentHost,
                                     RetryAction retryAction);
 
-    /**
-     * Returns a {@link RetriesExhaustedException} with the number of {@code 
attempts} performed before the retries.
-     *
-     * @param attempts the number of attempts for the request
-     * @param request  the HTTP request
-     * @return a {@link RetriesExhaustedException} with the number of {@code 
attempts} performed before the retries
-     */
-    RetriesExhaustedException retriesExhausted(int attempts, Request request)
-    {
-        return new RetriesExhaustedException(attempts, request);
-    }
-
-    /**
-     * Returns a {@link RetriesExhaustedException} with the number of {@code 
attempts} performed before the retries.
-     *
-     * @param attempts  the number of attempts for the request
-     * @param request   the HTTP request
-     * @param throwable the underlying exception
-     * @return a {@link RetriesExhaustedException} with the number of {@code 
attempts} performed before the retries
-     */
-    RetriesExhaustedException retriesExhausted(int attempts, Request request, 
Throwable throwable)
-    {
-        return new RetriesExhaustedException(attempts, request, throwable);
-    }
-

Review Comment:
   reviewer note: The exception creation methods are more helpful to be 
publicly accessible. They should not be limited to the RetryPolicy and its 
subclasses. Additionally, it is a lot of javadoc copy-and-paste by having 
creation method in the constructors and here. 



-- 
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]

Reply via email to