| | |
| | | package org.opends.server.backends.pluggable; |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.backends.pluggable.EntryIDSet.newSetFromBytes; |
| | | import static org.opends.server.backends.pluggable.JebFormat.dnToDNKey; |
| | | import static org.opends.server.backends.pluggable.VLVIndex.decodeEntryIDFromVLVKey; |
| | | import static org.opends.server.backends.pluggable.JebFormat.*; |
| | | import static org.opends.server.backends.pluggable.VLVIndex.*; |
| | | |
| | | import java.util.AbstractSet; |
| | | import java.util.ArrayList; |
| | |
| | | */ |
| | | private void iterateID2Entry(ReadableTransaction txn) throws StorageRuntimeException |
| | | { |
| | | Cursor cursor = txn.openCursor(id2entry.getName()); |
| | | Cursor<ByteString, ByteString> cursor = txn.openCursor(id2entry.getName()); |
| | | try |
| | | { |
| | | long storedEntryCount = id2entry.getRecordCount(txn); |
| | |
| | | */ |
| | | private void iterateDN2ID(ReadableTransaction txn) throws StorageRuntimeException |
| | | { |
| | | Cursor cursor = txn.openCursor(dn2id.getName()); |
| | | Cursor<ByteString, ByteString> cursor = txn.openCursor(dn2id.getName()); |
| | | try |
| | | { |
| | | while (cursor.next()) |
| | |
| | | */ |
| | | private void iterateID2Children(ReadableTransaction txn) throws StorageRuntimeException |
| | | { |
| | | Cursor cursor = txn.openCursor(id2c.getName()); |
| | | Cursor<ByteString, EntryIDSet> cursor = id2c.openCursor(txn); |
| | | try |
| | | { |
| | | while (cursor.next()) |
| | |
| | | keyCount++; |
| | | |
| | | ByteString key = cursor.getKey(); |
| | | ByteString value = cursor.getValue(); |
| | | |
| | | EntryID entryID; |
| | | try |
| | |
| | | |
| | | try |
| | | { |
| | | entryIDSet = newSetFromBytes(key, value); |
| | | entryIDSet = cursor.getValue(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | errorCount++; |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | logger.trace("File id2children has malformed ID list for ID %s:%n%s%n", |
| | | entryID, StaticUtils.bytesToHex(value)); |
| | | } |
| | | logger.traceException(e); |
| | | logger.trace("File id2children has malformed ID list for ID %s", entryID); |
| | | continue; |
| | | } |
| | | |
| | |
| | | */ |
| | | private void iterateID2Subtree(ReadableTransaction txn) throws StorageRuntimeException |
| | | { |
| | | Cursor cursor = txn.openCursor(id2s.getName()); |
| | | Cursor<ByteString, EntryIDSet> cursor = id2s.openCursor(txn); |
| | | try |
| | | { |
| | | while (cursor.next()) |
| | |
| | | keyCount++; |
| | | |
| | | ByteString key = cursor.getKey(); |
| | | ByteString value = cursor.getValue(); |
| | | |
| | | EntryID entryID; |
| | | try |
| | | { |
| | |
| | | EntryIDSet entryIDSet; |
| | | try |
| | | { |
| | | entryIDSet = newSetFromBytes(key, value); |
| | | entryIDSet = cursor.getValue(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | errorCount++; |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | logger.trace("File id2subtree has malformed ID list " + |
| | | "for ID %s:%n%s%n", entryID, StaticUtils.bytesToHex(value)); |
| | | } |
| | | logger.traceException(e); |
| | | logger.trace("File id2subtree has malformed ID list for ID %s", entryID); |
| | | continue; |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | Cursor cursor = txn.openCursor(vlvIndex.getName()); |
| | | Cursor<ByteString, ByteString> cursor = txn.openCursor(vlvIndex.getName()); |
| | | try |
| | | { |
| | | while (cursor.next()) |
| | |
| | | return; |
| | | } |
| | | |
| | | Cursor cursor = txn.openCursor(index.getName()); |
| | | Cursor<ByteString,EntryIDSet> cursor = index.openCursor(txn); |
| | | try |
| | | { |
| | | while (cursor.next()) |
| | |
| | | keyCount++; |
| | | |
| | | final ByteString key = cursor.getKey(); |
| | | ByteString value = cursor.getValue(); |
| | | |
| | | EntryIDSet entryIDSet; |
| | | try |
| | | { |
| | | entryIDSet = newSetFromBytes(key, value); |
| | | entryIDSet = cursor.getValue(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | errorCount++; |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | logger.trace("Malformed ID list: %s%n%s", |
| | | StaticUtils.bytesToHex(value), keyDump(index.toString(), key)); |
| | | } |
| | | logger.traceException(e); |
| | | logger.trace("Malformed ID list: %n%s", keyDump(index.toString(), key)); |
| | | continue; |
| | | } |
| | | |