diff options
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/indexed')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java | 7 | ||||
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepositoryBuilder.java | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java index 4d6e371..59a359b 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java @@ -23,11 +23,12 @@ import java.util.Arrays; import java.util.Map;
import java.util.IdentityHashMap;
+import java.util.concurrent.atomic.AtomicReference;
+
import com.amazon.carbonado.Cursor;
import com.amazon.carbonado.IsolationLevel;
import com.amazon.carbonado.MalformedTypeException;
import com.amazon.carbonado.Repository;
-import static com.amazon.carbonado.RepositoryBuilder.RepositoryReference;
import com.amazon.carbonado.RepositoryException;
import com.amazon.carbonado.Storable;
import com.amazon.carbonado.Storage;
@@ -56,12 +57,12 @@ class IndexedRepository implements Repository, StorableInfoCapability,
IndexEntryAccessCapability
{
- private final RepositoryReference mRootRef;
+ private final AtomicReference<Repository> mRootRef;
private final Repository mRepository;
private final String mName;
private final Map<Class<?>, IndexedStorage<?>> mStorages;
- IndexedRepository(RepositoryReference rootRef, String name, Repository repository) {
+ IndexedRepository(AtomicReference<Repository> rootRef, String name, Repository repository) {
mRootRef = rootRef;
mRepository = repository;
mName = name;
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepositoryBuilder.java index f3ec04b..a1aa45e 100644 --- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepositoryBuilder.java @@ -20,6 +20,8 @@ package com.amazon.carbonado.repo.indexed; import java.util.Collection;
+import java.util.concurrent.atomic.AtomicReference;
+
import com.amazon.carbonado.ConfigurationException;
import com.amazon.carbonado.Repository;
import com.amazon.carbonado.RepositoryBuilder;
@@ -48,7 +50,7 @@ public class IndexedRepositoryBuilder extends AbstractRepositoryBuilder { public IndexedRepositoryBuilder() {
}
- public Repository build(RepositoryReference rootRef) throws RepositoryException {
+ public Repository build(AtomicReference<Repository> rootRef) throws RepositoryException {
assertReady();
Repository wrapped;
|