K
- type of the key in the cacheV
- type of the value in the cachepublic class GuavaCacheTableDescriptor<K,V> extends BaseTableDescriptor<K,V,GuavaCacheTableDescriptor<K,V>>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GUAVA_CACHE |
static java.lang.String |
PROVIDER_FACTORY_CLASS_NAME |
config, tableId
Constructor and Description |
---|
GuavaCacheTableDescriptor(java.lang.String tableId)
Constructs a table descriptor instance
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getProviderFactoryClassName()
Return the fully qualified class name of the
TableProviderFactory |
java.util.Map<java.lang.String,java.lang.String> |
toConfig(Config jobConfig)
Generate configuration for this table descriptor, the generated configuration
should be the complete configuration for this table that can be directly
included in the job configuration.
|
protected void |
validate()
Validate that this table descriptor is constructed properly; this method is used internally.
|
GuavaCacheTableDescriptor |
withCache(com.google.common.cache.Cache<K,V> cache)
Specify a pre-configured Guava cache instance to be used for caching table.
|
addTableConfig, getTableId, withConfig
public static final java.lang.String PROVIDER_FACTORY_CLASS_NAME
public static final java.lang.String GUAVA_CACHE
public GuavaCacheTableDescriptor(java.lang.String tableId)
tableId
- Id of the table, it must conform to pattern [\\d\\w-_]+public GuavaCacheTableDescriptor withCache(com.google.common.cache.Cache<K,V> cache)
cache
- Guava cache instancepublic java.lang.String getProviderFactoryClassName()
BaseTableDescriptor
TableProviderFactory
getProviderFactoryClassName
in class BaseTableDescriptor<K,V,GuavaCacheTableDescriptor<K,V>>
TableProviderFactory
public java.util.Map<java.lang.String,java.lang.String> toConfig(Config jobConfig)
TableDescriptor
jobConfig
.toConfig
in interface TableDescriptor<K,V,GuavaCacheTableDescriptor<K,V>>
toConfig
in class BaseTableDescriptor<K,V,GuavaCacheTableDescriptor<K,V>>
jobConfig
- job configurationprotected void validate()
BaseTableDescriptor
validate
in class BaseTableDescriptor<K,V,GuavaCacheTableDescriptor<K,V>>