public class IndexedRepositoryBuilder extends AbstractRepositoryBuilder
In addition to supporting the capabilities of the wrapped repository, the following extra capabilities are supported:
Constructor and Description |
---|
IndexedRepositoryBuilder() |
Modifier and Type | Method and Description |
---|---|
Repository |
build(java.util.concurrent.atomic.AtomicReference<Repository> rootRef)
Builds a repository instance.
|
void |
errorCheck(java.util.Collection<java.lang.String> messages)
This method is called by assertReady, and subclasses must override to
perform custom checks.
|
double |
getIndexRepairThrottle()
Returns the throttle parameter used when indexes are added, dropped or
bulk repaired.
|
java.lang.String |
getName()
Returns the name of the repository.
|
RepositoryBuilder |
getWrappedRepository() |
boolean |
isAllClustered()
Returns true if all indexes should be identified as clustered.
|
boolean |
isIndexRepairEnabled() |
boolean |
isMaster()
Returns true if repository should assume the role of master, which is
true by default.
|
void |
setAllClustered(boolean clustered)
When all indexes are identified as clustered, the query analyzer treats
all indexes as performing equally well.
|
void |
setIndexRepairDiscardDuplicates(boolean discardDuplicates)
Set true to skip collisions during index repair, logging each as a
warning.
|
void |
setIndexRepairEnabled(boolean enabled)
By default, index repair is enabled.
|
void |
setIndexRepairThrottle(double desiredSpeed)
Sets the throttle parameter used when indexes are added, dropped or bulk
repaired.
|
void |
setIndexRepairVerifyOnly(boolean verifyOnly)
Set true to build and verify indexes, but don't apply any changes.
|
void |
setMaster(boolean b)
Set to false if repository should not assume the role of master.
|
void |
setName(java.lang.String name)
Set name for the repository, which is required.
|
void |
setStrictTriggers(boolean strict)
Set to true to require that index maintenance triggers use a "for update" transaction,
avoiding deadlocks and lock upgrade failures.
|
void |
setWrappedRepository(RepositoryBuilder repoBuilder)
Set the required wrapped respository, which must support the
IndexInfoCapability . |
addTriggerFactory, assertReady, build, getTriggerFactories, removeTriggerFactory
public Repository build(java.util.concurrent.atomic.AtomicReference<Repository> rootRef) throws RepositoryException
RepositoryBuilder
If 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 builtConfigurationException
- if there is a problem in the builder's configurationRepositoryException
- if there is a general problem opening the repositorypublic java.lang.String getName()
RepositoryBuilder
public void setName(java.lang.String name)
RepositoryBuilder
public boolean isMaster()
RepositoryBuilder
A 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.
ReplicatedRepositoryBuilder
public void setMaster(boolean b)
RepositoryBuilder
A 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.
ReplicatedRepositoryBuilder
public RepositoryBuilder getWrappedRepository()
public void setWrappedRepository(RepositoryBuilder repoBuilder)
IndexInfoCapability
.public boolean isIndexRepairEnabled()
setIndexRepairEnabled(boolean)
public void setIndexRepairEnabled(boolean enabled)
When index repair is disabled, the Storable is immediately available. This does have consequences, however. The set of indexes available for queries is defined by the intersection of the old and new index sets. The set of indexes that are kept up-to-date is defined by the union of the old and new index sets.
While index repair is disabled, another process can safely repair the indexes in the background. When it is complete, index repair can be enabled for this repository too.
public double getIndexRepairThrottle()
public void setIndexRepairThrottle(double desiredSpeed)
desiredSpeed
- 1.0 = perform work at full speed,
0.5 = perform work at half speed, 0.0 = fully suspend workpublic void setIndexRepairDiscardDuplicates(boolean discardDuplicates)
public void setIndexRepairVerifyOnly(boolean verifyOnly)
public boolean isAllClustered()
public void setAllClustered(boolean clustered)
public void setStrictTriggers(boolean strict)
public void errorCheck(java.util.Collection<java.lang.String> messages) throws ConfigurationException
AbstractRepositoryBuilder
super.errorCheck
as well.errorCheck
in class AbstractRepositoryBuilder
messages
- add any error messages to this listConfigurationException
- if error checking indirectly caused
another exceptionCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.