public static byte[] getDictionary(final Configuration conf, final String path) {
    if (path == null || path.isEmpty()) {
      return null;
    }

    // Create the dictionary loading cache if we haven't already
    if (CACHE == null) {
      synchronized (DictionaryCache.class) {
        if (CACHE == null) {
          final int maxSize = conf.getInt(DICTIONARY_MAX_SIZE_KEY, DEFAULT_DICTIONARY_MAX_SIZE);
          CACHE = CacheBuilder.newBuilder().maximumSize(100).expireAfterAccess(10, TimeUnit.MINUTES)
            .build(new CacheLoader<String, byte[]>() {
              @Override
              public byte[] load(String s) throws Exception {
                byte[] bytes;
                if (path.startsWith(RESOURCE_SCHEME)) {
                  bytes = loadFromResource(conf, path, maxSize);
                } else {
                  bytes = loadFromHadoopFs(conf, path, maxSize);
                }
                LOG.info("Loaded dictionary from {} (size {})", s, bytes.length);
                return bytes;
              }
            });
        }
      }
    }

    // Get or load the dictionary for the given path
    try {
      return CACHE.get(path);
    } catch (ExecutionException e) {
      throw new RuntimeException("Unable to load dictionary at " + path, e);
    }
  }
Load a dictionary or return a previously cached load.
@param conf configuration
@param path the hadoop Path where the dictionary is located, as a String
@return the dictionary bytes if successful, null otherwise
hbase-common/src/main/java/org/apache/hadoop/hbase/io/compress/DictionaryCache.java