compareIndexes();
}
private void compareIndexes() {
ODatabaseRecordThreadLocal.INSTANCE.set(baseDocumentTx);
OIndexCursor cursor = baseDocumentTx.getMetadata().getIndexManager().getIndex("mi").cursor();
long lastTs = 0;
long minLostTs = Long.MAX_VALUE;
long restoredRecords = 0;
Map.Entry<Object, OIdentifiable> entry = cursor.nextEntry();
while (entry != null) {
ODatabaseRecordThreadLocal.INSTANCE.set(baseDocumentTx);
Integer key = (Integer) entry.getKey();
OIdentifiable identifiable = entry.getValue();
ODocument doc = identifiable.getRecord();
long ts = doc.<Long> field("ts");
if (ts > lastTs)
lastTs = ts;
entry = cursor.nextEntry();
ODatabaseRecordThreadLocal.INSTANCE.set(testDocumentTx);
OIndex testIndex = testDocumentTx.getMetadata().getIndexManager().getIndex("mi");
Set<OIdentifiable> result = (Set<OIdentifiable>) testIndex.get(key);