Skip to content

Commit d7400fb

Browse files
committed
Dial down logging
1 parent c27c747 commit d7400fb

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

cloudata-server-shared/src/main/java/com/cloudata/btree/Keyspace.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.slf4j.Logger;
77
import org.slf4j.LoggerFactory;
88

9-
import com.cloudata.util.Hex;
109
import com.google.common.base.Preconditions;
1110
import com.google.common.base.Throwables;
1211
import com.google.protobuf.ByteString;
@@ -74,7 +73,7 @@ public boolean contains(ByteBuffer buffer) {
7473
}
7574
for (int i = 0; i < keyspaceIdPrefix.size(); i++) {
7675
if (buffer.get(buffer.position() + i) != keyspaceIdPrefix.byteAt(i)) {
77-
log.debug("Mismatch: {} vs {}", Hex.forDebug(buffer), Hex.forDebug(keyspaceIdPrefix));
76+
// log.debug("Mismatch: {} vs {}", Hex.forDebug(buffer), Hex.forDebug(keyspaceIdPrefix));
7877
return false;
7978
}
8079
}

cloudata-server-shared/src/main/java/com/cloudata/btree/MmapPageStore.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class MmapPageStore extends PageStore {
3333

3434
private static final int MASTERPAGE_SLOTS = 8;
3535

36+
private static final boolean DUMP_PAGES = false;
37+
3638
private MmapPageStore(MappedByteBuffer buffer, boolean uniqueKeys) {
3739
this.buffer = buffer;
3840
this.uniqueKeys = uniqueKeys;
@@ -156,11 +158,15 @@ public PageRecord fetchPage(Page parent, int pageNumber) {
156158
throw new IllegalStateException();
157159
}
158160

159-
log.info("Fetched page {}: {}", pageNumber, page);
161+
if (log.isDebugEnabled()) {
162+
log.debug("Fetched page {}: {}", pageNumber, page);
163+
}
160164

161-
synchronized (System.out) {
162-
page.dump(System.out);
163-
System.out.flush();
165+
if (DUMP_PAGES) {
166+
synchronized (System.out) {
167+
page.dump(System.out);
168+
System.out.flush();
169+
}
164170
}
165171

166172
return new PageRecord(page, space);

cloudata-server-shared/src/main/java/com/cloudata/btree/PageHeader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public ByteBuffer getPageSlice() {
3434
slice.position(offset + HEADER_SIZE);
3535
slice.limit(offset + HEADER_SIZE + length);
3636

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

0 commit comments

Comments
 (0)