diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2008-05-06 13:52:12 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2008-05-06 13:52:12 +0000 |
commit | ab92f4ec859413b2d3612068dfb21d741fb389a3 (patch) | |
tree | 110ab1c9c6b08bd1acf40b1ac0e3192caa38cc93 /src/main/java/com/amazon/carbonado/repo/sleepycat | |
parent | 6087388aca5eb50054732c2f606fa21165e88b75 (diff) |
Code cleanup: add @Override annotations, remove unused imports, remove dead code and add @Deprecated annotations.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/sleepycat')
5 files changed, 30 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBCursor.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBCursor.java index b2a1f32..a0dfe38 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBCursor.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBCursor.java @@ -76,6 +76,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
public void close() throws FetchException {
try {
super.close();
@@ -84,6 +85,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
protected void release() throws FetchException {
try {
cursor_close();
@@ -92,6 +94,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
protected byte[] getCurrentKey() throws FetchException {
if (searchKey_getPartial()) {
throw new IllegalStateException();
@@ -99,6 +102,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { return searchKey_getDataCopy();
}
+ @Override
protected byte[] getCurrentValue() throws FetchException {
if (data_getPartial()) {
throw new IllegalStateException();
@@ -106,15 +110,18 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { return data_getDataCopy();
}
+ @Override
protected void disableKeyAndValue() {
searchKey_setPartial(true);
data_setPartial(true);
}
+ @Override
protected void disableValue() {
data_setPartial(true);
}
+ @Override
protected void enableKeyAndValue() throws FetchException {
searchKey_setPartial(false);
data_setPartial(false);
@@ -131,10 +138,12 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
protected S instantiateCurrent() throws FetchException {
return mStorage.instantiate(primaryKey_getData(), data_getData());
}
+ @Override
protected boolean toFirst() throws FetchException {
try {
return cursor_getFirst();
@@ -143,6 +152,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
protected boolean toFirst(byte[] key) throws FetchException {
try {
searchKey_setData(key);
@@ -152,6 +162,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
protected boolean toLast() throws FetchException {
try {
return cursor_getLast();
@@ -160,6 +171,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
protected boolean toLast(byte[] key) throws FetchException {
try {
// BDB cursor doesn't support "search for exact or less than", so
@@ -209,6 +221,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
protected boolean toNext() throws FetchException {
try {
return cursor_getNext();
@@ -217,6 +230,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { }
}
+ @Override
protected boolean toPrevious() throws FetchException {
try {
return cursor_getPrev();
@@ -254,6 +268,7 @@ abstract class BDBCursor<Txn, S extends Storable> extends RawCursor<S> { return newData;
}
+ @Override
protected void handleNoSuchElement() throws FetchException {
// Might not be any more elements because storage is closed.
mStorage.checkClosed();
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java index 6fd9cc1..eeb8e9a 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java @@ -160,6 +160,7 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> mFileNameMap = builder.getFileNameMap();
}
+ @Override
@SuppressWarnings("unchecked")
public <C extends Capability> C getCapability(Class<C> capabilityType) {
C cap = super.getCapability(capabilityType);
@@ -279,6 +280,7 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> close();
}
+ @Override
protected void shutdownHook() {
// Run any external shutdown logic that needs to happen before the
// databases and the environment are actually closed
@@ -327,10 +329,12 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> }
}
+ @Override
protected Log getLog() {
return mLog;
}
+ @Override
protected <S extends Storable> Storage createStorage(Class<S> type)
throws RepositoryException
{
@@ -341,6 +345,7 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> }
}
+ @Override
protected SequenceValueProducer createSequenceValueProducer(String name)
throws RepositoryException
{
@@ -528,10 +533,12 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> return mExTransformer.toRepositoryException(e);
}
+ @Override
protected final TransactionManager<Txn> transactionManager() {
return mTxnMgr;
}
+ @Override
protected final TransactionScope<Txn> localTransactionScope() {
return mTxnMgr.localScope();
}
@@ -575,6 +582,7 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> mMinutes = minutes;
}
+ @Override
public void run() {
try {
while (true) {
@@ -711,6 +719,7 @@ abstract class BDBRepository<Txn> extends AbstractRepository<Txn> mSleepInterval = sleepInterval;
}
+ @Override
public void run() {
while (true) {
try {
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java index 995fada..f60511f 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java @@ -748,6 +748,7 @@ public class BDBRepositoryBuilder extends AbstractRepositoryBuilder { return (long) (seconds * 1000000);
}
+ @Override
public void errorCheck(Collection<String> messages) throws ConfigurationException {
super.errorCheck(messages);
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 be5982b..45205c7 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java @@ -22,8 +22,6 @@ import java.util.Collection; import java.util.Collections;
import java.util.Map;
-import org.apache.commons.logging.LogFactory;
-
import org.cojen.classfile.TypeDesc;
import com.amazon.carbonado.Cursor;
diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java index 5e0af3b..1e613ca 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java @@ -45,14 +45,17 @@ class BDBTransactionManager<Txn> extends TransactionManager<Txn> { mRepositoryRef = new WeakReference<BDBRepository<Txn>>(repository);
}
+ @Override
protected IsolationLevel selectIsolationLevel(Transaction parent, IsolationLevel level) {
return repository().selectIsolationLevel(parent, level);
}
+ @Override
protected boolean supportsForUpdate() {
return true;
}
+ @Override
protected Txn createTxn(Txn parent, IsolationLevel level) throws Exception {
if (level == IsolationLevel.NONE) {
return null;
@@ -74,6 +77,7 @@ class BDBTransactionManager<Txn> extends TransactionManager<Txn> { }
}
+ @Override
protected boolean commitTxn(Txn txn) throws PersistException {
try {
repository().txn_commit(txn);
@@ -83,6 +87,7 @@ class BDBTransactionManager<Txn> extends TransactionManager<Txn> { }
}
+ @Override
protected void abortTxn(Txn txn) throws PersistException {
try {
repository().txn_abort(txn);
|