tablestore/src/main/java/com/alicloud/openservices/tablestore/model/CustomRetryStrategy.java [97:164]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            return true;
        }

        // For cases other than the above, no retries will be attempted.
        return false;
    }

    /**
     * Idempotent operations:
     * In this strategy, all read-related operations are considered idempotent, while all write-related operations are considered non-idempotent.
     *
     * Retry strategy, the rules are as follows:
     * 1. If the exception is TableStoreException, it indicates a clear exception returned from the server, and whether it can be retried is judged by shouldRetryWithOTSException.
     *    Specifically, for batch operations where some rows fail, retries will only occur if all failed rows are retryable.
     * 2. If the exception is ClientException, it generally represents network errors or similar issues where no server response was received; in this case, only idempotent operations are retried.
     *
     * @param action Operation name, such as "ListTable", "GetRow", "PutRow", etc.
     * @param ex     Error information from the last failed access attempt, either a ClientException or OTSException
     * @return
     */
    public boolean shouldRetry(String action, Exception ex) {
        boolean isIdempotent = IdempotentActionTool.isIdempotentAction(action);
        if (ex instanceof TableStoreException) {
            if (ex instanceof PartialResultFailedException) {
                PartialResultFailedException prfe = (PartialResultFailedException)ex;
                for (TableStoreException otsException : prfe.getErrors()) {
                    if (!shouldRetryWithOTSException(action, isIdempotent, otsException.getErrorCode(),
                            otsException.getMessage(), prfe.getHttpStatus())) {
                        return false;
                    }
                }
                return true;
            } else {
                TableStoreException otsException = (TableStoreException)ex;
                return shouldRetryWithOTSException(action, isIdempotent, otsException.getErrorCode(),
                        otsException.getMessage(), otsException.getHttpStatus());
            }
        } else if (ex instanceof ClientException) {
            return isIdempotent;
        } else {
            return false;
        }
    }

    /**
     * If it returns 0, it means not retryable; otherwise, it returns the interval time for this retry.
     *
     * The base value of the retry interval will double with the number of retries, but never exceed MAX_BASE.
     * For the smoothness of requests, the actual retry interval will have some random fluctuations based on the base.
     *
     * @param action  Operation name, such as "ListTable", "GetRow", "PutRow", etc.
     * @param ex      Error information from the last failed attempt, either ClientException or TableStoreException
     * @return
     */
    @Override
    public long nextPause(String action, Exception ex) {
        if (!shouldRetry(action, ex)) {
            return 0;
        }

        if (base <= 0) {
            return 0;
        }

        long now = System.currentTimeMillis();
        int expire = (int)(deadline - now);
        if (expire <= 0) {
            return 0;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tablestore/src/main/java/com/alicloud/openservices/tablestore/model/DefaultRetryStrategy.java [69:126]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            return true;
        }
        return false;
    }

    /**
     * The default retry strategy provided by the SDK, with the following rules:
     * 1. If the exception is TableStoreException and the error code is OTSRowOperationConflict, OTSNotEnoughCapacityUnit, OTSTableNotReady,
     * OTSPartitionUnavailable, or OTSServerBusy, then it can be retried.
     * 2. If the exception is OTSQuotaExhausted and the exception message is "Too frequent table operations.", then it can be retried.
     * 3. If the exception is ClientException (a network-related exception), and the operation is idempotent, then it can be retried.
     * 4. If the exception is OTSTimeout, OTSInternalServerError, OTSServerUnavailable, OTSTunnelServerUnavailable, or the HTTP status code is 500, 502, or 503, and the operation is idempotent, then it can be retried.
     * 5. For batch operations, the entire batch operation can only be retried if all failed rows are eligible for retry.
     *
     * The default retry strategy considers all read-related operations as idempotent, while all write-related operations are considered non-idempotent. If users have retry requirements for writes, they need to customize the retry strategy.
     *
     * @param action Operation name, such as "ListTable", "GetRow", "PutRow", etc.
     * @param ex     Error information from the last failed attempt, either a ClientException or OTSException
     * @return
     */
    public boolean shouldRetry(String action, Exception ex) {
        boolean isIdempotent = IdempotentActionTool.isIdempotentAction(action);
        if (ex instanceof TableStoreException) {
            if (ex instanceof PartialResultFailedException) {
                PartialResultFailedException prfe = (PartialResultFailedException)ex;
                for (TableStoreException otsException : prfe.getErrors()) {
                    if (!shouldRetryWithOTSException(action, isIdempotent, otsException.getErrorCode(),
                        otsException.getMessage(), prfe.getHttpStatus())) {
                        return false;
                    }
                }
                return true;
            } else {
                TableStoreException otsException = (TableStoreException)ex;
                return shouldRetryWithOTSException(action, isIdempotent, otsException.getErrorCode(),
                    otsException.getMessage(), otsException.getHttpStatus());
            }
        } else if (ex instanceof ClientException) {
            return isIdempotent;
        } else {
            return false;
        }
    }

    @Override
    public long nextPause(String action, Exception ex) {
        if (!shouldRetry(action, ex)) {
            return 0;
        }

        if (base <= 0) {
            return 0;
        }

        long now = System.currentTimeMillis();
        int expire = (int)(deadline - now);
        if (expire <= 0) {
            return 0;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



