예제 #1
0
  // Debugging only
  private void dump() {
    System.err.println(">>>>>>>>>>");
    System.err.println("label = " + label);
    System.err.println("txn = " + txn);
    System.err.println("offset = " + allocOffset);
    System.err.println("journalStartOffset = " + journalObjFileStartOffset);
    System.err.println("journal = " + journalObjFile.getLabel());
    if (true) return;

    System.err.println("nodeTableJournal >>>");
    Iterator<Pair<NodeId, Node>> iter = nodeTableJournal.all();
    for (; iter.hasNext(); ) {
      Pair<NodeId, Node> x = iter.next();
      NodeId nodeId = x.getLeft();
      Node node = x.getRight();
      NodeId mapped = mapFromJournal(nodeId);
      // debug("append: %s -> %s", x, mapFromJournal(nodeId)) ;
      // This does the write.
      NodeId nodeId2 = base.getAllocateNodeId(node);
      System.err.println(x + "  mapped=" + mapped + " getAlloc=" + nodeId2);
    }

    System.err.println("journal >>>");
    Iterator<Pair<Long, ByteBuffer>> iter1 = this.journalObjFile.all();
    for (; iter1.hasNext(); ) {
      Pair<Long, ByteBuffer> p = iter1.next();
      System.err.println(p.getLeft() + " : " + p.getRight());
      ByteBufferLib.print(System.err, p.getRight());
    }

    System.err.println("nodeIndex >>>");
    Iterator<Record> iter2 = this.nodeIndex.iterator();
    for (; iter2.hasNext(); ) {
      Record r = iter2.next();
      System.err.println(r);
    }
    System.err.println("<<<<<<<<<<");
  }
예제 #2
0
 public static void print(ByteBuffer byteBuffer) {
   print(System.out, byteBuffer);
 }