diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2011-05-04 00:20:02 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2011-05-04 00:20:02 +0000 |
commit | 121886bc0c92389610408e3b415abb992ad8a212 (patch) | |
tree | ccd7bcada5efd29b9106e2150734bee375fe1163 /src/main/java/com/amazon/carbonado/repo/logging | |
parent | 5be9a7ea0f9aad9e97c4d70cb82ce8a22f2d412a (diff) |
Add support for Query controller and timeouts; remove vestigial support for interrupts.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo/logging')
-rw-r--r-- | src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java | 94 |
1 files changed, 94 insertions, 0 deletions
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 08be6e3..5dc4d3b 100644 --- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java +++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingQuery.java @@ -165,6 +165,15 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public Cursor<S> fetch(Controller controller) throws FetchException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.fetch(controller) on " + this + ", controller: " + controller);
+ }
+ return mQuery.fetch(controller);
+ }
+
+ @Override
public Cursor<S> fetchSlice(long from, Long to) throws FetchException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -175,6 +184,16 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public Cursor<S> fetchSlice(long from, Long to, Controller controller) throws FetchException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.fetchSlice(start, to, controller) on " + this +
+ ", from: " + from + ", to: " + to + ", controller: " + controller);
+ }
+ return mQuery.fetchSlice(from, to, controller);
+ }
+
+ @Override
public <T extends S> Cursor<S> fetchAfter(T start) throws FetchException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -184,6 +203,18 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public <T extends S> Cursor<S> fetchAfter(T start, Controller controller)
+ throws FetchException
+ {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.fetchAfter(start, controller) on " + this + ", start: " + start
+ + ", controller: " + controller);
+ }
+ return mQuery.fetchAfter(start, controller);
+ }
+
+ @Override
public S loadOne() throws FetchException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -193,6 +224,15 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public S loadOne(Controller controller) throws FetchException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.loadOne() on " + this + ", controller: " + controller);
+ }
+ return mQuery.loadOne(controller);
+ }
+
+ @Override
public S tryLoadOne() throws FetchException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -202,6 +242,15 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public S tryLoadOne(Controller controller) throws FetchException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.tryLoadOne(controller) on " + this + ", controller: " + controller);
+ }
+ return mQuery.tryLoadOne(controller);
+ }
+
+ @Override
public void deleteOne() throws PersistException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -211,6 +260,15 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public void deleteOne(Controller controller) throws PersistException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.deleteOne(controller) on " + this + ", controller: " + controller);
+ }
+ mQuery.deleteOne(controller);
+ }
+
+ @Override
public boolean tryDeleteOne() throws PersistException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -220,6 +278,15 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public boolean tryDeleteOne(Controller controller) throws PersistException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.tryDeleteOne(controller) on " + this + ", controller: " + controller);
+ }
+ return mQuery.tryDeleteOne(controller);
+ }
+
+ @Override
public void deleteAll() throws PersistException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -229,6 +296,15 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public void deleteAll(Controller controller) throws PersistException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.deleteAll(controller) on " + this + ", controller: " + controller);
+ }
+ mQuery.deleteAll(controller);
+ }
+
+ @Override
public long count() throws FetchException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -238,6 +314,15 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public long count(Controller controller) throws FetchException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.count(controller) on " + this + ", controller: " + controller);
+ }
+ return mQuery.count(controller);
+ }
+
+ @Override
public boolean exists() throws FetchException {
Log log = mStorage.mLog;
if (log.isEnabled()) {
@@ -247,6 +332,15 @@ class LoggingQuery<S extends Storable> implements Query<S> { }
@Override
+ public boolean exists(Controller controller) throws FetchException {
+ Log log = mStorage.mLog;
+ if (log.isEnabled()) {
+ log.write("Query.exists(controller) on " + this + ", controller: " + controller);
+ }
+ return mQuery.exists(controller);
+ }
+
+ @Override
public boolean printNative() {
return mQuery.printNative();
}
|