You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/07/11 12:23:05 UTC

[GitHub] [accumulo] hkeebler edited a comment on issue #1210: Create type for time to use when reading and write Accumulo metadata

hkeebler edited a comment on issue #1210: Create type for time to use when reading and write Accumulo metadata
URL: https://github.com/apache/accumulo/issues/1210#issuecomment-510460119
 
 
   I'm considering the following update to TimeType and suggest using this instead of the single character checks for 'M' and 'L' in different places.  Note that 'code' may not be the best name, maybe 'id' which is used in 'LOGICAL_TIME_ID' or 'prefix'.
   ```
   /**
    * The type of ordering to use for the table's entries (default is MILLIS)
    */
   public enum TimeType {
     /**
      * Used to guarantee ordering of data sequentially as inserted
      */
     LOGICAL('L'),
   
     /**
      * This is the default. Tries to ensure that inserted data is stored with the timestamp closest to
      * the machine's time to the nearest millisecond, without going backwards to guarantee insertion
      * sequence. Note that using this time type can cause time to "skip" forward if a machine has a
      * time that is too far off. NTP is recommended when using this type.
      */
     MILLIS('M');
   
     public final char code;
   
     /**
      * Parses a char code into a TimeType - like valueOf on name
      * 
      * @param code
      * @return type matching code or null if not found
      */
     public static TimeType valueOfCode(char code) {
       for (TimeType type : values()) {
         if (type.code == code)
           return type;
       }
       return null;
     }
   
     /**
      * Enum constructor
      * 
      * @param code
      */
     private TimeType(char code) {
       this.code = code;
     }
   
   }
   ```

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