|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sleepycat.bdb.collection.StoredCollections
This class consists exclusively of static methods that operate on or return stored collections. It contains methods for changing certain properties of a collection. Because collection properties are immutable, these methods always return a new collection reference. This allows stored collections to be used safely by multiple threads. Note that creating the new collection reference is not expensive and creates only two new objects.
When a collection is created with a particular property, all collections and iterators derieved from that collection will inherit the property. For example, if a dirty-read Map is created then calls to subMap(), values(), entrySet(), and keySet() will create dirty-read collections also.
Dirty-Read Methods names beginning with dirtyRead create a new
dirty-read container from a given stored container. When dirty-read is
enabled, data will be read that has been modified by another transaction but
not committed. Using dirty-read can improve concurrency since reading will
not wait for other transactions to complete. For a non-transactional
container (when StoredContainer.isTransactional()
returns false),
dirty-read has no effect. If StoredContainer.isDirtyReadAllowed()
returns false, dirty-read also has no effect. If dirty-ready is enabled
(and allowed) for a container, StoredContainer.isDirtyReadEnabled()
will return true. Dirty-read is disabled by default for a container.
Auto-Commit Methods names beginning with autoCommit create a new
auto-commit container from a given stored container. If auto-commit is
enabled for a container (or for its DbEnv
), a transaction will be
started and committed automatically for each write operation when no
transaction is already active. Auto-commit only applies to container
methods. It does not apply to iterator methods and these always require an
active transaction. For a non-transactional container (where StoredContainer.isTransactional()
returns false) auto-commit has no effect.
If auto-commit is enabled for a transactional container or its environment,
StoredContainer.isAutoCommit()
will return true. Auto-commit is
disabled by default for a container but may be enabled for an entire
environment using DbEnv.setFlags(int, boolean)
.
Method Summary | |
static Collection |
autoCommitCollection(Collection storedCollection)
Creates a auto-commit collection from a given stored collection. |
static List |
autoCommitList(List storedList)
Creates a auto-commit list from a given stored list. |
static Map |
autoCommitMap(Map storedMap)
Creates a auto-commit map from a given stored map. |
static Set |
autoCommitSet(Set storedSet)
Creates a auto-commit set from a given stored set. |
static SortedMap |
autoCommitSortedMap(SortedMap storedSortedMap)
Creates a auto-commit sorted map from a given stored sorted map. |
static SortedSet |
autoCommitSortedSet(SortedSet storedSortedSet)
Creates a auto-commit sorted set from a given stored sorted set. |
static Collection |
dirtyReadCollection(Collection storedCollection)
Creates a dirty-read collection from a given stored collection. |
static List |
dirtyReadList(List storedList)
Creates a dirty-read list from a given stored list. |
static Map |
dirtyReadMap(Map storedMap)
Creates a dirty-read map from a given stored map. |
static Set |
dirtyReadSet(Set storedSet)
Creates a dirty-read set from a given stored set. |
static SortedMap |
dirtyReadSortedMap(SortedMap storedSortedMap)
Creates a dirty-read sorted map from a given stored sorted map. |
static SortedSet |
dirtyReadSortedSet(SortedSet storedSortedSet)
Creates a dirty-read sorted set from a given stored sorted set. |
static Iterator |
iterator(Iterator storedIterator)
Clones a stored iterator preserving its current position. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Collection dirtyReadCollection(Collection storedCollection)
storedCollection
- the base collection.
ClassCastException
- if the given container is not a
StoredContainer.public static List dirtyReadList(List storedList)
storedList
- the base list.
ClassCastException
- if the given container is not a
StoredContainer.public static Map dirtyReadMap(Map storedMap)
storedMap
- the base map.
ClassCastException
- if the given container is not a
StoredContainer.public static Set dirtyReadSet(Set storedSet)
storedSet
- the base set.
ClassCastException
- if the given container is not a
StoredContainer.public static SortedMap dirtyReadSortedMap(SortedMap storedSortedMap)
storedSortedMap
- the base map.
ClassCastException
- if the given container is not a
StoredContainer.public static SortedSet dirtyReadSortedSet(SortedSet storedSortedSet)
storedSortedSet
- the base set.
ClassCastException
- if the given container is not a
StoredContainer.public static Collection autoCommitCollection(Collection storedCollection)
storedCollection
- the base collection.
ClassCastException
- if the given container is not a
StoredContainer.public static List autoCommitList(List storedList)
storedList
- the base list.
ClassCastException
- if the given container is not a
StoredContainer.public static Map autoCommitMap(Map storedMap)
storedMap
- the base map.
ClassCastException
- if the given container is not a
StoredContainer.public static Set autoCommitSet(Set storedSet)
storedSet
- the base set.
ClassCastException
- if the given container is not a
StoredContainer.public static SortedMap autoCommitSortedMap(SortedMap storedSortedMap)
storedSortedMap
- the base map.
ClassCastException
- if the given container is not a
StoredContainer.public static SortedSet autoCommitSortedSet(SortedSet storedSortedSet)
storedSortedSet
- the base set.
ClassCastException
- if the given container is not a
StoredContainer.public static Iterator iterator(Iterator storedIterator)
storedIterator
- an iterator to clone.
StoredIterator
having the same position as the
given iterator.
ClassCastException
- if the given iterator is not a
StoredIterator.
|
Berkeley DB version 4.2.52 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |