wchevreuil commented on code in PR #7477: URL: https://github.com/apache/hbase/pull/7477#discussion_r2568165955
########## hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/FilePathStringPool.java: ########## @@ -0,0 +1,176 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.io.hfile.bucket; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; +import org.apache.yetus.audience.InterfaceAudience; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Pool of string values encoded to integer IDs for use in BlockCacheKey. This allows for avoiding + * duplicating string values for file names, region and CF values on various BlockCacheKey + * instances. Normally, single hfiles have many blocks. This means all blocks from the same file + * will have the very same file, region and CF names. On very large BucketCache setups (i.e. file + * based cache with TB size order), can save few GBs of memory by avoiding repeating these common Review Comment: For a 1.6TB fully used cache with blocks size averaging around 60KB, we get about 30M blocks. The heap savings on this case was 2GB, falling from 10GB to 8GB usage. With a same 1.6TB fully used cache, but with block size adjusted to produce double of blocks (60M), the observed heap footprint without this change was 25GB, falling to 21GB with this change. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
