tephra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtyim <...@git.apache.org>
Subject [GitHub] incubator-tephra pull request #23: [Tephra-201] Store checkpoints in in-prog...
Date Thu, 08 Dec 2016 08:16:31 GMT
Github user chtyim commented on a diff in the pull request:

    https://github.com/apache/incubator-tephra/pull/23#discussion_r91460925
  
    --- Diff: tephra-core/src/main/java/org/apache/tephra/TransactionManager.java ---
    @@ -1319,20 +1344,60 @@ public void shutdown() {
       }
     
       /**
    +   * Type of in-progress transaction.
    +   */
    +  public enum InProgressType {
    +
    +    /**
    +     * Short transactions detect conflicts during commit.
    +     */
    +    SHORT(TransactionType.SHORT),
    +
    +    /**
    +     * Long running transactions do not detect conflicts during commit.
    +     */
    +    LONG(TransactionType.LONG),
    +
    +    /**
    +     * Check-pointed transactions are recorded as in-progress.
    +     */
    +    CHECKPOINT(null);
    +
    +    private final TransactionType transactionType;
    +
    +    InProgressType(TransactionType transactionType) {
    +      this.transactionType = transactionType;
    +    }
    +
    +    public static InProgressType of(TransactionType type) {
    +      switch (type) {
    +        case SHORT: return SHORT;
    +        case LONG:  return LONG;
    +        default: throw new IllegalArgumentException("Unknown TransactionType " + type);
    +      }
    +    }
    +
    +    @Nullable
    +    public TransactionType getTransactionType() {
    +      return transactionType;
    +    }
    +  }
    +
    +  /**
        * Represents some of the info on in-progress tx
        */
       public static final class InProgressTx {
         /** the oldest in progress tx at the time of this tx start */
         private final long visibilityUpperBound;
         private final long expiration;
    -    private final TransactionType type;
    +    private final InProgressType type;
         private LongArrayList checkpointWritePointers = new LongArrayList();
    --- End diff --
    
    This should be a final field?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message