|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.amazon.carbonado.spi.AbstractRepositoryBuilder
com.amazon.carbonado.repo.map.MapRepositoryBuilder
public class MapRepositoryBuilder
Volatile repository implementation backed by a concurrent map. Locks used by repository are coarse, much like table locks. Loads and queries acquire read locks, and modifications acquire write locks. Within transactions, loads and queries always acquire upgradable locks, to reduce the likelihood of deadlock.
This repository supports transactions, which also may be nested. Supported isolation levels are read committed and serializable. Read uncommitted is promoted to read committed, and repeatable read is promoted to serializable.
The following extra capabilities are supported:
Note: This repository uses concurrent navigable map classes, which became available in JDK1.6.
| Constructor Summary | |
|---|---|
MapRepositoryBuilder()
|
|
| Method Summary | |
|---|---|
Repository |
build(AtomicReference<Repository> rootRef)
Builds a repository instance. |
int |
getLockTimeout()
Returns the lock timeout. |
TimeUnit |
getLockTimeoutUnit()
Returns the lock timeout unit. |
String |
getName()
Returns the name of the repository. |
boolean |
isMaster()
Returns true if repository should assume the role of master, which is true by default. |
static Repository |
newRepository()
Convenience method to build a new MapRepository. |
void |
setLockTimeout(int timeout,
TimeUnit unit)
Set the lock timeout. |
void |
setLockTimeoutMillis(int timeout)
Set the lock timeout, in milliseconds. |
void |
setMaster(boolean b)
Set to false if repository should not assume the role of master. |
void |
setName(String name)
Set name for the repository, which is required. |
| Methods inherited from class com.amazon.carbonado.spi.AbstractRepositoryBuilder |
|---|
addTriggerFactory, assertReady, build, errorCheck, getTriggerFactories, removeTriggerFactory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapRepositoryBuilder()
| Method Detail |
|---|
public static Repository newRepository()
public Repository build(AtomicReference<Repository> rootRef)
throws RepositoryException
RepositoryBuilderIf the repository is being wrapped by a parent repository, the child repository will need to know this fact for some operations to work correctly. Since the parent repository is not built yet, a reference is used instead.
rootRef - reference to root parent repository, to be set by
parent repository upon being built
ConfigurationException - if there is a problem in the builder's configuration
RepositoryException - if there is a general problem opening the repositorypublic String getName()
RepositoryBuilder
public void setName(String name)
RepositoryBuilder
public boolean isMaster()
RepositoryBuilderA master repository is responsible for version and
sequence properties. For insert operations, a master
repository must set these properties if they are uninitialized. For
updates, the version property is checked to see if an OptimisticLockException should be thrown.
ReplicatedRepositoryBuilderpublic void setMaster(boolean b)
RepositoryBuilderA master repository is responsible for version and
sequence properties. For insert operations, a master
repository must set these properties if they are uninitialized. For
updates, the version property is checked to see if an OptimisticLockException should be thrown.
ReplicatedRepositoryBuilderpublic void setLockTimeoutMillis(int timeout)
public void setLockTimeout(int timeout,
TimeUnit unit)
public int getLockTimeout()
public TimeUnit getLockTimeoutUnit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||