summaryrefslogtreecommitdiffstats
path: root/documentapi
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2020-04-24 19:14:32 +0200
committergjoranv <gv@verizonmedia.com>2020-04-25 02:24:38 +0200
commitf94cc116fffbf88ac70e603f91b4561ad743174f (patch)
tree12e1eb0655794787fa45b993fab26cdb2ad8cec6 /documentapi
parent91902bc7a20d8e6af77219e38fb645649610cd5e (diff)
LogLevel -> Level for isLoggable()
Diffstat (limited to 'documentapi')
-rw-r--r--documentapi/src/main/java/com/yahoo/documentapi/ProgressToken.java12
-rwxr-xr-xdocumentapi/src/main/java/com/yahoo/documentapi/VisitorIterator.java30
-rwxr-xr-xdocumentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java8
3 files changed, 25 insertions, 25 deletions
diff --git a/documentapi/src/main/java/com/yahoo/documentapi/ProgressToken.java b/documentapi/src/main/java/com/yahoo/documentapi/ProgressToken.java
index b7c78e28dbe..7e579a3ae6a 100644
--- a/documentapi/src/main/java/com/yahoo/documentapi/ProgressToken.java
+++ b/documentapi/src/main/java/com/yahoo/documentapi/ProgressToken.java
@@ -305,7 +305,7 @@ public class ProgressToken {
&& !progress.equals(FINISHED_BUCKET)
&& !superbucket.contains(progress)
&& !progress.contains(superbucket)) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "updateProgress called with non-contained bucket "
+ "pair " + superbucket + ":" + progress + ", but allowing anyway");
}
@@ -322,7 +322,7 @@ public class ProgressToken {
// If progress == Integer.MAX_VALUE, we're done. Otherwise, we're not
if (!progress.equals(FINISHED_BUCKET)) {
if (entry.getState() != BucketState.BUCKET_ACTIVE) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "updateProgress called with sub-bucket that was "
+ "not marked as active " + superbucket + ":" + progress);
}
@@ -361,13 +361,13 @@ public class ProgressToken {
*/
protected void addBucket(BucketId superbucket, BucketId progress, BucketState state) {
if (progress.equals(FINISHED_BUCKET)) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Trying to add already finished superbucket "
+ superbucket + "; ignoring it");
}
return;
}
- if (log.isLoggable(LogLevel.SPAM)) {
+ if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Adding bucket pair " + superbucket
+ ":" + progress + " with state " + state);
}
@@ -789,13 +789,13 @@ public class ProgressToken {
// Must not merge if sibling isn't pending
if (rightSibling != null) {
assert(rightSibling.getState() == BucketState.BUCKET_PENDING);
- if (log.isLoggable(LogLevel.SPAM)) {
+ if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Merging " + bucket + " with rhs " + rightCheck);
}
// If right sibling has progress, it will unfortunately have to
// be discarded
if (rightSibling.getProgress().getUsedBits() != 0
- && log.isLoggable(LogLevel.DEBUG)) {
+ && log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Bucket progress for " + rightCheck +
" will be lost due to merging; potential for duplicates in result-set");
}
diff --git a/documentapi/src/main/java/com/yahoo/documentapi/VisitorIterator.java b/documentapi/src/main/java/com/yahoo/documentapi/VisitorIterator.java
index 05324d957b8..0dd96275f9d 100755
--- a/documentapi/src/main/java/com/yahoo/documentapi/VisitorIterator.java
+++ b/documentapi/src/main/java/com/yahoo/documentapi/VisitorIterator.java
@@ -110,7 +110,7 @@ public class VisitorIterator {
}
if (!progress.isFinished()) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Importing unfinished progress token with " +
"bits: " + progressToken.getDistributionBitCount() +
", active: " + progressToken.getActiveBucketCount() +
@@ -122,7 +122,7 @@ public class VisitorIterator {
if (!progress.isEmpty()) {
// Lower all active to pending
if (progressToken.getActiveBucketCount() > 0) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Progress token had active buckets upon range " +
"construction. Setting these as pending");
}
@@ -136,7 +136,7 @@ public class VisitorIterator {
// Fixup for bucket cursor in case of bucket space downscaling
correctTruncatedBucketCursor();
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Partial bucket space progress; continuing "+
"from position " + progressToken.getBucketCursor());
}
@@ -195,7 +195,7 @@ public class VisitorIterator {
// half a million splits to cover the same bucket space as that 1
// single-bit bucket once did
if (isLosslessResetPossible()) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "At start of bucket space and all " +
"buckets have no progress; doing a lossless reset " +
"instead of splitting/merging");
@@ -245,7 +245,7 @@ public class VisitorIterator {
BucketId rightCheck = new BucketId(lastMergedBucket.getUsedBits(),
lastMergedBucket.getId() | (1L << (lastMergedBucket.getUsedBits() - 1)));
if (pending.equals(rightCheck)) {
- if (log.isLoggable(LogLevel.SPAM)) {
+ if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Skipped " + pending +
", as it was right sibling of " + lastMergedBucket);
}
@@ -262,7 +262,7 @@ public class VisitorIterator {
}
}
}
- if ((bucketsSplit > 0 || bucketsMerged > 0) && log.isLoggable(LogLevel.DEBUG)) {
+ if ((bucketsSplit > 0 || bucketsMerged > 0) && log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Existing progress' pending buckets had inconsistent " +
"distribution bits; performed " + bucketsSplit + " split ops and " +
bucketsMerged + " merge ops. Pending: " + pendingBefore + " -> " +
@@ -285,7 +285,7 @@ public class VisitorIterator {
progressToken.setBucketCursor(idx + 1);
}
}
- if (log.isLoggable(LogLevel.SPAM)) {
+ if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "New range bucket cursor is " +
progressToken.getBucketCursor());
}
@@ -334,7 +334,7 @@ public class VisitorIterator {
// don't do anything at all yet with the set of pending
if (progressToken.getActiveBucketCount() > 0) {
flushActive = true;
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Holding off new/pending buckets and consistency " +
"correction until all " + progress.getActiveBucketCount() +
" active buckets have been updated");
@@ -349,7 +349,7 @@ public class VisitorIterator {
// reset-checking to be performed
correctInconsistentPending(distributionBitCount);
if (delta > 0) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Increasing distribution bits for full bucket " +
"space range source from " + progressToken.getDistributionBitCount() + " to " +
distributionBitCount);
@@ -359,7 +359,7 @@ public class VisitorIterator {
// we go from eg. 3:0x02 to 4:0x02 to 5:02 etc.
progressToken.setBucketCursor(progressToken.getBucketCursor() << delta);
} else if (delta < 0) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Decreasing distribution bits for full bucket " +
"space range source from " + progressToken.getDistributionBitCount() +
" to " + distributionBitCount + " bits");
@@ -386,14 +386,14 @@ public class VisitorIterator {
// We should now always flush active buckets before doing a
// consistency fix. This simplifies things greatly
assert(flushActive);
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Received non-finished bucket " +
superbucket + " with wrong distribution bit count (" +
superbucket.getUsedBits() + "). Waiting to correct " +
"until all active are done");
}
} else {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Received finished bucket " +
superbucket + " with wrong distribution bit count (" +
superbucket.getUsedBits() + "). Waiting to correct " +
@@ -404,7 +404,7 @@ public class VisitorIterator {
if (progressToken.getActiveBucketCount() == 0) {
if (flushActive) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "All active buckets flushed, " +
"correcting progress token and continuing normal operation");
}
@@ -508,7 +508,7 @@ public class VisitorIterator {
// a no-op, since its buckets already are fixed at 32 used bits.
progress.setDistributionBitCount(distributionBitCount);
this.distributionBitCount = distributionBitCount;
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Set distribution bit count to "
+ distributionBitCount + " for explicit bucket source (no-op)");
}
@@ -721,7 +721,7 @@ public class VisitorIterator {
if (distributionBitCount != distBits) {
bucketSource.setDistributionBitCount(distBits, progressToken);
distributionBitCount = distBits;
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Set visitor iterator distribution bit count to "
+ distBits);
}
diff --git a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java
index 429c9bc0f51..1ad84cb0b25 100755
--- a/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java
+++ b/documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSession.java
@@ -574,7 +574,7 @@ public class MessageBusVisitorSession implements VisitorSession {
1,
progressToken);
} else {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "parameters specify explicit bucket set " +
"to visit; using it rather than document selection (" +
params.getBucketsToVisit().size() + " buckets given)");
@@ -754,7 +754,7 @@ public class MessageBusVisitorSession implements VisitorSession {
@Override
public void run() {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Visitor session " + sessionName + ": Received message " + message);
}
try {
@@ -809,7 +809,7 @@ public class MessageBusVisitorSession implements VisitorSession {
Reply reply = msg.createReply();
msg.swapState(reply);
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Visitor session " + sessionName +
": Received VisitorInfo with " +
msg.getFinishedBuckets().size() + " finished buckets");
@@ -1101,7 +1101,7 @@ public class MessageBusVisitorSession implements VisitorSession {
@Override
public void ack(AckToken token) {
- if (log.isLoggable(LogLevel.DEBUG)) {
+ if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "Visitor session " + sessionName +
": Sending ack " + token.ackObject);
}