Class DictionaryCache
java.lang.Object
org.apache.hadoop.hbase.io.compress.DictionaryCache
A utility class for managing compressor/decompressor dictionary loading and caching of load
results. Useful for any codec that can support changing dictionaries at runtime, such as
ZStandard.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static byte[]
getDictionary
(org.apache.hadoop.conf.Configuration conf, String path) Load a dictionary or return a previously cached load.private static byte[]
loadFromHadoopFs
(org.apache.hadoop.conf.Configuration conf, String s, int maxSize) static byte[]
loadFromResource
(org.apache.hadoop.conf.Configuration conf, String s, int maxSize)
-
Field Details
-
DICTIONARY_MAX_SIZE_KEY
- See Also:
-
DEFAULT_DICTIONARY_MAX_SIZE
- See Also:
-
RESOURCE_SCHEME
- See Also:
-
LOG
-
CACHE
-
-
Constructor Details
-
DictionaryCache
private DictionaryCache()
-
-
Method Details
-
getDictionary
public static byte[] getDictionary(org.apache.hadoop.conf.Configuration conf, String path) throws IOException Load a dictionary or return a previously cached load.- Parameters:
conf
- configurationpath
- the hadoop Path where the dictionary is located, as a String- Returns:
- the dictionary bytes if successful, null otherwise
- Throws:
IOException
-
loadFromResource
public static byte[] loadFromResource(org.apache.hadoop.conf.Configuration conf, String s, int maxSize) throws IOException - Throws:
IOException
-
loadFromHadoopFs
private static byte[] loadFromHadoopFs(org.apache.hadoop.conf.Configuration conf, String s, int maxSize) throws IOException - Throws:
IOException
-
contains
-