From b66fb3db6951b2b6d3ace72ca3e197c7c2048e86 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Thu, 18 Dec 2008 20:58:00 +0000 Subject: Fixes for excessive class generation and memory usage when opening multiple repositories. --- .../java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo/sleepycat') 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 implements Storage, Storag private final Class mType; /** Does most of the work in generating storables, used for preparing and querying */ - private StorableCodec mStorableCodec; + StorableCodec mStorableCodec; /** * Reference to an instance of Proxy, defined in this class, which binds @@ -135,7 +136,7 @@ abstract class BDBStorage implements Storage, Storag { mRepository = repository; mType = type; - mRawSupport = new Support(repository, this); + mRawSupport = new Support(repository, this); mTriggerManager = new TriggerManager(); try { // Ask if any lobs via static method first, to prevent stack @@ -1009,7 +1010,7 @@ abstract class BDBStorage implements Storage, 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 implements RawSupport { + private class Support implements RawSupport { private final BDBRepository mRepository; private final BDBStorage mStorage; private Map> mProperties; @@ -1128,6 +1129,10 @@ abstract class BDBStorage implements Storage, 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 { -- cgit v1.2.3