You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/01/05 07:23:08 UTC

[GitHub] [incubator-hudi] dengziming commented on issue #1185: [HUDI-500] Use enum method to replace switch case

dengziming commented on issue #1185: [HUDI-500] Use enum method to replace switch case
URL: https://github.com/apache/incubator-hudi/pull/1185#issuecomment-570883644
 
 
   > hi @dengziming, WDYT?
   > 
   > ```
   > public enum HoodieTableType {
   > 
   >     COPY_ON_WRITE {
   >       @Override
   >       public String getCommitActionType() {
   >         return HoodieActiveTimeline.COMMIT_ACTION;
   >       }
   >     },
   > 
   >     MERGE_ON_READ {
   >       @Override
   >       public String getCommitActionType() {
   >         return HoodieActiveTimeline.DELTA_COMMIT_ACTION;
   >       }
   >     };
   > 
   >     public HoodieTimeline getCommitsTimeline(HoodieTableMetaClient metaClient) {
   >       return metaClient.getActiveTimeline().getCommitTimeline();
   >     }
   > 
   >     public HoodieTimeline getCommitsAndCompactionTimeline(HoodieTableMetaClient metaClient) {
   >       return metaClient.getActiveTimeline().getCommitTimeline();
   >     }
   > 
   >     public HoodieTimeline getCommitTimeline(HoodieTableMetaClient metaClient) {
   >       return metaClient.getActiveTimeline().getCommitTimeline();
   >     }
   > 
   >   public abstract String getCommitActionType();
   > }
   > ```
   
   this isn't consistent with before. In fact, only the `getCommitTimeline` of `COPY_ON_WRITE` and `MERGE_ON_READ` is identical, other methods are different.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services