WillemJiang commented on a change in pull request #626: [SCB-1695] Add 
attribute mode to @Compensable annotation
URL: https://github.com/apache/servicecomb-pack/pull/626#discussion_r361831284
 
 

 ##########
 File path: 
omega/omega-transaction/src/main/java/org/apache/servicecomb/pack/omega/transaction/RecoveryPolicyFactory.java
 ##########
 @@ -17,17 +17,19 @@
 
 package org.apache.servicecomb.pack.omega.transaction;
 
+import 
org.apache.servicecomb.pack.omega.transaction.annotations.CompensableMode;
+
 public class RecoveryPolicyFactory {
   private static final RecoveryPolicy DEFAULT_RECOVERY = new DefaultRecovery();
 
   private static final RecoveryPolicy FORWARD_RECOVERY = new ForwardRecovery();
 
   /**
-   * If retries == 0, use the default recovery to execute only once.
-   * If retries > 0, it will use the forward recovery and retry the given 
times at most.
-   * If retries == -1, it will use the forward recovery and retry forever 
until interrupted.
+   * If mode is reverse, it will use the reverse recovery
+   * If mode is forward, it will use the forward recovery
+   * If mode is combine, it will use the first forward then reverse
    */
-  static RecoveryPolicy getRecoveryPolicy(int retries) {
-    return retries != 0 ? FORWARD_RECOVERY : DEFAULT_RECOVERY;
+  static RecoveryPolicy getRecoveryPolicy(CompensableMode mode) {
 
 Review comment:
   I doubt if we already implement the combine mode.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to