Skip to content

Commit

Permalink
Dial down logging
Browse files Browse the repository at this point in the history
  • Loading branch information
justinsb committed Dec 18, 2013
1 parent c27c747 commit d7400fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cloudata.util.Hex;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.protobuf.ByteString;
Expand Down Expand Up @@ -74,7 +73,7 @@ public boolean contains(ByteBuffer buffer) {
}
for (int i = 0; i < keyspaceIdPrefix.size(); i++) {
if (buffer.get(buffer.position() + i) != keyspaceIdPrefix.byteAt(i)) {
log.debug("Mismatch: {} vs {}", Hex.forDebug(buffer), Hex.forDebug(keyspaceIdPrefix));
// log.debug("Mismatch: {} vs {}", Hex.forDebug(buffer), Hex.forDebug(keyspaceIdPrefix));
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class MmapPageStore extends PageStore {

private static final int MASTERPAGE_SLOTS = 8;

private static final boolean DUMP_PAGES = false;

private MmapPageStore(MappedByteBuffer buffer, boolean uniqueKeys) {
this.buffer = buffer;
this.uniqueKeys = uniqueKeys;
Expand Down Expand Up @@ -156,11 +158,15 @@ public PageRecord fetchPage(Page parent, int pageNumber) {
throw new IllegalStateException();
}

log.info("Fetched page {}: {}", pageNumber, page);
if (log.isDebugEnabled()) {
log.debug("Fetched page {}: {}", pageNumber, page);
}

synchronized (System.out) {
page.dump(System.out);
System.out.flush();
if (DUMP_PAGES) {
synchronized (System.out) {
page.dump(System.out);
System.out.flush();
}
}

return new PageRecord(page, space);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ByteBuffer getPageSlice() {
slice.position(offset + HEADER_SIZE);
slice.limit(offset + HEADER_SIZE + length);

log.info("Buffer: {} - {}", offset + HEADER_SIZE, offset + HEADER_SIZE + length);
// log.info("Buffer: {} - {}", offset + HEADER_SIZE, offset + HEADER_SIZE + length);
return slice.slice().asReadOnlyBuffer();
}

Expand Down

0 comments on commit d7400fb

Please sign in to comment.