summaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-05-06 13:52:12 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-05-06 13:52:12 +0000
commitab92f4ec859413b2d3612068dfb21d741fb389a3 (patch)
tree110ab1c9c6b08bd1acf40b1ac0e3192caa38cc93 /src/main/java/com
parent6087388aca5eb50054732c2f606fa21165e88b75 (diff)
Code cleanup: add @Override annotations, remove unused imports, remove dead code and add @Deprecated annotations.
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/amazon/carbonado/MalformedArgumentException.java1
-rw-r--r--src/main/java/com/amazon/carbonado/OptimisticLockException.java6
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java6
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java8
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/SortedCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java1
-rw-r--r--src/main/java/com/amazon/carbonado/filter/AndFilter.java9
-rw-r--r--src/main/java/com/amazon/carbonado/filter/BinaryOpFilter.java7
-rw-r--r--src/main/java/com/amazon/carbonado/filter/ClosedFilter.java16
-rw-r--r--src/main/java/com/amazon/carbonado/filter/ExistsFilter.java15
-rw-r--r--src/main/java/com/amazon/carbonado/filter/Filter.java9
-rw-r--r--src/main/java/com/amazon/carbonado/filter/OpenFilter.java16
-rw-r--r--src/main/java/com/amazon/carbonado/filter/OrFilter.java9
-rw-r--r--src/main/java/com/amazon/carbonado/filter/PropertyFilter.java13
-rw-r--r--src/main/java/com/amazon/carbonado/filter/PropertyFilterList.java4
-rw-r--r--src/main/java/com/amazon/carbonado/filter/RelOp.java1
-rw-r--r--src/main/java/com/amazon/carbonado/gen/StorableGenerator.java22
-rw-r--r--src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java1
-rw-r--r--src/main/java/com/amazon/carbonado/info/OrderedProperty.java3
-rw-r--r--src/main/java/com/amazon/carbonado/info/StorableIntrospector.java22
-rw-r--r--src/main/java/com/amazon/carbonado/lob/CharArrayClob.java1
-rw-r--r--src/main/java/com/amazon/carbonado/lob/StringClob.java2
-rw-r--r--src/main/java/com/amazon/carbonado/qe/CompositeScore.java1
-rw-r--r--src/main/java/com/amazon/carbonado/qe/EmptyQuery.java1
-rw-r--r--src/main/java/com/amazon/carbonado/qe/FilteringScore.java4
-rw-r--r--src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java1
-rw-r--r--src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/qe/OrderingList.java6
-rw-r--r--src/main/java/com/amazon/carbonado/qe/OrderingScore.java1
-rw-r--r--src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java7
-rw-r--r--src/main/java/com/amazon/carbonado/qe/QueryEngine.java5
-rw-r--r--src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java2
-rw-r--r--src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java1
-rw-r--r--src/main/java/com/amazon/carbonado/raw/RawCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/raw/RawStorableGenerator.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepositoryBuilder.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java3
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/CompositeStatement.java2
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/H2ExceptionTransformer.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java3
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java4
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java6
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java9
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java9
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java5
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JoinNode.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/LiteralStatement.java2
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/MysqlExceptionTransformer.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/NullablePropertyStatement.java2
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/OracleExceptionTransformer.java2
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/OracleSupportStrategy.java10
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/SQLStatement.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java3
-rw-r--r--src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/map/MapCursor.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/map/MapRepository.java5
-rw-r--r--src/main/java/com/amazon/carbonado/repo/map/MapStorage.java10
-rw-r--r--src/main/java/com/amazon/carbonado/repo/map/MapTransaction.java4
-rw-r--r--src/main/java/com/amazon/carbonado/repo/map/MapTransactionManager.java5
-rw-r--r--src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java2
-rw-r--r--src/main/java/com/amazon/carbonado/repo/replicated/BlobReplicationTrigger.java8
-rw-r--r--src/main/java/com/amazon/carbonado/repo/replicated/ClobReplicationTrigger.java6
-rw-r--r--src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java8
-rw-r--r--src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepositoryBuilder.java2
-rw-r--r--src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBCursor.java15
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepository.java9
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBRepositoryBuilder.java1
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java2
-rw-r--r--src/main/java/com/amazon/carbonado/repo/sleepycat/BDBTransactionManager.java5
-rw-r--r--src/main/java/com/amazon/carbonado/sequence/SequenceValueGenerator.java1
-rw-r--r--src/main/java/com/amazon/carbonado/sequence/SequenceValueProducerPool.java2
-rw-r--r--src/main/java/com/amazon/carbonado/spi/AbstractRepository.java5
-rw-r--r--src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java3
-rw-r--r--src/main/java/com/amazon/carbonado/spi/BelatedStorageCreator.java3
-rw-r--r--src/main/java/com/amazon/carbonado/spi/BlobProperty.java2
-rw-r--r--src/main/java/com/amazon/carbonado/spi/ClobProperty.java2
-rw-r--r--src/main/java/com/amazon/carbonado/spi/IndexInfoImpl.java1
-rw-r--r--src/main/java/com/amazon/carbonado/spi/LobEngine.java2
-rw-r--r--src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java7
-rw-r--r--src/main/java/com/amazon/carbonado/spi/RAFInputStream.java5
-rw-r--r--src/main/java/com/amazon/carbonado/spi/RAFOutputStream.java4
-rw-r--r--src/main/java/com/amazon/carbonado/spi/RepairExecutor.java2
-rw-r--r--src/main/java/com/amazon/carbonado/spi/StoragePool.java1
-rw-r--r--src/main/java/com/amazon/carbonado/spi/StoredSequence.java1
-rw-r--r--src/main/java/com/amazon/carbonado/synthetic/SyntheticProperty.java3
-rw-r--r--src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java2
-rw-r--r--src/main/java/com/amazon/carbonado/util/AnnotationBuilder.java24
-rw-r--r--src/main/java/com/amazon/carbonado/util/AnnotationDescPrinter.java24
-rw-r--r--src/main/java/com/amazon/carbonado/util/AnnotationPrinter.java24
-rw-r--r--src/main/java/com/amazon/carbonado/util/TaskQueueThread.java1
-rw-r--r--src/main/java/com/amazon/carbonado/util/WeakReentrantLockPool.java1
-rw-r--r--src/main/java/com/amazon/carbonado/util/WeakReentrantReadWriteLockPool.java1
103 files changed, 414 insertions, 72 deletions
diff --git a/src/main/java/com/amazon/carbonado/MalformedArgumentException.java b/src/main/java/com/amazon/carbonado/MalformedArgumentException.java
index 265974c..5a9e2c1 100644
--- a/src/main/java/com/amazon/carbonado/MalformedArgumentException.java
+++ b/src/main/java/com/amazon/carbonado/MalformedArgumentException.java
@@ -48,6 +48,7 @@ public abstract class MalformedArgumentException extends IllegalArgumentExceptio
mMessages = Collections.unmodifiableList(messages);
}
+ @Override
public String getMessage() {
if (mMessages == null || mMessages.size() == 0) {
return super.getMessage();
diff --git a/src/main/java/com/amazon/carbonado/OptimisticLockException.java b/src/main/java/com/amazon/carbonado/OptimisticLockException.java
index aa54c1c..f727ab9 100644
--- a/src/main/java/com/amazon/carbonado/OptimisticLockException.java
+++ b/src/main/java/com/amazon/carbonado/OptimisticLockException.java
@@ -138,11 +138,7 @@ public class OptimisticLockException extends PersistException {
}
if (s != null) {
- if (message == null) {
- message = s.toStringKeyOnly();
- } else {
- message = message + ": " + s.toStringKeyOnly();
- }
+ message = message + ": " + s.toStringKeyOnly();
}
return message;
diff --git a/src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java b/src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java
index 59cb941..93b7bc0 100644
--- a/src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java
+++ b/src/main/java/com/amazon/carbonado/cursor/FilteredCursor.java
@@ -153,6 +153,7 @@ public abstract class FilteredCursor<S> extends AbstractCursor<S> {
throw new NoSuchElementException();
}
+ @Override
public int skipNext(int amount) throws FetchException {
if (amount <= 0) {
if (amount < 0) {
diff --git a/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java b/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java
index 4e58361..c7dec07 100644
--- a/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java
+++ b/src/main/java/com/amazon/carbonado/cursor/FilteredCursorGenerator.java
@@ -18,7 +18,6 @@
package com.amazon.carbonado.cursor;
-import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -217,6 +216,7 @@ class FilteredCursorGenerator {
Validator() {
}
+ @Override
public Object visit(PropertyFilter<S> filter, Object param) {
ChainedProperty<S> chained = filter.getChainedProperty();
@@ -304,6 +304,7 @@ class FilteredCursorGenerator {
return mSubFilters;
}
+ @Override
public Object visit(OrFilter<S> filter, Object param) {
Label failLocation = mIsAllowedBuilder.createLabel();
// Inherit success location to short-circuit if 'or' test succeeds.
@@ -315,6 +316,7 @@ class FilteredCursorGenerator {
return null;
}
+ @Override
public Object visit(AndFilter<S> filter, Object param) {
Label successLocation = mIsAllowedBuilder.createLabel();
// Inherit fail location to short-circuit if 'and' test fails.
@@ -326,6 +328,7 @@ class FilteredCursorGenerator {
return null;
}
+ @Override
public Object visit(PropertyFilter<S> filter, Object param) {
TypeDesc type = TypeDesc.forClass(filter.getChainedProperty().getType());
String fieldName = addFilterField(filter, type);
@@ -334,6 +337,7 @@ class FilteredCursorGenerator {
return null;
}
+ @Override
public Object visit(ExistsFilter<S> filter, Object param) {
// Load join property value to stack.
CodeBuilder b = mIsAllowedBuilder;
diff --git a/src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java b/src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java
index 6d9afc5..135d817 100644
--- a/src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java
+++ b/src/main/java/com/amazon/carbonado/cursor/GroupedCursor.java
@@ -194,6 +194,7 @@ public abstract class GroupedCursor<S, G> extends AbstractCursor<G> {
throw new NoSuchElementException();
}
+ @Override
public int skipNext(int amount) throws FetchException {
if (amount <= 0) {
if (amount < 0) {
diff --git a/src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java b/src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java
index b02f9bf..31359e8 100644
--- a/src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java
+++ b/src/main/java/com/amazon/carbonado/cursor/MergeSortBuffer.java
@@ -189,6 +189,7 @@ public class MergeSortBuffer<S extends Storable> extends AbstractCollection<S>
mComparator = comparator;
}
+ @Override
public boolean add(S storable) {
if (mPreparer == null) {
mPreparer = new FromStorable(storable);
@@ -307,10 +308,12 @@ public class MergeSortBuffer<S extends Storable> extends AbstractCollection<S>
return true;
}
+ @Override
public int size() {
return mTotalSize;
}
+ @Override
public Iterator<S> iterator() {
return iterator(mFilesInUse);
}
@@ -342,6 +345,7 @@ public class MergeSortBuffer<S extends Storable> extends AbstractCollection<S>
return new Merger<S>(pq);
}
+ @Override
public void clear() {
if (mPreparer instanceof FromStorable) {
mPreparer = null;
@@ -474,6 +478,7 @@ public class MergeSortBuffer<S extends Storable> extends AbstractCollection<S>
mSize = size;
}
+ @Override
S peek() {
int pos = mPos;
if (pos >= mSize) {
@@ -482,6 +487,7 @@ public class MergeSortBuffer<S extends Storable> extends AbstractCollection<S>
return mArray[pos];
}
+ @Override
S next() {
int pos = mPos;
if (pos >= mSize) {
@@ -508,6 +514,7 @@ public class MergeSortBuffer<S extends Storable> extends AbstractCollection<S>
mIn = in;
}
+ @Override
S peek() {
if (mNext != null) {
return mNext;
@@ -528,6 +535,7 @@ public class MergeSortBuffer<S extends Storable> extends AbstractCollection<S>
return mNext;
}
+ @Override
S next() {
S next = peek();
mNext = null;
diff --git a/src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java b/src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java
index 4b4a25a..fafb55f 100644
--- a/src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java
+++ b/src/main/java/com/amazon/carbonado/cursor/MultiTransformedCursor.java
@@ -114,6 +114,7 @@ public abstract class MultiTransformedCursor<S, T> extends AbstractCursor<T> {
throw new NoSuchElementException();
}
+ @Override
public int skipNext(int amount) throws FetchException {
if (amount <= 0) {
if (amount < 0) {
diff --git a/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java b/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java
index 2a05493..e4e7b68 100644
--- a/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java
+++ b/src/main/java/com/amazon/carbonado/cursor/SortedCursor.java
@@ -341,6 +341,7 @@ public class SortedCursor<S> extends AbstractCursor<S> {
}
}
+ @Override
public int skipNext(int amount) throws FetchException {
if (amount <= 0) {
if (amount < 0) {
diff --git a/src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java b/src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java
index d108d95..a349782 100644
--- a/src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java
+++ b/src/main/java/com/amazon/carbonado/cursor/ThrottledCursor.java
@@ -87,6 +87,7 @@ public class ThrottledCursor<S> extends AbstractCursor<S> {
}
}
+ @Override
public int skipNext(int amount) throws FetchException {
if (amount <= 0) {
if (amount < 0) {
diff --git a/src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java b/src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java
index 46dedd1..199cc84 100644
--- a/src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java
+++ b/src/main/java/com/amazon/carbonado/cursor/TransformedCursor.java
@@ -103,6 +103,7 @@ public abstract class TransformedCursor<S, T> extends AbstractCursor<T> {
throw new NoSuchElementException();
}
+ @Override
public int skipNext(int amount) throws FetchException {
if (amount <= 0) {
if (amount < 0) {
diff --git a/src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java b/src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java
index 442d45c..32bf4e0 100644
--- a/src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java
+++ b/src/main/java/com/amazon/carbonado/cursor/WorkFilePool.java
@@ -155,6 +155,7 @@ class WorkFilePool {
String threadName = "MergeSortBuffer shutdown (" + tempDir + ')';
mShutdownHook = new Thread(threadName) {
+ @Override
public void run() {
// Notify users of work files and wait for them to close.
synchronized (mWorkFileUsers) {
diff --git a/src/main/java/com/amazon/carbonado/filter/AndFilter.java b/src/main/java/com/amazon/carbonado/filter/AndFilter.java
index 09d0d9f..6da6896 100644
--- a/src/main/java/com/amazon/carbonado/filter/AndFilter.java
+++ b/src/main/java/com/amazon/carbonado/filter/AndFilter.java
@@ -49,14 +49,17 @@ public class AndFilter<S extends Storable> extends BinaryOpFilter<S> {
super(left, right);
}
+ @Override
public Filter<S> not() {
return mLeft.not().or(mRight.not());
}
+ @Override
public <R, P> R accept(Visitor<S, R, P> visitor, P param) {
return visitor.visit(this, param);
}
+ @Override
public Filter<S> unbind() {
if (!isBound()) {
return this;
@@ -64,6 +67,7 @@ public class AndFilter<S extends Storable> extends BinaryOpFilter<S> {
return mLeft.unbind().and(mRight.unbind());
}
+ @Override
<T extends Storable> Filter<T> asJoinedFromAny(ChainedProperty<T> joinProperty) {
return mLeft.asJoinedFromAny(joinProperty).and(mRight.asJoinedFromAny(joinProperty));
}
@@ -81,6 +85,7 @@ public class AndFilter<S extends Storable> extends BinaryOpFilter<S> {
left.getRemainderFilter().and(right.getRemainderFilter()));
}
+ @Override
Filter<S> buildDisjunctiveNormalForm() {
Filter<S> left = mLeft.reduce().dnf();
Filter<S> right = mRight.reduce().dnf();
@@ -93,10 +98,12 @@ public class AndFilter<S extends Storable> extends BinaryOpFilter<S> {
return left.and(right).reduce();
}
+ @Override
Filter<S> buildConjunctiveNormalForm() {
return mLeft.cnf().and(mRight.cnf()).reduce();
}
+ @Override
boolean checkIsDisjunctiveNormalForm() {
return (!(mLeft instanceof OrFilter))
&& (!(mRight instanceof OrFilter))
@@ -104,6 +111,7 @@ public class AndFilter<S extends Storable> extends BinaryOpFilter<S> {
&& mRight.isDisjunctiveNormalForm();
}
+ @Override
boolean checkIsConjunctiveNormalForm() {
return mLeft.isConjunctiveNormalForm() && mRight.isConjunctiveNormalForm();
}
@@ -126,6 +134,7 @@ public class AndFilter<S extends Storable> extends BinaryOpFilter<S> {
return false;
}
+ @Override
public void appendTo(Appendable app, FilterValues<S> values) throws IOException {
if (mLeft instanceof OrFilter) {
app.append('(');
diff --git a/src/main/java/com/amazon/carbonado/filter/BinaryOpFilter.java b/src/main/java/com/amazon/carbonado/filter/BinaryOpFilter.java
index ffe81e7..23797a2 100644
--- a/src/main/java/com/amazon/carbonado/filter/BinaryOpFilter.java
+++ b/src/main/java/com/amazon/carbonado/filter/BinaryOpFilter.java
@@ -62,6 +62,7 @@ public abstract class BinaryOpFilter<S extends Storable> extends Filter<S> {
return mRight;
}
+ @Override
public Filter<S> bind() {
if (isBound()) {
return this;
@@ -69,14 +70,17 @@ public abstract class BinaryOpFilter<S extends Storable> extends Filter<S> {
return accept(new Binder<S>(), null);
}
+ @Override
public synchronized boolean isBound() {
return (mState & BOUND) != 0;
}
+ @Override
synchronized void markBound() {
mState |= BOUND;
}
+ @Override
final synchronized boolean isDisjunctiveNormalForm() {
if ((mState & DNF_KNOWN) != 0) { // if dnf state is known...
return (mState & DNF) != 0; // return true if dnf
@@ -93,6 +97,7 @@ public abstract class BinaryOpFilter<S extends Storable> extends Filter<S> {
abstract boolean checkIsDisjunctiveNormalForm();
+ @Override
final synchronized boolean isConjunctiveNormalForm() {
if ((mState & CNF_KNOWN) != 0) { // if cnf state is known...
return (mState & CNF) != 0; // return true if cnf
@@ -109,10 +114,12 @@ public abstract class BinaryOpFilter<S extends Storable> extends Filter<S> {
abstract boolean checkIsConjunctiveNormalForm();
+ @Override
synchronized boolean isReduced() {
return (mState & REDUCED) != 0;
}
+ @Override
synchronized void markReduced() {
mState |= REDUCED;
}
diff --git a/src/main/java/com/amazon/carbonado/filter/ClosedFilter.java b/src/main/java/com/amazon/carbonado/filter/ClosedFilter.java
index b4bd00e..4f4b51a 100644
--- a/src/main/java/com/amazon/carbonado/filter/ClosedFilter.java
+++ b/src/main/java/com/amazon/carbonado/filter/ClosedFilter.java
@@ -53,14 +53,17 @@ public class ClosedFilter<S extends Storable> extends Filter<S> {
return true;
}
+ @Override
public ClosedFilter<S> and(Filter<S> filter) {
return this;
}
+ @Override
public Filter<S> or(Filter<S> filter) {
return filter;
}
+ @Override
public OpenFilter<S> not() {
return getOpenFilter(getStorableType());
}
@@ -93,49 +96,61 @@ public class ClosedFilter<S extends Storable> extends Filter<S> {
return null;
}
+ @Override
public <R, P> R accept(Visitor<S, R, P> visitor, P param) {
return visitor.visit(this, param);
}
+ @Override
public ClosedFilter<S> bind() {
return this;
}
+ @Override
public ClosedFilter<S> unbind() {
return this;
}
+ @Override
public boolean isBound() {
return true;
}
+ @Override
<T extends Storable> ClosedFilter<T> asJoinedFromAny(ChainedProperty<T> joinProperty) {
return getClosedFilter(joinProperty.getPrimeProperty().getEnclosingType());
}
+ @Override
void markBound() {
}
+ @Override
Filter<S> buildDisjunctiveNormalForm() {
return this;
}
+ @Override
Filter<S> buildConjunctiveNormalForm() {
return this;
}
+ @Override
boolean isDisjunctiveNormalForm() {
return true;
}
+ @Override
boolean isConjunctiveNormalForm() {
return true;
}
+ @Override
boolean isReduced() {
return true;
}
+ @Override
void markReduced() {
}
@@ -161,6 +176,7 @@ public class ClosedFilter<S extends Storable> extends Filter<S> {
return "closed";
}
+ @Override
public void appendTo(Appendable app, FilterValues<S> values) throws IOException {
app.append("closed");
}
diff --git a/src/main/java/com/amazon/carbonado/filter/ExistsFilter.java b/src/main/java/com/amazon/carbonado/filter/ExistsFilter.java
index b30c01b..2a7af93 100644
--- a/src/main/java/com/amazon/carbonado/filter/ExistsFilter.java
+++ b/src/main/java/com/amazon/carbonado/filter/ExistsFilter.java
@@ -20,7 +20,6 @@ package com.amazon.carbonado.filter;
import java.io.IOException;
-import com.amazon.carbonado.Query;
import com.amazon.carbonado.Storable;
import com.amazon.carbonado.info.ChainedProperty;
@@ -134,6 +133,7 @@ public class ExistsFilter<S extends Storable> extends Filter<S> {
return mNot;
}
+ @Override
public Filter<S> not() {
return getCanonical(mProperty, mSubFilter, !mNot);
}
@@ -164,10 +164,12 @@ public class ExistsFilter<S extends Storable> extends Filter<S> {
return tail;
}
+ @Override
public <R, P> R accept(Visitor<S, R, P> visitor, P param) {
return visitor.visit(this, param);
}
+ @Override
public ExistsFilter<S> bind() {
Filter<?> boundSubFilter = mSubFilter.bind();
if (boundSubFilter == mSubFilter) {
@@ -176,6 +178,7 @@ public class ExistsFilter<S extends Storable> extends Filter<S> {
return getCanonical(mProperty, boundSubFilter, mNot);
}
+ @Override
public ExistsFilter<S> unbind() {
Filter<?> unboundSubFilter = mSubFilter.unbind();
if (unboundSubFilter == mSubFilter) {
@@ -184,13 +187,16 @@ public class ExistsFilter<S extends Storable> extends Filter<S> {
return getCanonical(mProperty, unboundSubFilter, mNot);
}
+ @Override
public boolean isBound() {
return mSubFilter.isBound();
}
+ @Override
void markBound() {
}
+ @Override
<T extends Storable> ExistsFilter<T> asJoinedFromAny(ChainedProperty<T> joinProperty) {
ChainedProperty<T> newProperty = joinProperty.append(getChainedProperty());
return getCanonical(newProperty, mSubFilter, mNot);
@@ -219,26 +225,32 @@ public class ExistsFilter<S extends Storable> extends Filter<S> {
return new NotJoined(notJoinedFilter, getOpenFilter(getStorableType()));
}
+ @Override
Filter<S> buildDisjunctiveNormalForm() {
return this;
}
+ @Override
Filter<S> buildConjunctiveNormalForm() {
return this;
}
+ @Override
boolean isDisjunctiveNormalForm() {
return true;
}
+ @Override
boolean isConjunctiveNormalForm() {
return true;
}
+ @Override
boolean isReduced() {
return true;
}
+ @Override
void markReduced() {
}
@@ -263,6 +275,7 @@ public class ExistsFilter<S extends Storable> extends Filter<S> {
return false;
}
+ @Override
public void appendTo(Appendable app, FilterValues<S> values) throws IOException {
if (mNot) {
app.append('!');
diff --git a/src/main/java/com/amazon/carbonado/filter/Filter.java b/src/main/java/com/amazon/carbonado/filter/Filter.java
index 83c58ab..bec0c6b 100644
--- a/src/main/java/com/amazon/carbonado/filter/Filter.java
+++ b/src/main/java/com/amazon/carbonado/filter/Filter.java
@@ -449,16 +449,19 @@ public abstract class Filter<S extends Storable> implements Serializable, Append
final List<Filter<S>> list = new ArrayList<Filter<S>>();
disjunctiveNormalForm().accept(new Visitor<S, Object, Object>() {
+ @Override
public Object visit(AndFilter<S> filter, Object param) {
list.add(filter);
return null;
}
+ @Override
public Object visit(PropertyFilter<S> filter, Object param) {
list.add(filter);
return null;
}
+ @Override
public Object visit(ExistsFilter<S> filter, Object param) {
list.add(filter);
return null;
@@ -510,16 +513,19 @@ public abstract class Filter<S extends Storable> implements Serializable, Append
final List<Filter<S>> list = new ArrayList<Filter<S>>();
conjunctiveNormalForm().accept(new Visitor<S, Object, Object>() {
+ @Override
public Object visit(OrFilter<S> filter, Object param) {
list.add(filter);
return null;
}
+ @Override
public Object visit(PropertyFilter<S> filter, Object param) {
list.add(filter);
return null;
}
+ @Override
public Object visit(ExistsFilter<S> filter, Object param) {
list.add(filter);
return null;
@@ -829,10 +835,12 @@ public abstract class Filter<S extends Storable> implements Serializable, Append
return mRemainder;
}
+ @Override
public int hashCode() {
return mNotJoined.hashCode() * 31 + mRemainder.hashCode();
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -844,6 +852,7 @@ public abstract class Filter<S extends Storable> implements Serializable, Append
return false;
}
+ @Override
public String toString() {
return "not joined: " + mNotJoined + ", remainder: " + mRemainder;
}
diff --git a/src/main/java/com/amazon/carbonado/filter/OpenFilter.java b/src/main/java/com/amazon/carbonado/filter/OpenFilter.java
index d14e7a8..da23e6c 100644
--- a/src/main/java/com/amazon/carbonado/filter/OpenFilter.java
+++ b/src/main/java/com/amazon/carbonado/filter/OpenFilter.java
@@ -53,14 +53,17 @@ public class OpenFilter<S extends Storable> extends Filter<S> {
return true;
}
+ @Override
public Filter<S> and(Filter<S> filter) {
return filter;
}
+ @Override
public OpenFilter<S> or(Filter<S> filter) {
return this;
}
+ @Override
public ClosedFilter<S> not() {
return getClosedFilter(getStorableType());
}
@@ -93,49 +96,61 @@ public class OpenFilter<S extends Storable> extends Filter<S> {
return null;
}
+ @Override
public <R, P> R accept(Visitor<S, R, P> visitor, P param) {
return visitor.visit(this, param);
}
+ @Override
public OpenFilter<S> bind() {
return this;
}
+ @Override
public OpenFilter<S> unbind() {
return this;
}
+ @Override
public boolean isBound() {
return true;
}
+ @Override
<T extends Storable> OpenFilter<T> asJoinedFromAny(ChainedProperty<T> joinProperty) {
return getOpenFilter(joinProperty.getPrimeProperty().getEnclosingType());
}
+ @Override
void markBound() {
}
+ @Override
Filter<S> buildDisjunctiveNormalForm() {
return this;
}
+ @Override
Filter<S> buildConjunctiveNormalForm() {
return this;
}
+ @Override
boolean isDisjunctiveNormalForm() {
return true;
}
+ @Override
boolean isConjunctiveNormalForm() {
return true;
}
+ @Override
boolean isReduced() {
return true;
}
+ @Override
void markReduced() {
}
@@ -161,6 +176,7 @@ public class OpenFilter<S extends Storable> extends Filter<S> {
return "open";
}
+ @Override
public void appendTo(Appendable app, FilterValues<S> values) throws IOException {
app.append("open");
}
diff --git a/src/main/java/com/amazon/carbonado/filter/OrFilter.java b/src/main/java/com/amazon/carbonado/filter/OrFilter.java
index 64be6be..15019b6 100644
--- a/src/main/java/com/amazon/carbonado/filter/OrFilter.java
+++ b/src/main/java/com/amazon/carbonado/filter/OrFilter.java
@@ -49,14 +49,17 @@ public class OrFilter<S extends Storable> extends BinaryOpFilter<S> {
super(left, right);
}
+ @Override
public Filter<S> not() {
return mLeft.not().and(mRight.not());
}
+ @Override
public <R, P> R accept(Visitor<S, R, P> visitor, P param) {
return visitor.visit(this, param);
}
+ @Override
public Filter<S> unbind() {
if (!isBound()) {
return this;
@@ -64,6 +67,7 @@ public class OrFilter<S extends Storable> extends BinaryOpFilter<S> {
return mLeft.unbind().or(mRight.unbind());
}
+ @Override
<T extends Storable> Filter<T> asJoinedFromAny(ChainedProperty<T> joinProperty) {
return mLeft.asJoinedFromAny(joinProperty).or(mRight.asJoinedFromAny(joinProperty));
}
@@ -96,10 +100,12 @@ public class OrFilter<S extends Storable> extends BinaryOpFilter<S> {
return new NotJoined(leftNotJoined.or(rightNotJoined), getOpenFilter(getStorableType()));
}
+ @Override
Filter<S> buildDisjunctiveNormalForm() {
return mLeft.dnf().or(mRight.dnf()).reduce();
}
+ @Override
Filter<S> buildConjunctiveNormalForm() {
Filter<S> left = mLeft.reduce().cnf();
Filter<S> right = mRight.reduce().cnf();
@@ -112,10 +118,12 @@ public class OrFilter<S extends Storable> extends BinaryOpFilter<S> {
return left.or(right).reduce();
}
+ @Override
boolean checkIsDisjunctiveNormalForm() {
return mLeft.isDisjunctiveNormalForm() && mRight.isDisjunctiveNormalForm();
}
+ @Override
boolean checkIsConjunctiveNormalForm() {
return (!(mLeft instanceof AndFilter))
&& (!(mRight instanceof AndFilter))
@@ -141,6 +149,7 @@ public class OrFilter<S extends Storable> extends BinaryOpFilter<S> {
return false;
}
+ @Override
public void appendTo(Appendable app, FilterValues<S> values) throws IOException {
if (mLeft instanceof AndFilter) {
app.append('(');
diff --git a/src/main/java/com/amazon/carbonado/filter/PropertyFilter.java b/src/main/java/com/amazon/carbonado/filter/PropertyFilter.java
index 37d92e0..5014733 100644
--- a/src/main/java/com/amazon/carbonado/filter/PropertyFilter.java
+++ b/src/main/java/com/amazon/carbonado/filter/PropertyFilter.java
@@ -165,6 +165,7 @@ public class PropertyFilter<S extends Storable> extends Filter<S> {
return Collections.singletonList((Filter<S>) this);
}
+ @Override
public <R, P> R accept(Visitor<S, R, P> visitor, P param) {
return visitor.visit(this, param);
}
@@ -208,18 +209,22 @@ public class PropertyFilter<S extends Storable> extends Filter<S> {
return mBindID;
}
+ @Override
public PropertyFilter<S> bind() {
return mBindID == 0 ? getCanonical(this, 1) : this;
}
+ @Override
public PropertyFilter<S> unbind() {
return mBindID == 0 ? this : getCanonical(this, 0);
}
+ @Override
public boolean isBound() {
return mBindID != 0;
}
+ @Override
<T extends Storable> PropertyFilter<T> asJoinedFromAny(ChainedProperty<T> joinProperty) {
ChainedProperty<T> newProperty = joinProperty.append(getChainedProperty());
@@ -292,29 +297,36 @@ public class PropertyFilter<S extends Storable> extends Filter<S> {
return mBindID == BOUND_CONSTANT;
}
+ @Override
void markBound() {
}
+ @Override
Filter<S> buildDisjunctiveNormalForm() {
return this;
}
+ @Override
Filter<S> buildConjunctiveNormalForm() {
return this;
}
+ @Override
boolean isDisjunctiveNormalForm() {
return true;
}
+ @Override
boolean isConjunctiveNormalForm() {
return true;
}
+ @Override
boolean isReduced() {
return true;
}
+ @Override
void markReduced() {
}
@@ -511,6 +523,7 @@ public class PropertyFilter<S extends Storable> extends Filter<S> {
return false;
}
+ @Override
public void appendTo(Appendable app, FilterValues<S> values) throws IOException {
mProperty.appendTo(app);
app.append(' ');
diff --git a/src/main/java/com/amazon/carbonado/filter/PropertyFilterList.java b/src/main/java/com/amazon/carbonado/filter/PropertyFilterList.java
index 1027c67..03874a2 100644
--- a/src/main/java/com/amazon/carbonado/filter/PropertyFilterList.java
+++ b/src/main/java/com/amazon/carbonado/filter/PropertyFilterList.java
@@ -165,6 +165,7 @@ class PropertyFilterList<S extends Storable> {
static class Builder<S extends Storable>
extends Visitor<S, PropertyFilterList<S>, PropertyFilterList<S>>
{
+ @Override
public PropertyFilterList<S> visit(OrFilter<S> filter, PropertyFilterList<S> list) {
// Traverse right-to-left since list must be built in this order.
list = filter.getRightFilter().accept(this, list);
@@ -172,6 +173,7 @@ class PropertyFilterList<S extends Storable> {
return list;
}
+ @Override
public PropertyFilterList<S> visit(AndFilter<S> filter, PropertyFilterList<S> list) {
// Traverse right-to-left since list must be built in this order.
list = filter.getRightFilter().accept(this, list);
@@ -179,10 +181,12 @@ class PropertyFilterList<S extends Storable> {
return list;
}
+ @Override
public PropertyFilterList<S> visit(PropertyFilter<S> filter, PropertyFilterList<S> list) {
return list == null ? new PropertyFilterList<S>(filter, null) : list.prepend(filter);
}
+ @Override
public PropertyFilterList<S> visit(ExistsFilter<S> filter, PropertyFilterList<S> list) {
PropertyFilterList<S> subList =
filter.getJoinedSubFilter().getTailPropertyFilterList();
diff --git a/src/main/java/com/amazon/carbonado/filter/RelOp.java b/src/main/java/com/amazon/carbonado/filter/RelOp.java
index f74d21e..57eb9fa 100644
--- a/src/main/java/com/amazon/carbonado/filter/RelOp.java
+++ b/src/main/java/com/amazon/carbonado/filter/RelOp.java
@@ -40,6 +40,7 @@ public enum RelOp {
/**
* Returns one of "=", "!=", "<", ">=", ">", or "<=".
*/
+ @Override
public String toString() {
switch (this) {
case EQ:
diff --git a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
index cb60349..e88ba39 100644
--- a/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
+++ b/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java
@@ -25,8 +25,6 @@ import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.IdentityHashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -316,7 +314,6 @@ public final class StorableGenerator<S extends Storable> {
private final TypeDesc mSupportType;
private final StorableInfo<S> mInfo;
private final Map<String, ? extends StorableProperty<S>> mAllProperties;
- private final boolean mHasJoins;
private final ClassInjector mClassInjector;
private final ClassFile mClassFile;
@@ -327,15 +324,6 @@ public final class StorableGenerator<S extends Storable> {
mInfo = StorableIntrospector.examine(storableType);
mAllProperties = mInfo.getAllProperties();
- boolean hasJoins = false;
- for (StorableProperty<?> property : mAllProperties.values()) {
- if (property.isJoin()) {
- hasJoins = true;
- break;
- }
- }
- mHasJoins = hasJoins;
-
mClassInjector = ClassInjector.create
(storableType.getName(), storableType.getClassLoader());
mClassFile = CodeBuilderUtil.createStorableClassFile
@@ -346,7 +334,7 @@ public final class StorableGenerator<S extends Storable> {
private Class<? extends S> generateAndInjectClass() {
generateClass();
Class abstractClass = mClassInjector.defineClass(mClassFile);
- return (Class<? extends S>) abstractClass;
+ return abstractClass;
}
private void generateClass() {
@@ -1743,6 +1731,7 @@ public final class StorableGenerator<S extends Storable> {
}
}
+ /*
private static Method lookupMethod(Class type, MethodInfo mi) {
MethodDesc desc = mi.getMethodDescriptor();
TypeDesc[] params = desc.getParameterTypes();
@@ -1759,6 +1748,7 @@ public final class StorableGenerator<S extends Storable> {
return lookupMethod(type, mi.getName(), args);
}
+ */
private static Method lookupMethod(Class type, String name, Class... args) {
try {
@@ -2392,7 +2382,7 @@ public final class StorableGenerator<S extends Storable> {
private void addPropertyStateExtractMethod() {
MethodInfo mi = mClassFile.addMethod(Modifiers.PRIVATE, PROPERTY_STATE_EXTRACT_METHOD_NAME,
TypeDesc.INT, new TypeDesc[] {TypeDesc.STRING});
-
+
addPropertySwitch(new CodeBuilder(mi), SWITCH_FOR_STATE);
}
@@ -2739,7 +2729,7 @@ public final class StorableGenerator<S extends Storable> {
GenericEncodingStrategy<S> encoder = new GenericEncodingStrategy<S>(mStorableType, null);
CodeBuilder b = new CodeBuilder(mi);
-
+
LocalVariable encodedVar;
try {
encodedVar = encoder.buildSerialEncoding(b, null);
@@ -3049,7 +3039,7 @@ public final class StorableGenerator<S extends Storable> {
invokeAppend(b, TypeDesc.STRING);
// First pass, just print primary keys.
-
+
LocalVariable commaCountVar = b.createLocalVariable(null, TypeDesc.INT);
b.loadConstant(-1);
b.storeLocal(commaCountVar);
diff --git a/src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java b/src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java
index cbf0d0b..ecdcce3 100644
--- a/src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java
+++ b/src/main/java/com/amazon/carbonado/gen/StorablePropertyMap.java
@@ -32,7 +32,6 @@ import java.util.Set;
import org.cojen.util.SoftValuedHashMap;
import com.amazon.carbonado.Storable;
-import com.amazon.carbonado.info.StorableInfo;
import com.amazon.carbonado.info.StorableIntrospector;
import com.amazon.carbonado.info.StorableProperty;
diff --git a/src/main/java/com/amazon/carbonado/info/OrderedProperty.java b/src/main/java/com/amazon/carbonado/info/OrderedProperty.java
index 2e54e81..0cb0a3b 100644
--- a/src/main/java/com/amazon/carbonado/info/OrderedProperty.java
+++ b/src/main/java/com/amazon/carbonado/info/OrderedProperty.java
@@ -18,10 +18,7 @@
package com.amazon.carbonado.info;
-import java.io.Externalizable;
import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
import java.io.Serializable;
import org.cojen.util.WeakCanonicalSet;
diff --git a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
index ebcffb5..80d263a 100644
--- a/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
+++ b/src/main/java/com/amazon/carbonado/info/StorableIntrospector.java
@@ -339,7 +339,7 @@ public class StorableIntrospector {
}
}
}
-
+
return candidate;
}
@@ -1042,7 +1042,7 @@ public class StorableIntrospector {
if (sequence != null) {
sequenceName = sequence.value();
}
-
+
if (join == null) {
if (errorMessages.size() > 0) {
return null;
@@ -1640,6 +1640,8 @@ public class StorableIntrospector {
}
private static class SimpleProperty<S extends Storable> implements StorableProperty<S> {
+ private static final long serialVersionUID = 6599542401516624863L;
+
private static final ChainedProperty[] EMPTY_CHAIN_ARRAY = new ChainedProperty[0];
private final BeanProperty mBeanProperty;
@@ -1895,11 +1897,13 @@ public class StorableIntrospector {
return mAdapter;
}
+ @Override
public int hashCode() {
return (getName().hashCode() * 31 + getType().getName().hashCode()) * 31
+ getEnclosingType().getName().hashCode();
}
+ @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
@@ -1915,6 +1919,7 @@ public class StorableIntrospector {
return false;
}
+ @Override
public String toString() {
StringBuilder b = new StringBuilder();
try {
@@ -2190,6 +2195,8 @@ public class StorableIntrospector {
}
private static final class JoinProperty<S extends Storable> extends SimpleProperty<S> {
+ private static final long serialVersionUID = 5617446241872193369L;
+
private final Class<? extends Storable> mJoinedType;
// Just the names of the join properties, held here until properties
@@ -2225,38 +2232,47 @@ public class StorableIntrospector {
mExternalNames = external;
}
+ @Override
public boolean isJoin() {
return true;
}
+ @Override
public boolean isOneToOneJoin() {
return mOneToOne;
}
+ @Override
public Class<? extends Storable> getJoinedType() {
return mJoinedType;
}
+ @Override
public int getJoinElementCount() {
return mInternal.length;
}
+ @Override
public StorableProperty<S> getInternalJoinElement(int index) {
return mInternal[index];
}
+ @Override
public StorableProperty<S>[] getInternalJoinElements() {
return mInternal.clone();
}
+ @Override
public StorableProperty<?> getExternalJoinElement(int index) {
return mExternal[index];
}
+ @Override
public StorableProperty<?>[] getExternalJoinElements() {
return mExternal.clone();
}
+ @Override
public boolean isQuery() {
return getType() == Query.class;
}
@@ -2610,7 +2626,7 @@ public class StorableIntrospector {
oneToOneCheck: {
Set<StorableProperty> internalPrimaryKey = new HashSet<StorableProperty>
(mEnclosingInfo.getPrimaryKeyProperties().values());
-
+
for (int i=0; i<mInternal.length; i++) {
internalPrimaryKey.remove(getInternalJoinElement(i));
if (internalPrimaryKey.size() == 0) {
diff --git a/src/main/java/com/amazon/carbonado/lob/CharArrayClob.java b/src/main/java/com/amazon/carbonado/lob/CharArrayClob.java
index 1472da3..ddba889 100644
--- a/src/main/java/com/amazon/carbonado/lob/CharArrayClob.java
+++ b/src/main/java/com/amazon/carbonado/lob/CharArrayClob.java
@@ -100,6 +100,7 @@ public class CharArrayClob extends AbstractClob {
return mLength;
}
+ @Override
public synchronized String asString() {
return new String(mData, 0, mLength);
}
diff --git a/src/main/java/com/amazon/carbonado/lob/StringClob.java b/src/main/java/com/amazon/carbonado/lob/StringClob.java
index fe9b05d..663e20b 100644
--- a/src/main/java/com/amazon/carbonado/lob/StringClob.java
+++ b/src/main/java/com/amazon/carbonado/lob/StringClob.java
@@ -63,6 +63,7 @@ public class StringClob extends AbstractClob {
return mStr.length();
}
+ @Override
public String asString() {
return mStr;
}
@@ -83,6 +84,7 @@ public class StringClob extends AbstractClob {
throw denied();
}
+ @Override
public void setValue(String value) throws PersistException {
denied();
}
diff --git a/src/main/java/com/amazon/carbonado/qe/CompositeScore.java b/src/main/java/com/amazon/carbonado/qe/CompositeScore.java
index 51c1f73..fd7d9c8 100644
--- a/src/main/java/com/amazon/carbonado/qe/CompositeScore.java
+++ b/src/main/java/com/amazon/carbonado/qe/CompositeScore.java
@@ -218,6 +218,7 @@ public class CompositeScore<S extends Storable> {
mOrderingScore.withRemainderOrdering(ordering));
}
+ @Override
public String toString() {
return "CompositeScore {" + getFilteringScore() + ", " + getOrderingScore() + '}';
}
diff --git a/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java b/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java
index 0ddc561..e9431f3 100644
--- a/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java
+++ b/src/main/java/com/amazon/carbonado/qe/EmptyQuery.java
@@ -227,6 +227,7 @@ public final class EmptyQuery<S extends Storable> extends AbstractQuery<S> {
/**
* Always throws {@link PersistNoneException}.
*/
+ @Override
public void deleteOne() throws PersistNoneException {
throw new PersistNoneException();
}
diff --git a/src/main/java/com/amazon/carbonado/qe/FilteringScore.java b/src/main/java/com/amazon/carbonado/qe/FilteringScore.java
index 5efb219..6fa6ca0 100644
--- a/src/main/java/com/amazon/carbonado/qe/FilteringScore.java
+++ b/src/main/java/com/amazon/carbonado/qe/FilteringScore.java
@@ -699,6 +699,7 @@ public class FilteringScore<S extends Storable> {
return new FilteringScore<S>(this, filter);
}
+ @Override
public String toString() {
return "FilteringScore {identityCount=" + getIdentityCount() +
", hasRangeStart=" + hasRangeStart() +
@@ -767,16 +768,19 @@ public class FilteringScore<S extends Storable> {
private boolean isProvidedByIndex(Filter<S> filter) {
return filter.accept(new Visitor<S, Boolean, Object>() {
+ @Override
public Boolean visit(OrFilter<S> filter, Object param) {
return filter.getLeftFilter().accept(this, param)
&& filter.getRightFilter().accept(this, param);
}
+ @Override
public Boolean visit(AndFilter<S> filter, Object param) {
return filter.getLeftFilter().accept(this, param)
&& filter.getRightFilter().accept(this, param);
}
+ @Override
public Boolean visit(PropertyFilter<S> filter, Object param) {
ChainedProperty<S> filterProp = filter.getChainedProperty();
for (OrderedProperty<S> indexProp : mIndexProperties) {
diff --git a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
index 3ddd828..875eda3 100644
--- a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
@@ -544,6 +544,7 @@ public class IndexedQueryAnalyzer<S extends Storable> {
return executor;
}
+ @Override
public String toString() {
return "IndexedQueryAnalyzer.Result {score="
+ getCompositeScore() + ", localIndex="
diff --git a/src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java b/src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java
index f26a9b3..e6f4248 100644
--- a/src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java
+++ b/src/main/java/com/amazon/carbonado/qe/KeyQueryExecutor.java
@@ -61,6 +61,7 @@ public class KeyQueryExecutor<S extends Storable> extends AbstractQueryExecutor<
mKeyFilter = score.getIdentityFilter();
}
+ @Override
public Class<S> getStorableType() {
// Storable type of filter may differ if index is used along with a
// join. The type of the index is the correct storable type.
diff --git a/src/main/java/com/amazon/carbonado/qe/OrderingList.java b/src/main/java/com/amazon/carbonado/qe/OrderingList.java
index b6235ac..b096aae 100644
--- a/src/main/java/com/amazon/carbonado/qe/OrderingList.java
+++ b/src/main/java/com/amazon/carbonado/qe/OrderingList.java
@@ -49,6 +49,8 @@ import com.amazon.carbonado.info.StorableIntrospector;
public class OrderingList<S extends Storable> extends AbstractList<OrderedProperty<S>>
implements Serializable
{
+ private static final long serialVersionUID = 3692335128299485356L;
+
private static final OrderingList EMPTY_LIST = new OrderingList();
private static final Map<Class, OrderingList> cCache;
@@ -154,10 +156,12 @@ public class OrderingList<S extends Storable> extends AbstractList<OrderedProper
mSize = parent.mSize + 1;
}
+ @Override
public int size() {
return mSize;
}
+ @Override
public OrderedProperty<S> get(int index) {
return asArray()[index];
}
@@ -363,7 +367,7 @@ public class OrderingList<S extends Storable> extends AbstractList<OrderedProper
private static class Orderings implements Externalizable {
private static final long serialVersionUID = 1L;
- private OrderedProperty<?>[] mOrderings;
+ private OrderedProperty[] mOrderings;
// Required for Externalizable.
public Orderings() {
diff --git a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java
index abf7ac8..9bfcde1 100644
--- a/src/main/java/com/amazon/carbonado/qe/OrderingScore.java
+++ b/src/main/java/com/amazon/carbonado/qe/OrderingScore.java
@@ -483,6 +483,7 @@ public class OrderingScore<S extends Storable> {
return new OrderingScore<S>(this, ordering);
}
+ @Override
public String toString() {
return "OrderingScore {handledCount=" + getHandledCount() +
", remainderCount=" + getRemainderCount() +
diff --git a/src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java b/src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java
index c58aacb..378fc68 100644
--- a/src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java
+++ b/src/main/java/com/amazon/carbonado/qe/PropertyFilterList.java
@@ -86,15 +86,18 @@ class PropertyFilterList<S extends Storable> extends AbstractList<PropertyFilter
final List<ExistsFilter<S>> fexistsList = existsList;
filter.accept(new Visitor<S, Object, Object>() {
+ @Override
public Object visit(OrFilter<S> filter, Object param) {
throw new IllegalArgumentException("OrFilter not allowed");
}
+ @Override
public Object visit(ExistsFilter<S> filter, Object param) {
fexistsList.add(filter);
return null;
}
+ @Override
public Object visit(PropertyFilter<S> filter, Object param) {
flist.add(filter);
return null;
@@ -139,10 +142,12 @@ class PropertyFilterList<S extends Storable> extends AbstractList<PropertyFilter
return mPosMap.get(filter);
}
+ @Override
public int size() {
return mList.size();
}
+ @Override
public PropertyFilter<S> get(int index) {
return mList.get(index);
}
@@ -157,6 +162,8 @@ class PropertyFilterList<S extends Storable> extends AbstractList<PropertyFilter
private static class PFComparator<S extends Storable>
implements Comparator<PropertyFilter<S>>, java.io.Serializable
{
+ private static final long serialVersionUID = 2322537712763223517L;
+
public int compare(PropertyFilter<S> a, PropertyFilter<S> b) {
if (a.getOperator() != b.getOperator()) {
if (a.getOperator() == RelOp.EQ) {
diff --git a/src/main/java/com/amazon/carbonado/qe/QueryEngine.java b/src/main/java/com/amazon/carbonado/qe/QueryEngine.java
index 8e9d642..9b2c13f 100644
--- a/src/main/java/com/amazon/carbonado/qe/QueryEngine.java
+++ b/src/main/java/com/amazon/carbonado/qe/QueryEngine.java
@@ -49,6 +49,7 @@ public class QueryEngine<S extends Storable> extends StandardQueryFactory<S>
return mExecutorFactory.executor(filter, ordering, hints);
}
+ @Override
protected StandardQuery<S> createQuery(Filter<S> filter,
FilterValues<S> values,
OrderingList<S> ordering,
@@ -66,18 +67,22 @@ public class QueryEngine<S extends Storable> extends StandardQueryFactory<S>
super(filter, values, ordering, hints);
}
+ @Override
protected Transaction enterTransaction(IsolationLevel level) {
return mRepoAccess.getRootRepository().enterTransaction(level);
}
+ @Override
protected QueryFactory<S> queryFactory() {
return QueryEngine.this;
}
+ @Override
protected QueryExecutorFactory<S> executorFactory() {
return mExecutorFactory;
}
+ @Override
protected StandardQuery<S> newInstance(FilterValues<S> values,
OrderingList<S> ordering,
QueryHints hints)
diff --git a/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java b/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java
index 7055b21..bfa63b1 100644
--- a/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java
+++ b/src/main/java/com/amazon/carbonado/qe/StorableIndexSet.java
@@ -475,6 +475,8 @@ public class StorableIndexSet<S extends Storable> extends TreeSet<StorableIndex<
private static class StorableIndexComparator
implements Comparator<StorableIndex<?>>, java.io.Serializable
{
+ private static final long serialVersionUID = 2204885249683067349L;
+
public int compare(StorableIndex<?> a, StorableIndex<?> b) {
if (a == b) {
return 0;
diff --git a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
index 67da7ee..6e5262f 100644
--- a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
@@ -558,6 +558,7 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact
return 0;
}
+ @Override
public String toString() {
return "Tally: {property=" + mProperty +
", asc=" + mAscendingCount +
diff --git a/src/main/java/com/amazon/carbonado/raw/RawCursor.java b/src/main/java/com/amazon/carbonado/raw/RawCursor.java
index 2c7aa1d..6bd97b2 100644
--- a/src/main/java/com/amazon/carbonado/raw/RawCursor.java
+++ b/src/main/java/com/amazon/carbonado/raw/RawCursor.java
@@ -181,6 +181,7 @@ public abstract class RawCursor<S> extends AbstractCursor<S> {
}
}
+ @Override
public int skipNext(int amount) throws FetchException {
if (amount <= 0) {
if (amount < 0) {
diff --git a/src/main/java/com/amazon/carbonado/raw/RawStorableGenerator.java b/src/main/java/com/amazon/carbonado/raw/RawStorableGenerator.java
index 0b0cfc7..36fd57e 100644
--- a/src/main/java/com/amazon/carbonado/raw/RawStorableGenerator.java
+++ b/src/main/java/com/amazon/carbonado/raw/RawStorableGenerator.java
@@ -48,7 +48,6 @@ import com.amazon.carbonado.gen.MasterStorableGenerator;
import com.amazon.carbonado.gen.MasterSupport;
import com.amazon.carbonado.gen.StorableGenerator;
import com.amazon.carbonado.gen.TriggerSupport;
-import static com.amazon.carbonado.gen.CommonMethodNames.*;
/**
* Generates and caches abstract implementations of {@link Storable} types
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java
index 35fc492..79895c4 100644
--- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java
+++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedCursor.java
@@ -179,6 +179,7 @@ class IndexedCursor<S extends Storable> extends AbstractCursor<S> {
throw new NoSuchElementException();
}
+ @Override
public int skipNext(int amount) throws FetchException {
try {
if (mNext == null) {
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 6bea049..7c28ee8 100644
--- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java
+++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepository.java
@@ -79,6 +79,7 @@ class IndexedRepository implements Repository,
mAllClustered = allClustered;
mStoragePool = new StoragePool() {
+ @Override
protected <S extends Storable> Storage<S> createStorage(Class<S> type)
throws RepositoryException
{
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 d37c50d..392505b 100644
--- a/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepositoryBuilder.java
+++ b/src/main/java/com/amazon/carbonado/repo/indexed/IndexedRepositoryBuilder.java
@@ -190,6 +190,7 @@ public class IndexedRepositoryBuilder extends AbstractRepositoryBuilder {
mAllClustered = clustered;
}
+ @Override
public void errorCheck(Collection<String> messages) throws ConfigurationException {
super.errorCheck(messages);
if (null == getWrappedRepository()) {
diff --git a/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java b/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java
index c667dde..a3cc790 100644
--- a/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java
+++ b/src/main/java/com/amazon/carbonado/repo/indexed/ManagedIndex.java
@@ -52,8 +52,6 @@ import com.amazon.carbonado.cursor.MergeSortBuffer;
import com.amazon.carbonado.spi.RepairExecutor;
-import com.amazon.carbonado.qe.BoundaryType;
-
import com.amazon.carbonado.util.Throttle;
/**
@@ -181,6 +179,7 @@ class ManagedIndex<S extends Storable> implements IndexEntryAccessor<S> {
return new IndexedCursor<S>(indexEntryQuery.fetch(), storage, mGenerator);
}
+ @Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("IndexInfo ");
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/CompositeStatement.java b/src/main/java/com/amazon/carbonado/repo/jdbc/CompositeStatement.java
index 48b81e5..a431ed3 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/CompositeStatement.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/CompositeStatement.java
@@ -37,6 +37,7 @@ class CompositeStatement<S extends Storable> extends SQLStatement<S> {
mStatements = statements.toArray(new SQLStatement[statements.size()]);
}
+ @Override
public int maxLength() {
int max = 0;
for (SQLStatement<S> statement : mStatements) {
@@ -45,6 +46,7 @@ class CompositeStatement<S extends Storable> extends SQLStatement<S> {
return max;
}
+ @Override
public void appendTo(StringBuilder b, FilterValues<S> filterValues) {
for (SQLStatement<S> statement : mStatements) {
statement.appendTo(b, filterValues);
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/H2ExceptionTransformer.java b/src/main/java/com/amazon/carbonado/repo/jdbc/H2ExceptionTransformer.java
index e367cb0..4fe3733 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/H2ExceptionTransformer.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/H2ExceptionTransformer.java
@@ -29,6 +29,7 @@ import java.sql.SQLException;
class H2ExceptionTransformer extends JDBCExceptionTransformer {
public static int DUPLICATE_KEY = 23001;
+ @Override
public boolean isUniqueConstraintError(SQLException e) {
return DUPLICATE_KEY == e.getErrorCode();
}
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java
index 18d1eb4..cb3b7ae 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java
@@ -173,6 +173,7 @@ class JDBCBlob extends AbstractBlob implements JDBCLob {
mPos = pos;
}
+ @Override
public int read() throws IOException {
if (fillBuffer() <= 0) {
return -1;
@@ -180,6 +181,7 @@ class JDBCBlob extends AbstractBlob implements JDBCLob {
return mBuffer[mBufferPos++];
}
+ @Override
public int read(byte[] b, int off, int len) throws IOException {
int avail = fillBuffer();
if (avail <= 0) {
@@ -193,6 +195,7 @@ class JDBCBlob extends AbstractBlob implements JDBCLob {
return len;
}
+ @Override
public long skip(long n) throws IOException {
if (n <= 0) {
return 0;
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java
index dc254bb..efbbe61 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java
@@ -173,6 +173,7 @@ class JDBCClob extends AbstractClob implements JDBCLob {
mPos = pos;
}
+ @Override
public int read() throws IOException {
if (fillBuffer() <= 0) {
return -1;
@@ -180,6 +181,7 @@ class JDBCClob extends AbstractClob implements JDBCLob {
return mBuffer.charAt(mBufferPos++);
}
+ @Override
public int read(char[] c, int off, int len) throws IOException {
int avail = fillBuffer();
if (avail <= 0) {
@@ -193,6 +195,7 @@ class JDBCClob extends AbstractClob implements JDBCLob {
return len;
}
+ @Override
public long skip(long n) throws IOException {
if (n <= 0) {
return 0;
@@ -221,6 +224,7 @@ class JDBCClob extends AbstractClob implements JDBCLob {
return n;
}
+ @Override
public void close() {
}
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java
index 985232c..4f31d2c 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCCursor.java
@@ -112,6 +112,7 @@ class JDBCCursor<S extends Storable> extends AbstractCursor<S> {
}
}
+ @Override
public int skipNext(int amount) throws FetchException {
if (amount <= 0) {
if (amount < 0) {
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java
index 75fde77..250b54e 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java
@@ -626,6 +626,7 @@ public class JDBCRepository extends AbstractRepository<JDBCTransaction>
return mExceptionTransformer;
}
+ @Override
protected void shutdownHook() {
// Close all open connections.
mOpenConnectionsLock.lock();
@@ -657,10 +658,12 @@ public class JDBCRepository extends AbstractRepository<JDBCTransaction>
}
}
+ @Override
protected Log getLog() {
return mLog;
}
+ @Override
protected <S extends Storable> Storage<S> createStorage(Class<S> type)
throws RepositoryException
{
@@ -696,16 +699,19 @@ public class JDBCRepository extends AbstractRepository<JDBCTransaction>
return new JDBCStorage<S>(this, info, autoVersioning, suppressReload);
}
+ @Override
protected SequenceValueProducer createSequenceValueProducer(String name)
throws RepositoryException
{
return mSupportStrategy.createSequenceValueProducer(name);
}
+ @Override
protected final TransactionManager<JDBCTransaction> transactionManager() {
return mTxnMgr;
}
+ @Override
protected final TransactionScope<JDBCTransaction> localTransactionScope() {
return mTxnMgr.localScope();
}
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java
index 1fbe2dd..0421e28 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java
@@ -392,6 +392,7 @@ public class JDBCRepositoryBuilder extends AbstractRepositoryBuilder {
mForceStoredSequence = forceStoredSequence;
}
+ @Override
public void errorCheck(Collection<String> messages) throws ConfigurationException {
super.errorCheck(messages);
if (mDataSource == null) {
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java
index e775cc9..b5d7bd8 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java
@@ -24,12 +24,10 @@ import java.lang.reflect.UndeclaredThrowableException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Date;
import java.util.LinkedHashMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.TreeMap;
import java.math.BigDecimal;
@@ -447,7 +445,7 @@ public class JDBCStorableIntrospector extends StorableIntrospector {
for (StorableKey<S> altKey : mainInfo.getAlternateKeys()) {
if (matchesKey(pkProps, altKey)) {
// Okay. Primary key in database matches a Storable
- // alternate key.
+ // alternate key.
foundAnyAltKey = true;
// Also check that declared primary key is a strict subset
@@ -461,7 +459,7 @@ public class JDBCStorableIntrospector extends StorableIntrospector {
if (foundAnyAltKey) {
errorMessages.add("Actual primary key matches a declared alternate key, " +
- "but declared primary key must be a strict subset. " +
+ "but declared primary key must be a strict subset. " +
mainInfo.getPrimaryKey().getProperties() +
" is not a subset of " + pkProps);
} else {
@@ -1121,6 +1119,8 @@ public class JDBCStorableIntrospector extends StorableIntrospector {
* shorthand to disambiguate the class name.
*/
private static class JProperty<S extends Storable> implements JDBCStorableProperty<S> {
+ private static final long serialVersionUID = -7333912817502875485L;
+
private final StorableProperty<S> mMainProperty;
private final String mColumnName;
private final Integer mDataType;
@@ -1393,6 +1393,7 @@ public class JDBCStorableIntrospector extends StorableIntrospector {
return mExternal.clone();
}
+ @Override
public String toString() {
return mMainProperty.toString();
}
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java
index 39d5a5a..d89a291 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java
@@ -25,8 +25,6 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -111,6 +109,7 @@ class JDBCStorage<S extends Storable> extends StandardQueryFactory<S>
(info.getStorableType(), repository.mTriggerFactories);
}
+ @Override
public Class<S> getStorableType() {
return mInfo.getStorableType();
}
@@ -292,6 +291,7 @@ class JDBCStorage<S extends Storable> extends StandardQueryFactory<S>
return mInfo;
}
+ @Override
protected StandardQuery<S> createQuery(Filter<S> filter,
FilterValues<S> values,
OrderingList<S> ordering,
@@ -780,6 +780,7 @@ class JDBCStorage<S extends Storable> extends StandardQueryFactory<S>
return mOrdering;
}
+ @Override
public boolean printNative(Appendable app, int indentLevel, FilterValues<S> values)
throws IOException
{
@@ -933,18 +934,22 @@ class JDBCStorage<S extends Storable> extends StandardQueryFactory<S>
}
}
+ @Override
protected Transaction enterTransaction(IsolationLevel level) {
return getRootRepository().enterTransaction(level);
}
+ @Override
protected QueryFactory<S> queryFactory() {
return JDBCStorage.this;
}
+ @Override
protected QueryExecutorFactory<S> executorFactory() {
return JDBCStorage.this.mExecutorFactory;
}
+ @Override
protected StandardQuery<S> newInstance(FilterValues<S> values, OrderingList<S> ordering,
QueryHints hints)
{
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java
index ca63331..c499a6b 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCTransactionManager.java
@@ -45,6 +45,7 @@ class JDBCTransactionManager extends TransactionManager<JDBCTransaction> {
mRepositoryRef = new WeakReference<JDBCRepository>(repository);
}
+ @Override
protected IsolationLevel selectIsolationLevel(Transaction parent, IsolationLevel level) {
JDBCRepository repo = mRepositoryRef.get();
if (repo == null) {
@@ -53,11 +54,13 @@ class JDBCTransactionManager extends TransactionManager<JDBCTransaction> {
return repo.selectIsolationLevel(parent, level);
}
+ @Override
protected boolean supportsForUpdate() {
JDBCRepository repo = mRepositoryRef.get();
return repo != null && repo.supportsSelectForUpdate();
}
+ @Override
protected JDBCTransaction createTxn(JDBCTransaction parent, IsolationLevel level)
throws SQLException, FetchException
{
@@ -82,6 +85,7 @@ class JDBCTransactionManager extends TransactionManager<JDBCTransaction> {
txn.reuse();
}
+ @Override
protected boolean commitTxn(JDBCTransaction txn) throws PersistException {
try {
txn.commit();
@@ -91,6 +95,7 @@ class JDBCTransactionManager extends TransactionManager<JDBCTransaction> {
}
}
+ @Override
protected void abortTxn(JDBCTransaction txn) throws PersistException {
try {
Connection con;
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JoinNode.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JoinNode.java
index d5a2ba4..1337476 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JoinNode.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JoinNode.java
@@ -191,6 +191,7 @@ class JoinNode {
mAliasRequired = true;
}
+ @Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("{table=");
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/LiteralStatement.java b/src/main/java/com/amazon/carbonado/repo/jdbc/LiteralStatement.java
index ceedd94..f53a6c7 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/LiteralStatement.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/LiteralStatement.java
@@ -34,6 +34,7 @@ class LiteralStatement<S extends Storable> extends SQLStatement<S> {
mStr = str;
}
+ @Override
public int maxLength() {
return mStr.length();
}
@@ -43,6 +44,7 @@ class LiteralStatement<S extends Storable> extends SQLStatement<S> {
return mStr;
}
+ @Override
public void appendTo(StringBuilder b, FilterValues<S> filterValues) {
b.append(mStr);
}
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/MysqlExceptionTransformer.java b/src/main/java/com/amazon/carbonado/repo/jdbc/MysqlExceptionTransformer.java
index 6b86757..3402bda 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/MysqlExceptionTransformer.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/MysqlExceptionTransformer.java
@@ -28,6 +28,7 @@ import java.sql.SQLException;
class MysqlExceptionTransformer extends JDBCExceptionTransformer {
public static int DUPLICATE_ENTRY = 1062;
+ @Override
public boolean isUniqueConstraintError(SQLException e) {
if (isConstraintError(e)) {
String sqlstate = e.getSQLState();
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/NullablePropertyStatement.java b/src/main/java/com/amazon/carbonado/repo/jdbc/NullablePropertyStatement.java
index 4c7e4db..6843c7a 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/NullablePropertyStatement.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/NullablePropertyStatement.java
@@ -37,10 +37,12 @@ class NullablePropertyStatement<S extends Storable> extends SQLStatement<S> {
mIsNullOp = isNullOp;
}
+ @Override
public int maxLength() {
return mIsNullOp ? 8 : 12; // for " IS NULL" or " IS NOT NULL"
}
+ @Override
public void appendTo(StringBuilder b, FilterValues<S> filterValues) {
if (filterValues != null
&& filterValues.getValue(mFilter) == null
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/OracleExceptionTransformer.java b/src/main/java/com/amazon/carbonado/repo/jdbc/OracleExceptionTransformer.java
index 6f3ff4a..cb633c2 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/OracleExceptionTransformer.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/OracleExceptionTransformer.java
@@ -30,6 +30,7 @@ class OracleExceptionTransformer extends JDBCExceptionTransformer {
public static int INSUFFICIENT_PRIVILEGES = 1031;
+ @Override
public boolean isUniqueConstraintError(SQLException e) {
if (isConstraintError(e)) {
String sqlstate = e.getSQLState();
@@ -40,6 +41,7 @@ class OracleExceptionTransformer extends JDBCExceptionTransformer {
return false;
}
+ @Override
public boolean isInsufficientPrivilegesError(SQLException e) {
if (e != null) {
int errorCode = e.getErrorCode();
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/OracleSupportStrategy.java b/src/main/java/com/amazon/carbonado/repo/jdbc/OracleSupportStrategy.java
index 4098933..2a0c9be 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/OracleSupportStrategy.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/OracleSupportStrategy.java
@@ -35,14 +35,14 @@ import com.amazon.carbonado.PersistException;
* @author bcastill
*/
class OracleSupportStrategy extends JDBCSupportStrategy {
-
+
private static final String DEFAULT_SEQUENCE_SELECT_STATEMENT = "SELECT %s.NEXTVAL FROM DUAL";
private static final String TRUNCATE_STATEMENT = "TRUNCATE TABLE %s";
-
+
private static final int LOB_CHUNK_LIMIT = 2000;
- private static final String PLAN_TABLE_NAME = "TEMP_CARBONADO_PLAN_TABLE";
+ //private static final String PLAN_TABLE_NAME = "TEMP_CARBONADO_PLAN_TABLE";
final Method mBLOB_empty_lob;
final Method mBLOB_getBinaryStream;
@@ -63,7 +63,7 @@ class OracleSupportStrategy extends JDBCSupportStrategy {
setSequenceSelectStatement(DEFAULT_SEQUENCE_SELECT_STATEMENT);
setTruncateTableStatement(TRUNCATE_STATEMENT);
-
+
// Access all the custom oracle.sql.BLOB methods via reflection.
{
Method blob_empty_lob = null;
@@ -104,7 +104,7 @@ class OracleSupportStrategy extends JDBCSupportStrategy {
try {
Class clobClass = Class.forName("oracle.sql.CLOB");
-
+
clob_empty_lob = clobClass.getMethod("empty_lob");
clob_getCharacterStream = clobClass.getMethod("getCharacterStream", long.class);
clob_length = clobClass.getMethod("length");
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/SQLStatement.java b/src/main/java/com/amazon/carbonado/repo/jdbc/SQLStatement.java
index 92308f7..4cfd5f5 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/SQLStatement.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/SQLStatement.java
@@ -49,6 +49,7 @@ abstract class SQLStatement<S extends Storable> {
/**
* Just used for debugging.
*/
+ @Override
public String toString() {
StringBuilder b = new StringBuilder();
appendTo(b, null);
diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java
index 6d07801..c4c8414 100644
--- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java
+++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java
@@ -242,6 +242,7 @@ class LoggingQuery<S extends Storable> implements Query<S> {
appendable.append(mQuery.toString());
}
+ @Override
public String toString() {
return mQuery.toString();
}
diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java
index 4032313..3c47857 100644
--- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java
+++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepository.java
@@ -27,8 +27,6 @@ import com.amazon.carbonado.Storable;
import com.amazon.carbonado.Storage;
import com.amazon.carbonado.SupportException;
import com.amazon.carbonado.Transaction;
-import com.amazon.carbonado.TriggerFactory;
-
import com.amazon.carbonado.capability.Capability;
import com.amazon.carbonado.spi.StoragePool;
@@ -56,6 +54,7 @@ class LoggingRepository implements Repository, LogAccessCapability {
mLog = log;
mStoragePool = new StoragePool() {
+ @Override
protected <S extends Storable> Storage<S> createStorage(Class<S> type)
throws RepositoryException
{
diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java
index b8c2892..7463a09 100644
--- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java
+++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingRepositoryBuilder.java
@@ -148,6 +148,7 @@ public class LoggingRepositoryBuilder extends AbstractRepositoryBuilder {
return mRepoBuilder;
}
+ @Override
public void errorCheck(Collection<String> messages) throws ConfigurationException {
super.errorCheck(messages);
if (mRepoBuilder == null) {
diff --git a/src/main/java/com/amazon/carbonado/repo/map/MapCursor.java b/src/main/java/com/amazon/carbonado/repo/map/MapCursor.java
index cd0f7e3..006fd46 100644
--- a/src/main/java/com/amazon/carbonado/repo/map/MapCursor.java
+++ b/src/main/java/com/amazon/carbonado/repo/map/MapCursor.java
@@ -25,7 +25,6 @@ import java.util.NoSuchElementException;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import com.amazon.carbonado.FetchException;
-import com.amazon.carbonado.IsolationLevel;
import com.amazon.carbonado.Storable;
import com.amazon.carbonado.cursor.AbstractCursor;
diff --git a/src/main/java/com/amazon/carbonado/repo/map/MapRepository.java b/src/main/java/com/amazon/carbonado/repo/map/MapRepository.java
index 2e82f89..99b0e3b 100644
--- a/src/main/java/com/amazon/carbonado/repo/map/MapRepository.java
+++ b/src/main/java/com/amazon/carbonado/repo/map/MapRepository.java
@@ -88,24 +88,29 @@ class MapRepository extends AbstractRepository<MapTransaction>
return ((MapStorage) storageFor(storableType)).getIndexInfo();
}
+ @Override
protected Log getLog() {
return null;
}
+ @Override
protected TransactionManager<MapTransaction> transactionManager() {
return mTxnManager;
}
+ @Override
protected TransactionScope<MapTransaction> localTransactionScope() {
return mTxnManager.localScope();
}
+ @Override
protected <S extends Storable> Storage<S> createStorage(Class<S> type)
throws RepositoryException
{
return new MapStorage<S>(this, type, mLockTimeout, mLockTimeoutUnit);
}
+ @Override
protected SequenceValueProducer createSequenceValueProducer(String name)
throws RepositoryException
{
diff --git a/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java b/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java
index 520d18c..c8a6e9c 100644
--- a/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java
+++ b/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java
@@ -23,22 +23,16 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
-import java.util.Iterator;
import java.util.List;
import java.util.NavigableMap;
-import java.util.Set;
-
import java.util.concurrent.ConcurrentNavigableMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.TimeUnit;
-import org.cojen.classfile.TypeDesc;
-
import com.amazon.carbonado.Cursor;
import com.amazon.carbonado.FetchException;
import com.amazon.carbonado.FetchInterruptedException;
import com.amazon.carbonado.FetchTimeoutException;
-import com.amazon.carbonado.IsolationLevel;
import com.amazon.carbonado.PersistException;
import com.amazon.carbonado.PersistInterruptedException;
import com.amazon.carbonado.PersistTimeoutException;
@@ -71,15 +65,11 @@ import com.amazon.carbonado.gen.MasterFeature;
import com.amazon.carbonado.util.QuickConstructorGenerator;
-import com.amazon.carbonado.filter.Filter;
-
-import com.amazon.carbonado.info.ChainedProperty;
import com.amazon.carbonado.info.Direction;
import com.amazon.carbonado.info.OrderedProperty;
import com.amazon.carbonado.info.StorableIndex;
import com.amazon.carbonado.info.StorableInfo;
import com.amazon.carbonado.info.StorableIntrospector;
-import com.amazon.carbonado.info.StorableProperty;
import com.amazon.carbonado.qe.BoundaryType;
import com.amazon.carbonado.qe.QueryExecutorFactory;
diff --git a/src/main/java/com/amazon/carbonado/repo/map/MapTransaction.java b/src/main/java/com/amazon/carbonado/repo/map/MapTransaction.java
index 93bcbdc..2857d31 100644
--- a/src/main/java/com/amazon/carbonado/repo/map/MapTransaction.java
+++ b/src/main/java/com/amazon/carbonado/repo/map/MapTransaction.java
@@ -33,7 +33,6 @@ import com.amazon.carbonado.PersistException;
import com.amazon.carbonado.PersistInterruptedException;
import com.amazon.carbonado.PersistTimeoutException;
import com.amazon.carbonado.Storable;
-import com.amazon.carbonado.Storage;
/**
*
@@ -127,6 +126,7 @@ class MapTransaction {
storage.mapRemove(key);
}
+ @Override
public String toString() {
return "undo insert by remove: " + key;
}
@@ -142,6 +142,7 @@ class MapTransaction {
storage.mapPut(old);
}
+ @Override
public String toString() {
return "undo update by put: " + old;
}
@@ -157,6 +158,7 @@ class MapTransaction {
storage.mapPut(old);
}
+ @Override
public String toString() {
return "undo delete by put: " + old;
}
diff --git a/src/main/java/com/amazon/carbonado/repo/map/MapTransactionManager.java b/src/main/java/com/amazon/carbonado/repo/map/MapTransactionManager.java
index 5598353..929ab17 100644
--- a/src/main/java/com/amazon/carbonado/repo/map/MapTransactionManager.java
+++ b/src/main/java/com/amazon/carbonado/repo/map/MapTransactionManager.java
@@ -40,6 +40,7 @@ class MapTransactionManager extends TransactionManager<MapTransaction> {
mLockTimeoutUnit = lockTimeoutUnit;
}
+ @Override
protected IsolationLevel selectIsolationLevel(Transaction parent, IsolationLevel level) {
if (level == null) {
if (parent == null) {
@@ -63,10 +64,12 @@ class MapTransactionManager extends TransactionManager<MapTransaction> {
}
}
+ @Override
protected boolean supportsForUpdate() {
return true;
}
+ @Override
protected MapTransaction createTxn(MapTransaction parent, IsolationLevel level)
throws Exception
{
@@ -87,11 +90,13 @@ class MapTransactionManager extends TransactionManager<MapTransaction> {
return new MapTransaction(parent, level, timeout, unit);
}
+ @Override
protected boolean commitTxn(MapTransaction txn) throws PersistException {
txn.commit();
return false;
}
+ @Override
protected void abortTxn(MapTransaction txn) throws PersistException {
txn.abort();
}
diff --git a/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java b/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java
index e4e8a56..55074e1 100644
--- a/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java
+++ b/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java
@@ -384,7 +384,6 @@ class UpgradableLock<L> {
* @param locker object trying to become lock owner
*/
public final void lockForWrite(L locker) {
- Result writeResult;
if (!tryLockForWrite(locker)) {
Result upgradeResult = lockForUpgrade_(locker);
if (!tryLockForWrite(locker)) {
@@ -506,6 +505,7 @@ class UpgradableLock<L> {
}
}
+ @Override
public String toString() {
int state = mState;
int readLocks = state & ~LOCK_STATE_MASK;
diff --git a/src/main/java/com/amazon/carbonado/repo/replicated/BlobReplicationTrigger.java b/src/main/java/com/amazon/carbonado/repo/replicated/BlobReplicationTrigger.java
index 0657d50..f925b20 100644
--- a/src/main/java/com/amazon/carbonado/repo/replicated/BlobReplicationTrigger.java
+++ b/src/main/java/com/amazon/carbonado/repo/replicated/BlobReplicationTrigger.java
@@ -41,7 +41,6 @@ import com.amazon.carbonado.info.StorableProperty;
import com.amazon.carbonado.lob.AbstractBlob;
import com.amazon.carbonado.lob.Blob;
-import com.amazon.carbonado.lob.ByteArrayBlob;
/**
* After loading a replica, replaces all Blobs with ReplicatedBlobs.
@@ -145,14 +144,17 @@ class BlobReplicationTrigger<S extends Storable> extends Trigger<S> {
return mReplicaBlob.getLength();
}
+ @Override
public String asString() throws FetchException {
return mReplicaBlob.asString();
}
+ @Override
public String asString(String charsetName) throws FetchException {
return mReplicaBlob.asString(charsetName);
}
+ @Override
public String asString(Charset charset) throws FetchException {
return mReplicaBlob.asString(charset);
}
@@ -281,21 +283,25 @@ class BlobReplicationTrigger<S extends Storable> extends Trigger<S> {
mReplicaOut = replica;
}
+ @Override
public void write(int b) throws IOException {
mMasterOut.write(b);
mReplicaOut.write(b);
}
+ @Override
public void write(byte[] b, int off, int len) throws IOException {
mMasterOut.write(b, off, len);
mReplicaOut.write(b, off, len);
}
+ @Override
public void flush() throws IOException {
mMasterOut.flush();
mReplicaOut.flush();
}
+ @Override
public void close() throws IOException {
mMasterOut.close();
mReplicaOut.close();
diff --git a/src/main/java/com/amazon/carbonado/repo/replicated/ClobReplicationTrigger.java b/src/main/java/com/amazon/carbonado/repo/replicated/ClobReplicationTrigger.java
index 5da6eed..3300210 100644
--- a/src/main/java/com/amazon/carbonado/repo/replicated/ClobReplicationTrigger.java
+++ b/src/main/java/com/amazon/carbonado/repo/replicated/ClobReplicationTrigger.java
@@ -39,7 +39,6 @@ import com.amazon.carbonado.info.StorableProperty;
import com.amazon.carbonado.lob.AbstractClob;
import com.amazon.carbonado.lob.Clob;
-import com.amazon.carbonado.lob.CharArrayClob;
/**
* After loading a replica, replaces all Clobs with ReplicatedClobs.
@@ -143,6 +142,7 @@ class ClobReplicationTrigger<S extends Storable> extends Trigger<S> {
return mReplicaClob.getLength();
}
+ @Override
public String asString() throws FetchException {
return mReplicaClob.asString();
}
@@ -271,21 +271,25 @@ class ClobReplicationTrigger<S extends Storable> extends Trigger<S> {
mReplicaOut = replica;
}
+ @Override
public void write(int c) throws IOException {
mMasterOut.write(c);
mReplicaOut.write(c);
}
+ @Override
public void write(char[] c, int off, int len) throws IOException {
mMasterOut.write(c, off, len);
mReplicaOut.write(c, off, len);
}
+ @Override
public void flush() throws IOException {
mMasterOut.flush();
mReplicaOut.flush();
}
+ @Override
public void close() throws IOException {
mMasterOut.close();
mReplicaOut.close();
diff --git a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java
index f43e043..55a1710 100644
--- a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java
+++ b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepository.java
@@ -152,6 +152,7 @@ class ReplicatedRepository
mMasterRepository = aMasterRepository;
mStoragePool = new StoragePool() {
+ @Override
protected <S extends Storable> Storage<S> createStorage(Class<S> type)
throws SupportException, RepositoryException
{
@@ -448,10 +449,9 @@ class ReplicatedRepository
masterCursor = masterQuery.fetch();
S lastReplicaEntry = null;
- S lastMasterEntry = null;
S replicaEntry = null;
S masterEntry = null;
-
+
int count = 0, txnCount = 0;
while (true) {
if (throttle != null) {
@@ -531,7 +531,7 @@ class ReplicatedRepository
}
}
}
-
+
if (count++ >= RESYNC_WATERMARK || txnCount >= RESYNC_BATCH_SIZE) {
replicaTxn.commit();
if (replicaCursor != null) {
@@ -567,7 +567,6 @@ class ReplicatedRepository
// Replica cursor is missing an entry so copy it.
resyncTask = prepareResyncTask(replicationTrigger, null, masterEntry);
// Allow master to advance.
- lastMasterEntry = masterEntry;
masterEntry = null;
} else {
// If compare is zero, replicaEntry and masterEntry are
@@ -590,7 +589,6 @@ class ReplicatedRepository
replicaCursor = replicaQuery.fetchAfter(replicaEntry);
}
lastReplicaEntry = replicaEntry;
- lastMasterEntry = masterEntry;
replicaEntry = null;
masterEntry = null;
}
diff --git a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepositoryBuilder.java
index 3ab2146..cf19600 100644
--- a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepositoryBuilder.java
+++ b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicatedRepositoryBuilder.java
@@ -85,6 +85,7 @@ public class ReplicatedRepositoryBuilder extends AbstractRepositoryBuilder {
BelatedRepositoryCreator creator = new BelatedRepositoryCreator
(log, mMasterRepositoryBuilder, rootRef, DEFAULT_RETRY_MILLIS) {
+ @Override
protected void createdNotification(Repository repo) {
// Don't need builder any more so restore it.
mMasterRepositoryBuilder.setMaster(originalOption);
@@ -155,6 +156,7 @@ public class ReplicatedRepositoryBuilder extends AbstractRepositoryBuilder {
mMasterRepositoryBuilder = masterRepositoryBuilder;
}
+ @Override
public void errorCheck(Collection<String> messages) throws ConfigurationException {
super.errorCheck(messages);
if (null == getReplicaRepositoryBuilder()) {
diff --git a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java
index 996a9f8..3ab69c0 100644
--- a/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java
+++ b/src/main/java/com/amazon/carbonado/repo/replicated/ReplicationTrigger.java
@@ -22,7 +22,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.amazon.carbonado.FetchException;
-import com.amazon.carbonado.FetchNoneException;
import com.amazon.carbonado.OptimisticLockException;
import com.amazon.carbonado.PersistException;
import com.amazon.carbonado.PersistNoneException;
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);
diff --git a/src/main/java/com/amazon/carbonado/sequence/SequenceValueGenerator.java b/src/main/java/com/amazon/carbonado/sequence/SequenceValueGenerator.java
index 6d8e655..b033919 100644
--- a/src/main/java/com/amazon/carbonado/sequence/SequenceValueGenerator.java
+++ b/src/main/java/com/amazon/carbonado/sequence/SequenceValueGenerator.java
@@ -214,6 +214,7 @@ public class SequenceValueGenerator extends AbstractSequenceValueProducer {
* @throws PersistException for fetch/persist failure or if sequence is
* exhausted for int values.
*/
+ @Override
public int nextIntValue() throws PersistException {
try {
synchronized (mStoredSequence) {
diff --git a/src/main/java/com/amazon/carbonado/sequence/SequenceValueProducerPool.java b/src/main/java/com/amazon/carbonado/sequence/SequenceValueProducerPool.java
index ccebda3..b2949dc 100644
--- a/src/main/java/com/amazon/carbonado/sequence/SequenceValueProducerPool.java
+++ b/src/main/java/com/amazon/carbonado/sequence/SequenceValueProducerPool.java
@@ -47,6 +47,7 @@ public abstract class SequenceValueProducerPool
*
* @param name name of sequence
*/
+ @Override
public SequenceValueProducer get(String name) throws RepositoryException {
return (SequenceValueProducer) super.get(name);
}
@@ -69,6 +70,7 @@ public abstract class SequenceValueProducerPool
}
}
+ @Override
protected final SequenceValueProducer create(String name) throws RepositoryException {
return createSequenceValueProducer(name);
}
diff --git a/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java b/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
index 191f94e..6bf09bc 100644
--- a/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
+++ b/src/main/java/com/amazon/carbonado/spi/AbstractRepository.java
@@ -21,8 +21,6 @@ package com.amazon.carbonado.spi;
import java.lang.ref.WeakReference;
import java.util.Collection;
-import java.util.Map;
-
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -72,6 +70,7 @@ public abstract class AbstractRepository<Txn>
mShutdownLock = new ReentrantReadWriteLock();
mStoragePool = new StoragePool() {
+ @Override
protected <S extends Storable> Storage<S> createStorage(Class<S> type)
throws RepositoryException
{
@@ -85,6 +84,7 @@ public abstract class AbstractRepository<Txn>
};
mSequencePool = new SequenceValueProducerPool() {
+ @Override
protected SequenceValueProducer createSequenceValueProducer(String name)
throws RepositoryException
{
@@ -297,6 +297,7 @@ public abstract class AbstractRepository<Txn>
mRepository = new WeakReference<AbstractRepository<?>>(repository);
}
+ @Override
public void run() {
run(true);
}
diff --git a/src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java b/src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java
index 37e62d0..b5676a4 100644
--- a/src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java
+++ b/src/main/java/com/amazon/carbonado/spi/BelatedRepositoryCreator.java
@@ -78,6 +78,7 @@ public class BelatedRepositoryCreator extends BelatedCreator<Repository, Support
mRootRef = rootRef;
}
+ @Override
protected Repository createReal() throws SupportException {
Exception error;
try {
@@ -100,10 +101,12 @@ public class BelatedRepositoryCreator extends BelatedCreator<Repository, Support
return null;
}
+ @Override
protected Repository createBogus() {
return new BogusRepository();
}
+ @Override
protected void timedOutNotification(long timedOutMillis) {
mLog.error("Timed out waiting for Repository \"" + mBuilder.getName() +
"\" to build after waiting " + timedOutMillis +
diff --git a/src/main/java/com/amazon/carbonado/spi/BelatedStorageCreator.java b/src/main/java/com/amazon/carbonado/spi/BelatedStorageCreator.java
index e0ea552..b68070c 100644
--- a/src/main/java/com/amazon/carbonado/spi/BelatedStorageCreator.java
+++ b/src/main/java/com/amazon/carbonado/spi/BelatedStorageCreator.java
@@ -64,6 +64,7 @@ public class BelatedStorageCreator<S extends Storable>
mStorableType = storableType;
}
+ @Override
protected Storage<S> createReal() throws SupportException {
Exception error;
try {
@@ -86,10 +87,12 @@ public class BelatedStorageCreator<S extends Storable>
return null;
}
+ @Override
protected Storage<S> createBogus() {
return new BogusStorage();
}
+ @Override
protected void timedOutNotification(long timedOutMillis) {
mLog.error("Timed out waiting to get Storage of type \"" + mStorableType.getName() +
"\" after waiting " + timedOutMillis + " milliseconds");
diff --git a/src/main/java/com/amazon/carbonado/spi/BlobProperty.java b/src/main/java/com/amazon/carbonado/spi/BlobProperty.java
index b4ea500..40c77f3 100644
--- a/src/main/java/com/amazon/carbonado/spi/BlobProperty.java
+++ b/src/main/java/com/amazon/carbonado/spi/BlobProperty.java
@@ -37,10 +37,12 @@ class BlobProperty extends LobProperty<Blob> {
super(engine, propertyName);
}
+ @Override
Blob createNewLob(int blockSize) throws PersistException {
return mEngine.createNewBlob(blockSize);
}
+ @Override
void setLobValue(long locator, Blob data) throws PersistException {
try {
mEngine.setBlobValue(locator, data);
diff --git a/src/main/java/com/amazon/carbonado/spi/ClobProperty.java b/src/main/java/com/amazon/carbonado/spi/ClobProperty.java
index dc9d196..64b18ec 100644
--- a/src/main/java/com/amazon/carbonado/spi/ClobProperty.java
+++ b/src/main/java/com/amazon/carbonado/spi/ClobProperty.java
@@ -37,10 +37,12 @@ class ClobProperty extends LobProperty<Clob> {
super(engine, propertyName);
}
+ @Override
Clob createNewLob(int blockSize) throws PersistException {
return mEngine.createNewClob(blockSize);
}
+ @Override
void setLobValue(long locator, Clob data) throws PersistException {
try {
mEngine.setClobValue(locator, data);
diff --git a/src/main/java/com/amazon/carbonado/spi/IndexInfoImpl.java b/src/main/java/com/amazon/carbonado/spi/IndexInfoImpl.java
index de16f75..fad8415 100644
--- a/src/main/java/com/amazon/carbonado/spi/IndexInfoImpl.java
+++ b/src/main/java/com/amazon/carbonado/spi/IndexInfoImpl.java
@@ -101,6 +101,7 @@ public class IndexInfoImpl implements IndexInfo {
return mPropertyDirections.clone();
}
+ @Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("IndexInfo {name=");
diff --git a/src/main/java/com/amazon/carbonado/spi/LobEngine.java b/src/main/java/com/amazon/carbonado/spi/LobEngine.java
index e6fcb07..575ca1d 100644
--- a/src/main/java/com/amazon/carbonado/spi/LobEngine.java
+++ b/src/main/java/com/amazon/carbonado/spi/LobEngine.java
@@ -685,6 +685,7 @@ public class LobEngine {
super(new BlobImpl(lob));
}
+ @Override
public Long getLocator() {
return ((BlobImpl) super.getWrappedBlob()).getLocator();
}
@@ -711,6 +712,7 @@ public class LobEngine {
}
// Override to gain permission.
+ @Override
protected BlobImpl getWrappedBlob() {
return (BlobImpl) super.getWrappedBlob();
}
diff --git a/src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java b/src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java
index d278556..8d5ccd2 100644
--- a/src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java
+++ b/src/main/java/com/amazon/carbonado/spi/LobEngineTrigger.java
@@ -49,6 +49,7 @@ class LobEngineTrigger<S extends Storable> extends Trigger<S> {
}
// Returns user specified Lob values
+ @Override
public Object beforeInsert(S storable) throws PersistException {
// Capture user lob values for later and replace with new locators.
int length = mLobProperties.length;
@@ -65,6 +66,7 @@ class LobEngineTrigger<S extends Storable> extends Trigger<S> {
return userLobs;
}
+ @Override
public void afterInsert(S storable, Object state) throws PersistException {
// Save user lob value contents into new lobs. This is done after the
// insert of the enclosing record to avoid an expensive rollback if a
@@ -81,10 +83,12 @@ class LobEngineTrigger<S extends Storable> extends Trigger<S> {
}
}
+ @Override
public void failedInsert(S storable, Object state) {
unreplaceLobs(storable, state);
}
+ @Override
public Object beforeUpdate(S storable) throws PersistException {
// For each dirty lob property, capture it in case update fails. All
// lob updates are made in this method.
@@ -129,11 +133,13 @@ class LobEngineTrigger<S extends Storable> extends Trigger<S> {
return userLobs;
}
+ @Override
public void failedUpdate(S storable, Object state) {
unreplaceLobs(storable, state);
}
// Returns existing Storable or null
+ @Override
public Object beforeDelete(S storable) throws PersistException {
S existing = (S) storable.copy();
try {
@@ -146,6 +152,7 @@ class LobEngineTrigger<S extends Storable> extends Trigger<S> {
}
}
+ @Override
public void afterDelete(S storable, Object existing) throws PersistException {
if (existing != null) {
// After successful delete of master storable, delete all the lobs.
diff --git a/src/main/java/com/amazon/carbonado/spi/RAFInputStream.java b/src/main/java/com/amazon/carbonado/spi/RAFInputStream.java
index c13763e..a0fe41a 100644
--- a/src/main/java/com/amazon/carbonado/spi/RAFInputStream.java
+++ b/src/main/java/com/amazon/carbonado/spi/RAFInputStream.java
@@ -37,18 +37,22 @@ public class RAFInputStream extends InputStream {
mRAF = raf;
}
+ @Override
public int read() throws IOException {
return mRAF.read();
}
+ @Override
public int read(byte[] b) throws IOException {
return mRAF.read(b);
}
+ @Override
public int read(byte[] b, int offset, int length) throws IOException {
return mRAF.read(b, offset, length);
}
+ @Override
public long skip(long n) throws IOException {
if (n > Integer.MAX_VALUE) {
n = Integer.MAX_VALUE;
@@ -56,6 +60,7 @@ public class RAFInputStream extends InputStream {
return mRAF.skipBytes((int) n);
}
+ @Override
public void close() throws IOException {
mRAF.close();
}
diff --git a/src/main/java/com/amazon/carbonado/spi/RAFOutputStream.java b/src/main/java/com/amazon/carbonado/spi/RAFOutputStream.java
index 1f2954f..e598f00 100644
--- a/src/main/java/com/amazon/carbonado/spi/RAFOutputStream.java
+++ b/src/main/java/com/amazon/carbonado/spi/RAFOutputStream.java
@@ -37,18 +37,22 @@ public class RAFOutputStream extends OutputStream {
mRAF = raf;
}
+ @Override
public void write(int b) throws IOException {
mRAF.write(b);
}
+ @Override
public void write(byte[] b) throws IOException {
mRAF.write(b);
}
+ @Override
public void write(byte[] b, int offset, int length) throws IOException {
mRAF.write(b, offset, length);
}
+ @Override
public void close() throws IOException {
mRAF.close();
}
diff --git a/src/main/java/com/amazon/carbonado/spi/RepairExecutor.java b/src/main/java/com/amazon/carbonado/spi/RepairExecutor.java
index 0bc45ab..fc8a252 100644
--- a/src/main/java/com/amazon/carbonado/spi/RepairExecutor.java
+++ b/src/main/java/com/amazon/carbonado/spi/RepairExecutor.java
@@ -61,6 +61,7 @@ public class RepairExecutor {
("com.amazon.carbonado.spi.RepairExecutor.queueSize", 10000);
cExecutor = new ThreadLocal<RepairExecutor>() {
+ @Override
protected RepairExecutor initialValue() {
return new RepairExecutor(keepAliveSeconds, queueSize);
}
@@ -157,6 +158,7 @@ public class RepairExecutor {
setName(Thread.currentThread().getName() + " (repository repair)");
}
+ @Override
public void run() {
while (true) {
try {
diff --git a/src/main/java/com/amazon/carbonado/spi/StoragePool.java b/src/main/java/com/amazon/carbonado/spi/StoragePool.java
index 98472b0..fb5e7ce 100644
--- a/src/main/java/com/amazon/carbonado/spi/StoragePool.java
+++ b/src/main/java/com/amazon/carbonado/spi/StoragePool.java
@@ -51,6 +51,7 @@ public abstract class StoragePool
return (Storage<S>) super.get(type);
}
+ @Override
protected final Storage create(Class type) throws SupportException, RepositoryException {
return createStorage(type);
}
diff --git a/src/main/java/com/amazon/carbonado/spi/StoredSequence.java b/src/main/java/com/amazon/carbonado/spi/StoredSequence.java
index 5b1fba2..6257258 100644
--- a/src/main/java/com/amazon/carbonado/spi/StoredSequence.java
+++ b/src/main/java/com/amazon/carbonado/spi/StoredSequence.java
@@ -30,6 +30,7 @@ import com.amazon.carbonado.Storable;
* @author Brian S O'Neill
* @deprecated Replaced by {@link com.amazon.carbonado.sequence.StoredSequence}
*/
+@Deprecated
@PrimaryKey("name")
@Authoritative
@Independent
diff --git a/src/main/java/com/amazon/carbonado/synthetic/SyntheticProperty.java b/src/main/java/com/amazon/carbonado/synthetic/SyntheticProperty.java
index d719fdd..7a89468 100644
--- a/src/main/java/com/amazon/carbonado/synthetic/SyntheticProperty.java
+++ b/src/main/java/com/amazon/carbonado/synthetic/SyntheticProperty.java
@@ -218,6 +218,7 @@ public class SyntheticProperty implements Comparable<SyntheticProperty> {
return mName.compareTo(otherProp.mName);
}
+ @Override
public boolean equals(Object o) {
if (this == o) {
return true;
@@ -244,6 +245,7 @@ public class SyntheticProperty implements Comparable<SyntheticProperty> {
return true;
}
+ @Override
public int hashCode() {
int result;
result = (mType != null ? mType.hashCode() : 0);
@@ -260,6 +262,7 @@ public class SyntheticProperty implements Comparable<SyntheticProperty> {
return name;
}
+ @Override
public String toString() {
return mName+'|'+
(mIsNullable?"NULL|":"")+
diff --git a/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java b/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java
index 2a58f93..428f91f 100644
--- a/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java
+++ b/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableBuilder.java
@@ -486,6 +486,7 @@ public class SyntheticStorableBuilder
if (annotationDescs != null && annotationDescs.size() > 0) {
for (String desc : annotationDescs) {
new AnnotationDescParser(desc) {
+ @Override
protected Annotation buildRootAnnotation(TypeDesc rootAnnotationType) {
return mi.addRuntimeVisibleAnnotation(rootAnnotationType);
}
@@ -520,6 +521,7 @@ public class SyntheticStorableBuilder
return mPropertyList;
}
+ @Override
public String toString() {
return mName + mPropertyList.toString();
}
diff --git a/src/main/java/com/amazon/carbonado/util/AnnotationBuilder.java b/src/main/java/com/amazon/carbonado/util/AnnotationBuilder.java
index 9b5b900..e613b0c 100644
--- a/src/main/java/com/amazon/carbonado/util/AnnotationBuilder.java
+++ b/src/main/java/com/amazon/carbonado/util/AnnotationBuilder.java
@@ -38,6 +38,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
mStack = new Stack<Annotation.MemberValue[]>();
}
+ @Override
public Object visit(String name, int pos, java.lang.annotation.Annotation value,
Annotation ann)
{
@@ -54,62 +55,74 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, int value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, long value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, float value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, double value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, boolean value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, byte value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, short value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, char value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, String value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(value));
return null;
}
+ @Override
public Object visit(String name, int pos, Class value, Annotation ann) {
put(ann, name, pos, ann.makeMemberValue(TypeDesc.forClass(value)));
return null;
}
+ @Override
public Object visit(String name, int pos, Enum value, Annotation ann) {
put(ann, name, pos,
ann.makeMemberValue(TypeDesc.forClass(value.getDeclaringClass()), value.name()));
return null;
}
+ @Override
public Object visit(String name, int pos, java.lang.annotation.Annotation[] value,
Annotation ann)
{
@@ -119,6 +132,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, int[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -126,6 +140,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, long[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -133,6 +148,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, float[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -140,6 +156,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, double[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -147,6 +164,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, boolean[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -154,6 +172,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, byte[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -161,6 +180,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, short[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -168,6 +188,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, char[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -175,6 +196,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, String[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -182,6 +204,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, Class[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
@@ -189,6 +212,7 @@ public class AnnotationBuilder extends AnnotationVisitor<Object, Annotation> {
return null;
}
+ @Override
public Object visit(String name, int pos, Enum[] value, Annotation ann) {
mStack.push(new Annotation.MemberValue[value.length]);
super.visit(name, pos, value, ann);
diff --git a/src/main/java/com/amazon/carbonado/util/AnnotationDescPrinter.java b/src/main/java/com/amazon/carbonado/util/AnnotationDescPrinter.java
index 4f80911..b4a995f 100644
--- a/src/main/java/com/amazon/carbonado/util/AnnotationDescPrinter.java
+++ b/src/main/java/com/amazon/carbonado/util/AnnotationDescPrinter.java
@@ -81,6 +81,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return visit(value, null);
}
+ @Override
public Object visit(String name, int pos, Annotation value, Object param) {
if (appendName(name, pos, TAG_ANNOTATION)) {
mBuilder.append(TypeDesc.forClass(value.annotationType()).getDescriptor());
@@ -90,6 +91,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, int value, Object param) {
appendName(name, pos, TAG_INT);
mBuilder.append(value);
@@ -97,6 +99,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, long value, Object param) {
appendName(name, pos, TAG_LONG);
mBuilder.append(value);
@@ -104,6 +107,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, float value, Object param) {
appendName(name, pos, TAG_FLOAT);
mBuilder.append(Float.toString(value));
@@ -111,6 +115,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, double value, Object param) {
appendName(name, pos, TAG_DOUBLE);
mBuilder.append(Double.toString(value));
@@ -118,12 +123,14 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, boolean value, Object param) {
appendName(name, pos, TAG_BOOLEAN);
mBuilder.append(value ? '1' : '0');
return null;
}
+ @Override
public Object visit(String name, int pos, byte value, Object param) {
appendName(name, pos, TAG_BYTE);
mBuilder.append(value);
@@ -131,6 +138,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, short value, Object param) {
appendName(name, pos, TAG_SHORT);
mBuilder.append(value);
@@ -138,12 +146,14 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, char value, Object param) {
appendName(name, pos, TAG_CHAR);
mBuilder.append(value);
return null;
}
+ @Override
public Object visit(String name, int pos, String value, Object param) {
appendName(name, pos, TAG_STRING);
int length = value.length();
@@ -158,6 +168,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Class value, Object param) {
appendName(name, pos, TAG_CLASS);
if (value == String.class) {
@@ -170,6 +181,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Enum value, Object param) {
if (appendName(name, pos, TAG_ENUM)) {
mBuilder.append(value.getDeclaringClass().getName());
@@ -180,6 +192,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Annotation[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -187,6 +200,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, int[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -194,6 +208,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, long[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -201,6 +216,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, float[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -208,6 +224,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, double[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -215,6 +232,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, boolean[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -222,6 +240,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, byte[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -229,6 +248,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, short[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -236,6 +256,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, char[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -243,6 +264,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, String[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -250,6 +272,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Class[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
@@ -257,6 +280,7 @@ public class AnnotationDescPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Enum[] value, Object param) {
appendName(name, pos, TAG_ARRAY);
super.visit(name, pos, value, param);
diff --git a/src/main/java/com/amazon/carbonado/util/AnnotationPrinter.java b/src/main/java/com/amazon/carbonado/util/AnnotationPrinter.java
index df811c0..9aa78c1 100644
--- a/src/main/java/com/amazon/carbonado/util/AnnotationPrinter.java
+++ b/src/main/java/com/amazon/carbonado/util/AnnotationPrinter.java
@@ -48,6 +48,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return visit(value, null);
}
+ @Override
public Object visit(String name, int pos, Annotation value, Object param) {
appendName(name, pos);
mBuilder.append('@');
@@ -58,12 +59,14 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, int value, Object param) {
appendName(name, pos);
mBuilder.append(value);
return null;
}
+ @Override
public Object visit(String name, int pos, long value, Object param) {
appendName(name, pos);
mBuilder.append(value);
@@ -71,6 +74,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, float value, Object param) {
appendName(name, pos);
if (Float.isNaN(value)) {
@@ -86,6 +90,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, double value, Object param) {
appendName(name, pos);
if (Double.isNaN(value)) {
@@ -101,24 +106,28 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, boolean value, Object param) {
appendName(name, pos);
mBuilder.append(value);
return null;
}
+ @Override
public Object visit(String name, int pos, byte value, Object param) {
appendName(name, pos);
mBuilder.append(value);
return null;
}
+ @Override
public Object visit(String name, int pos, short value, Object param) {
appendName(name, pos);
mBuilder.append(value);
return null;
}
+ @Override
public Object visit(String name, int pos, char value, Object param) {
appendName(name, pos);
mBuilder.append('\'');
@@ -198,6 +207,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
}
}
+ @Override
public Object visit(String name, int pos, String value, Object param) {
appendName(name, pos);
mBuilder.append('"');
@@ -209,6 +219,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Class value, Object param) {
appendName(name, pos);
mBuilder.append(value.getName());
@@ -216,6 +227,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Enum value, Object param) {
appendName(name, pos);
mBuilder.append(value.getDeclaringClass().getName());
@@ -224,6 +236,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Annotation[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -232,6 +245,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, int[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -240,6 +254,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, long[] value, Object param) {
appendName(name, pos);
super.visit(name, pos, value, param);
@@ -247,6 +262,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, float[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -255,6 +271,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, double[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -263,6 +280,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, boolean[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -271,6 +289,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, byte[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -279,6 +298,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, short[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -287,6 +307,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, char[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -295,6 +316,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, String[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -303,6 +325,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Class[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
@@ -311,6 +334,7 @@ public class AnnotationPrinter extends AnnotationVisitor<Object, Object> {
return null;
}
+ @Override
public Object visit(String name, int pos, Enum[] value, Object param) {
appendName(name, pos);
mBuilder.append('{');
diff --git a/src/main/java/com/amazon/carbonado/util/TaskQueueThread.java b/src/main/java/com/amazon/carbonado/util/TaskQueueThread.java
index 51febc0..2eaf835 100644
--- a/src/main/java/com/amazon/carbonado/util/TaskQueueThread.java
+++ b/src/main/java/com/amazon/carbonado/util/TaskQueueThread.java
@@ -120,6 +120,7 @@ public class TaskQueueThread extends Thread implements Executor {
mQueue.offer(STOP_TASK);
}
+ @Override
public void run() {
synchronized (this) {
if (mState == STATE_SHOULD_STOP || mState == STATE_STOPPED) {
diff --git a/src/main/java/com/amazon/carbonado/util/WeakReentrantLockPool.java b/src/main/java/com/amazon/carbonado/util/WeakReentrantLockPool.java
index b44a823..77a7317 100644
--- a/src/main/java/com/amazon/carbonado/util/WeakReentrantLockPool.java
+++ b/src/main/java/com/amazon/carbonado/util/WeakReentrantLockPool.java
@@ -40,6 +40,7 @@ class WeakReentrantLockPool<K>
mFair = fair;
}
+ @Override
protected ReentrantLock create(K key) {
return new ReentrantLock(mFair);
}
diff --git a/src/main/java/com/amazon/carbonado/util/WeakReentrantReadWriteLockPool.java b/src/main/java/com/amazon/carbonado/util/WeakReentrantReadWriteLockPool.java
index 3b0663e..6905ab5 100644
--- a/src/main/java/com/amazon/carbonado/util/WeakReentrantReadWriteLockPool.java
+++ b/src/main/java/com/amazon/carbonado/util/WeakReentrantReadWriteLockPool.java
@@ -40,6 +40,7 @@ class WeakReentrantReadWriteLockPool<K>
mFair = fair;
}
+ @Override
protected ReentrantReadWriteLock create(K key) {
return new ReentrantReadWriteLock(mFair);
}