anuengineer commented on a change in pull request #798: HDDS-1499. OzoneManager Cache. URL: https://github.com/apache/hadoop/pull/798#discussion_r282165925
########## File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/utils/db/TypedTable.java ########## @@ -31,22 +38,40 @@ */ public class TypedTable<KEY, VALUE> implements Table<KEY, VALUE> { - private Table<byte[], byte[]> rawTable; + private final Table<byte[], byte[]> rawTable; + + private final CodecRegistry codecRegistry; - private CodecRegistry codecRegistry; + private final Class<KEY> keyType; - private Class<KEY> keyType; + private final Class<VALUE> valueType; - private Class<VALUE> valueType; + private final TableCache<CacheKey<KEY>, CacheValue<VALUE>> cache; public TypedTable( Table<byte[], byte[]> rawTable, CodecRegistry codecRegistry, Class<KEY> keyType, Class<VALUE> valueType) { + this(rawTable, codecRegistry, keyType, valueType, + null); + } + + + public TypedTable( + Table<byte[], byte[]> rawTable, + CodecRegistry codecRegistry, Class<KEY> keyType, + Class<VALUE> valueType, TableCache.CACHETYPE cachetype) { this.rawTable = rawTable; this.codecRegistry = codecRegistry; this.keyType = keyType; this.valueType = valueType; + if (cachetype == TableCache.CACHETYPE.FULLCACHE) { Review comment: It is impossible for the user to tell you apriori if they want a full cache or partial cache. When you start a cluster you always want a full cache. We should get a cache size -- or get a percentage of memory from the OM cache size and use that if needed. Or for time being rely on the RocksDB doing the right thing. ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org