public class CachingPropertyStore extends PropertyStore
Before a map is returned, a check against the stored corresponding digest is performed to avoid using stale data.
| Modifier and Type | Field and Description |
|---|---|
protected SoftCache<String,PropertyMap> |
maps |
protected PropertyStore |
store |
| Constructor and Description |
|---|
CachingPropertyStore(PropertyStore wrap) |
CachingPropertyStore(PropertyStore wrap,
org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache() |
protected boolean |
dropProperties(String mapKey)
Drops a property map.
|
UUID |
fetchDigest(String mapKey)
Fetches a property map digest.
|
PropertyMap |
fetchProperties(String mapKey,
Function<String,PropertySchema> getSchema)
Fetches a property map.
|
boolean |
renameProperties(String mapKey,
String newKey)
Renames a property map.
|
void |
saveProperties(String mapKey,
PropertyMap map)
Persists a property map.
|
Map<String,UUID> |
selectDigest(String keyPrefix,
Predicate<String> keyFilter)
Fetches a map of property maps digest keyed by their name.
|
Map<String,PropertyMap> |
selectProperties(String keyPrefix,
Predicate<String> keyFilter,
Function<String,PropertySchema> getSchema)
Fetches a map of property maps.
|
deserialize, saveProperties, serializeprotected final SoftCache<String,PropertyMap> maps
protected final PropertyStore store
public CachingPropertyStore(PropertyStore wrap)
public CachingPropertyStore(PropertyStore wrap, org.apache.hadoop.conf.Configuration conf)
public void clearCache()
public UUID fetchDigest(String mapKey)
PropertyStorefetchDigest in class PropertyStoremapKey - the map keypublic Map<String,UUID> selectDigest(String keyPrefix, Predicate<String> keyFilter)
PropertyStoreselectDigest in class PropertyStorekeyPrefix - the map key prefixkeyFilter - a filter for map keyspublic PropertyMap fetchProperties(String mapKey, Function<String,PropertySchema> getSchema)
PropertyStorefetchProperties in class PropertyStoremapKey - the map keygetSchema - the method to retrieve a schema if the map needs to be createdpublic Map<String,PropertyMap> selectProperties(String keyPrefix, Predicate<String> keyFilter, Function<String,PropertySchema> getSchema)
PropertyStoreselectProperties in class PropertyStorekeyPrefix - the map key prefixkeyFilter - a filter for map keysgetSchema - the method to retrieve a schema if the map needs to be createdpublic void saveProperties(String mapKey, PropertyMap map)
PropertyStoresaveProperties in class PropertyStoremapKey - the map keymap - the map instanceprotected boolean dropProperties(String mapKey)
PropertyStoredropProperties in class PropertyStoremapKey - the map keypublic boolean renameProperties(String mapKey, String newKey)
PropertyStorerenameProperties in class PropertyStoremapKey - the map source keynewKey - the new target keyCopyright © 2024 The Apache Software Foundation. All rights reserved.