You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/01/11 13:12:18 UTC

[GitHub] leventov edited a comment on issue #6823: Use an enum for aggregator cache key byte identifiers instead of static values

leventov edited a comment on issue #6823: Use an enum for aggregator cache key byte identifiers instead of static values
URL: https://github.com/apache/incubator-druid/issues/6823#issuecomment-453482482
 
 
   An extensible enum pattern could be used.
   ```java
   interface CacheKeyId {
     byte getId();
   }
   
   enum UpstreamCacheKeyId implements CacheKeyId {
     ...
     RESERVED_1((byte) 200),
     ...
     RESERVED_50((byte) 250)
   }
   ```
   
   Extensions are responsible for using ids from the reserved range.
   
   Another option is UTF-8 style, special byte for ids from private extensions:
   ```java
   enum CacheKeyId {
     ...
     EXTENSION(-1)
   }
   ```
   Then extensions need to use two-byte identifier, the first byte is `EXTENSION.id`, and then their custom id.
   
   More approaches are possible
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org