core/src/main/java/com/orientechnologies/orient/core/storage/cluster/OClusterPage.java
public void dumpToLog() {
    final StringBuilder text = new StringBuilder();

    text.append("Dump of ").append(this).append('\n');
    text.append("Magic:\t\t\t").append(String.format("%016X", getLongValue(MAGIC_NUMBER_OFFSET))).append('\n');
    text.append("CRC32:\t\t\t").append(String.format("%08X", getIntValue(CRC32_OFFSET))).append('\n');
    text.append("WAL Segment:\t").append(String.format("%016X", getLongValue(WAL_SEGMENT_OFFSET))).append('\n');
    text.append("WAL Position:\t").append(String.format("%016X", getLongValue(WAL_POSITION_OFFSET))).append('\n');
    text.append("Next Page:\t\t").append(String.format("%016X", getLongValue(NEXT_PAGE_OFFSET))).append('\n');
    text.append("Prev Page:\t\t").append(String.format("%016X", getLongValue(PREV_PAGE_OFFSET))).append('\n');
    text.append("Free List:\t\t").append(String.format("%08X", getIntValue(FREELIST_HEADER_OFFSET))).append('\n');
    text.append("Free Pointer:\t").append(String.format("%08X", getIntValue(FREE_POSITION_OFFSET))).append('\n');
    text.append("Free Space:\t\t").append(String.format("%08X", getIntValue(FREE_SPACE_COUNTER_OFFSET))).append('\n');
    text.append("Entry Count:\t").append(String.format("%08X", getIntValue(ENTRIES_COUNT_OFFSET))).append('\n');
    final int indexCount = getIntValue(PAGE_INDEXES_LENGTH_OFFSET);
    text.append("Index Count:\t").append(String.format("%08X", indexCount)).append("\n\n");

    int foundEntries = 0;
    for (int i = 0; i < indexCount; ++i) {
      final int offset = getIntValue(PAGE_INDEXES_OFFSET + i * INDEX_ITEM_SIZE);
      text.append("\tOffset:\t\t").append(String.format("%08X", offset)).append(" (").append(i).append(")\n");
      text.append("\tVersion:\t")
          .append(String.format("%08X", getIntValue(PAGE_INDEXES_OFFSET + i * INDEX_ITEM_SIZE + OIntegerSerializer.INT_SIZE)))
          .append('\n');

      if ((offset & MARKED_AS_DELETED_FLAG) != 0) {
        continue;
      }

      final int cleanOffset = offset & POSITION_MASK;

      text.append("\t\tEntry Size:\t");
      if (cleanOffset + OIntegerSerializer.INT_SIZE <= MAX_PAGE_SIZE_BYTES) {
        text.append(String.format("%08X", getIntValue(cleanOffset))).append(" (").append(foundEntries).append(")\n");
      } else {
        text.append("?\n");
      }

      if (cleanOffset + OIntegerSerializer.INT_SIZE * 2 <= MAX_PAGE_SIZE_BYTES) {
        text.append("\t\tIndex:\t\t").append(String.format("%08X", getIntValue(cleanOffset + OIntegerSerializer.INT_SIZE)))
            .append('\n');
      } else {
        text.append("?\n");
      }

      if (cleanOffset + OIntegerSerializer.INT_SIZE * 3 <= MAX_PAGE_SIZE_BYTES) {
        text.append("\t\tData Size:\t").append(String.format("%08X", getIntValue(cleanOffset + OIntegerSerializer.INT_SIZE * 2)))
            .append('\n');
      } else {
        text.append("?\n");
      }

      ++foundEntries;
    }

    OLogManager.instance().error(this, "%s", null, text);
  }
public void dumpToLog() {
    final StringBuilder text = new StringBuilder();

    text.append("Dump of ").append(this).append('\n');
    text.append("Magic:\t\t\t").append(String.format("%016X", getLongValue(MAGIC_NUMBER_OFFSET))).append('\n');
    text.append("CRC32:\t\t\t").append(String.format("%08X", getIntValue(CRC32_OFFSET))).append('\n');
    text.append("WAL Segment:\t").append(String.format("%016X", getLongValue(WAL_SEGMENT_OFFSET))).append('\n');
    text.append("WAL Position:\t").append(String.format("%016X", getLongValue(WAL_POSITION_OFFSET))).append('\n');
    text.append("Next Page:\t\t").append(String.format("%016X", getLongValue(NEXT_PAGE_OFFSET))).append('\n');
    text.append("Prev Page:\t\t").append(String.format("%016X", getLongValue(PREV_PAGE_OFFSET))).append('\n');
    text.append("Free List:\t\t").append(String.format("%08X", getIntValue(FREELIST_HEADER_OFFSET))).append('\n');
    text.append("Free Pointer:\t").append(String.format("%08X", getIntValue(FREE_POSITION_OFFSET))).append('\n');
    text.append("Free Space:\t\t").append(String.format("%08X", getIntValue(FREE_SPACE_COUNTER_OFFSET))).append('\n');
    text.append("Entry Count:\t").append(String.format("%08X", getIntValue(ENTRIES_COUNT_OFFSET))).append('\n');
    final int indexCount = getIntValue(PAGE_INDEXES_LENGTH_OFFSET);
    text.append("Index Count:\t").append(String.format("%08X", indexCount)).append("\n\n");

    int foundEntries = 0;
    for (int i = 0; i < indexCount; ++i) {
      final int offset = getIntValue(PAGE_INDEXES_OFFSET + i * INDEX_ITEM_SIZE);
      text.append("\tOffset:\t\t").append(String.format("%08X", offset)).append(" (").append(i).append(")\n");
      text.append("\tVersion:\t")
          .append(String.format("%08X", getIntValue(PAGE_INDEXES_OFFSET + i * INDEX_ITEM_SIZE + OIntegerSerializer.INT_SIZE)))
          .append('\n');

      if ((offset & MARKED_AS_DELETED_FLAG) != 0) {
        continue;
      }

      final int cleanOffset = offset & POSITION_MASK;

      text.append("\t\tEntry Size:\t");
      if (cleanOffset + OIntegerSerializer.INT_SIZE <= MAX_PAGE_SIZE_BYTES) {
        text.append(String.format("%08X", getIntValue(cleanOffset))).append(" (").append(foundEntries).append(")\n");
      } else {
        text.append("?\n");
      }

      if (cleanOffset + OIntegerSerializer.INT_SIZE * 2 <= MAX_PAGE_SIZE_BYTES) {
        text.append("\t\tIndex:\t\t").append(String.format("%08X", getIntValue(cleanOffset + OIntegerSerializer.INT_SIZE)))
            .append('\n');
      } else {
        text.append("?\n");
      }

      if (cleanOffset + OIntegerSerializer.INT_SIZE * 3 <= MAX_PAGE_SIZE_BYTES) {
        text.append("\t\tData Size:\t").append(String.format("%08X", getIntValue(cleanOffset + OIntegerSerializer.INT_SIZE * 2)))
            .append('\n');
      } else {
        text.append("?\n");
      }

      ++foundEntries;
    }

    OLogManager.instance().error(this, "%s", null, text);
  }
public void dumpToLog ( ) { final StringBuilder text = new StringBuilder ( ) ; text . append ( "Dump of " ) . append ( this ) . append ( ' ' ) ; text . append ( "Magic:\t\t\t" ) . append ( String . format ( "%016X" , getLongValue ( MAGIC_NUMBER_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "CRC32:\t\t\t" ) . append ( String . format ( "%08X" , getIntValue ( CRC32_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "WAL Segment:\t" ) . append ( String . format ( "%016X" , getLongValue ( WAL_SEGMENT_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "WAL Position:\t" ) . append ( String . format ( "%016X" , getLongValue ( WAL_POSITION_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "Next Page:\t\t" ) . append ( String . format ( "%016X" , getLongValue ( NEXT_PAGE_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "Prev Page:\t\t" ) . append ( String . format ( "%016X" , getLongValue ( PREV_PAGE_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "Free List:\t\t" ) . append ( String . format ( "%08X" , getIntValue ( FREELIST_HEADER_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "Free Pointer:\t" ) . append ( String . format ( "%08X" , getIntValue ( FREE_POSITION_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "Free Space:\t\t" ) . append ( String . format ( "%08X" , getIntValue ( FREE_SPACE_COUNTER_OFFSET ) ) ) . append ( ' ' ) ; text . append ( "Entry Count:\t" ) . append ( String . format ( "%08X" , getIntValue ( ENTRIES_COUNT_OFFSET ) ) ) . append ( ' ' ) ; final int indexCount = getIntValue ( PAGE_INDEXES_LENGTH_OFFSET ) ; text . append ( "Index Count:\t" ) . append ( String . format ( "%08X" , indexCount ) ) . append ( "\n\n" ) ; int foundEntries = 0 ; for ( int i = 0 ; i < indexCount ; ++ i ) { final int offset = getIntValue ( PAGE_INDEXES_OFFSET + i * INDEX_ITEM_SIZE ) ; text . append ( "\tOffset:\t\t" ) . append ( String . format ( "%08X" , offset ) ) . append ( " (" ) . append ( i ) . append ( ")\n" ) ; text . append ( "\tVersion:\t" ) . append ( String . format ( "%08X" , getIntValue ( PAGE_INDEXES_OFFSET + i * INDEX_ITEM_SIZE + OIntegerSerializer . INT_SIZE ) ) ) . append ( ' ' ) ; if ( ( offset & MARKED_AS_DELETED_FLAG ) != 0 ) { continue ; } final int cleanOffset = offset & POSITION_MASK ; text . append ( "\t\tEntry Size:\t" ) ; if ( cleanOffset + OIntegerSerializer . INT_SIZE <= MAX_PAGE_SIZE_BYTES ) { text . append ( String . format ( "%08X" , getIntValue ( cleanOffset ) ) ) . append ( " (" ) . append ( foundEntries ) . append ( ")\n" ) ; } else { text . append ( "?\n" ) ; } if ( cleanOffset + OIntegerSerializer . INT_SIZE * 2 <= MAX_PAGE_SIZE_BYTES ) { text . append ( "\t\tIndex:\t\t" ) . append ( String . format ( "%08X" , getIntValue ( cleanOffset + OIntegerSerializer . INT_SIZE ) ) ) . append ( ' ' ) ; } else { text . append ( "?\n" ) ; } if ( cleanOffset + OIntegerSerializer . INT_SIZE * 3 <= MAX_PAGE_SIZE_BYTES ) { text . append ( "\t\tData Size:\t" ) . append ( String . format ( "%08X" , getIntValue ( cleanOffset + OIntegerSerializer . INT_SIZE * 2 ) ) ) . append ( ' ' ) ; } else { text . append ( "?\n" ) ; } ++ foundEntries ; } OLogManager . instance ( ) . error ( this , "%s" , null , text ) ; }
Writes binary dump of this cluster page to the log.
Writes binary dump of this cluster page to the log .