|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.loader.AbstractCacheLoader org.jboss.cache.loader.s3.S3CacheLoader
@ThreadSafe public class S3CacheLoader
Uses the Amazon S3 service for storage. See http://aws.amazon.com/ for information. Does not support transaction isolation.
Data is stored in a single bucket location. The FQN comprises the key of the storage, the data the data itself. Internal structure:A/ B/_rootchild C/_rootchild/_child1 C/_rootchild/_child2 C/_rootchild/_child3 B/_root2The FQN component type is either prefixed with a _ for String, or a primitive type prefix. All put and many remove operations require fetching and merging data before storing data, which increases latency. This fetching can be turned off. See
S3LoaderConfig.getOptimize()
.
Parent nodes are added to the store as needed.
For example, when doing a put("/a/b/c"), the nodes "/a/b" and "/a" are created
if they do not exist. To prevent unnecessary checks of the store,
a local cache is kept of these "parent nodes". With multiple sites removing
parent nodes, this can potentially need to inconsistencies. To disable caching,
set S3LoaderConfig.setParentCache(java.lang.String)
to false.
Field Summary |
---|
Fields inherited from class org.jboss.cache.loader.AbstractCacheLoader |
---|
buddyFqnTransformer, cache, regionManager, transactions |
Constructor Summary | |
---|---|
S3CacheLoader()
|
Method Summary | |
---|---|
boolean |
exists(Fqn name)
Returns whether the given node exists. |
Map |
get(Fqn name)
Returns a map containing all key-value pairs for the given FQN, or null if the node is not present. |
Set<String> |
getChildrenNames(Fqn name)
Returns an unmodifiable set of relative children names, or returns null if the parent node is not found or if no children are found. |
CacheLoaderConfig.IndividualCacheLoaderConfig |
getConfig()
Gets the configuration. |
void |
put(Fqn name,
Map<Object,Object> values)
Stores a map of key-values for a given FQN, but does not delete existing key-value pairs (that is, it does not erase). |
Object |
put(Fqn name,
Object key,
Object value)
Stores a single FQN-key-value record. |
void |
remove(Fqn name)
Deletes the node for a given FQN and all its descendant nodes. |
Object |
remove(Fqn name,
Object key)
Removes a key from an FQN. |
void |
removeData(Fqn name)
Clears the map for the given node, but does not remove the node. |
void |
setConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
Sets the configuration string for this cache loader. |
void |
start()
This cache loader is stateless, but as part of initialization access the service. |
void |
stop()
Closes the connection; shuts down the HTTP connection pool. |
Methods inherited from class org.jboss.cache.loader.AbstractCacheLoader |
---|
commit, create, destroy, doMarshall, doUnmarshall, getMarshaller, getNodeDataList, loadEntireState, loadState, loadStateHelper, move, prepare, put, put, regionAwareMarshall, regionAwareUnmarshall, rollback, setCache, setRegionManager, storeEntireState, storeState, storeStateHelper |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public S3CacheLoader()
Method Detail |
---|
public void start() throws Exception
start
in interface Lifecycle
start
in class AbstractCacheLoader
Exception
public void stop()
stop
in interface Lifecycle
stop
in class AbstractCacheLoader
public void setConfig(CacheLoaderConfig.IndividualCacheLoaderConfig base)
base
- May be an instance of the CacheLoaderConfig.IndividualCacheLoaderConfig
base
class, in which case the cache loader should use the
PluggableConfigurationComponent.getProperties()
method to find configuration information. Alternatively,
may be a type-specific subclass of CacheLoaderConfig.IndividualCacheLoaderConfig
,
if there is one.public CacheLoaderConfig.IndividualCacheLoaderConfig getConfig()
CacheLoader
CacheLoaderConfig.IndividualCacheLoaderConfig
object.public Set<String> getChildrenNames(Fqn name) throws Exception
name
- The Fqn
of the parent
Exception
public Map get(Fqn name) throws Exception
name
- the Fqn
to search for.
public boolean exists(Fqn name) throws Exception
Exception
public Object put(Fqn name, Object key, Object value) throws Exception
Exception
public Object remove(Fqn name, Object key) throws Exception
Exception
public void put(Fqn name, Map<Object,Object> values) throws Exception
name
- The fully qualified name of the nodevalues
- A Map of attributes. Can be null
Exception
public void remove(Fqn name) throws Exception
name
- the Fqn
of the node
Exception
public void removeData(Fqn name) throws Exception
name
- the Fqn
of the node
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |