public abstract class PropertyStore extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
PropertyStore()
Default ctor.
|
| Modifier and Type | Method and Description |
|---|---|
PropertyMap |
deserialize(byte[] bytes,
Function<String,PropertySchema> getSchema)
Deserializes a map from a byte array.
|
protected abstract boolean |
dropProperties(String mapKey)
Drops a property map.
|
abstract UUID |
fetchDigest(String mapKey)
Fetches a property map digest.
|
abstract PropertyMap |
fetchProperties(String mapKey,
Function<String,PropertySchema> getSchema)
Fetches a property map.
|
abstract boolean |
renameProperties(String mapKey,
String newKey)
Renames a property map.
|
void |
saveProperties(Iterator<Map.Entry<String,PropertyMap>> save)
Persists an iterator property map.
|
protected abstract void |
saveProperties(String mapKey,
PropertyMap map)
Persists a property map.
|
abstract Map<String,UUID> |
selectDigest(String keyPrefix,
Predicate<String> keyFilter)
Fetches a map of property maps digest keyed by their name.
|
abstract Map<String,PropertyMap> |
selectProperties(String keyPrefix,
Predicate<String> keyFilter,
Function<String,PropertySchema> getSchema)
Fetches a map of property maps.
|
byte[] |
serialize(PropertyMap map)
Serializes a map as a byte array.
|
public abstract PropertyMap fetchProperties(String mapKey, Function<String,PropertySchema> getSchema)
mapKey - the map keygetSchema - the method to retrieve a schema if the map needs to be createdpublic abstract Map<String,PropertyMap> selectProperties(String keyPrefix, Predicate<String> keyFilter, Function<String,PropertySchema> getSchema)
keyPrefix - the map key prefixkeyFilter - a filter for map keysgetSchema - the method to retrieve a schema if the map needs to be createdpublic abstract UUID fetchDigest(String mapKey)
mapKey - the map keypublic abstract Map<String,UUID> selectDigest(String keyPrefix, Predicate<String> keyFilter)
keyPrefix - the map key prefixkeyFilter - a filter for map keysprotected abstract void saveProperties(String mapKey, PropertyMap map)
mapKey - the map keymap - the map instanceprotected abstract boolean dropProperties(String mapKey)
mapKey - the map keypublic abstract boolean renameProperties(String mapKey, String newKey)
mapKey - the map source keynewKey - the new target keypublic void saveProperties(Iterator<Map.Entry<String,PropertyMap>> save)
May be useful to override to use one transaction.
save - the iterator on pairs for map key, property mappublic byte[] serialize(PropertyMap map)
map - the (nonnull) map to writepublic PropertyMap deserialize(byte[] bytes, Function<String,PropertySchema> getSchema)
bytes - the byte arrayCopyright © 2024 The Apache Software Foundation. All rights reserved.