summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/repo/sleepycat
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-12-18 20:58:00 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-12-18 20:58:00 +0000
commitb66fb3db6951b2b6d3ace72ca3e197c7c2048e86 (patch)
treee5d9c0c6819f01b8917dcfb8884e07a3c8a9567b /src/main/java/com/amazon/carbonado/repo/sleepycat
parentc8133fcabf7a28b40f6bc8e4e4df8baf156b2f0a (diff)
Fixes for excessive class generation and memory usage when opening multiple repositories.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/sleepycat')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java
index f4a010b..1733167 100644
--- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java
+++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java
@@ -24,6 +24,7 @@ import java.util.Map;
import org.cojen.classfile.TypeDesc;
+import com.amazon.carbonado.CorruptEncodingException;
import com.amazon.carbonado.Cursor;
import com.amazon.carbonado.FetchDeadlockException;
import com.amazon.carbonado.FetchException;
@@ -104,7 +105,7 @@ abstract class BDBStorage<Txn, S extends Storable> implements Storage<S>, Storag
private final Class<S> mType;
/** Does most of the work in generating storables, used for preparing and querying */
- private StorableCodec<S> mStorableCodec;
+ StorableCodec<S> mStorableCodec;
/**
* Reference to an instance of Proxy, defined in this class, which binds
@@ -135,7 +136,7 @@ abstract class BDBStorage<Txn, S extends Storable> implements Storage<S>, Storag
{
mRepository = repository;
mType = type;
- mRawSupport = new Support<Txn, S>(repository, this);
+ mRawSupport = new Support(repository, this);
mTriggerManager = new TriggerManager<S>();
try {
// Ask if any lobs via static method first, to prevent stack
@@ -1009,7 +1010,7 @@ abstract class BDBStorage<Txn, S extends Storable> implements Storage<S>, Storag
// Note: BDBStorage could just implement the RawSupport interface, but
// then these hidden methods would be public. A simple cast of Storage to
// RawSupport would expose them.
- private static class Support<Txn, S extends Storable> implements RawSupport<S> {
+ private class Support implements RawSupport<S> {
private final BDBRepository<Txn> mRepository;
private final BDBStorage<Txn, S> mStorage;
private Map<String, ? extends StorableProperty<S>> mProperties;
@@ -1128,6 +1129,10 @@ abstract class BDBStorage<Txn, S extends Storable> implements Storage<S>, Storag
return mStorage.getLocator(clob);
}
+ public void decode(S dest, int generation, byte[] data) throws CorruptEncodingException {
+ mStorableCodec.decode(dest, generation, data);
+ }
+
public SequenceValueProducer getSequenceValueProducer(String name)
throws PersistException
{