use of org.sirix.page.UnorderedKeyValuePage in project sirix by sirixdb.
the class PageWriteTrxImpl method removeEntry.
@Override
public void removeEntry(final Long recordKey, @Nonnull final PageKind pageKind, final int index, final Optional<UnorderedKeyValuePage> keyValuePage) throws SirixIOException {
mPageRtx.assertNotClosed();
final long nodePageKey = mPageRtx.pageKey(recordKey);
final PageContainer cont = prepareRecordPage(nodePageKey, index, pageKind);
final Optional<Record> node = getRecord(recordKey, pageKind, index);
if (node.isPresent()) {
final Record nodeToDel = node.get();
final Node delNode = new DeletedNode(new NodeDelegate(nodeToDel.getNodeKey(), -1, -1, -1, Optional.<SirixDeweyID>empty()));
((UnorderedKeyValuePage) cont.getModified()).setEntry(delNode.getNodeKey(), delNode);
((UnorderedKeyValuePage) cont.getComplete()).setEntry(delNode.getNodeKey(), delNode);
} else {
throw new IllegalStateException("Node not found!");
}
}
use of org.sirix.page.UnorderedKeyValuePage in project sirix by sirixdb.
the class PageWriteTrxImpl method dereferenceRecordPageForModification.
/**
* Dereference record page reference.
*
* @param reference reference to leaf, that is the record page
* @return dereferenced page
*/
private PageContainer dereferenceRecordPageForModification(final PageReference reference) {
final List<UnorderedKeyValuePage> revs = mPageRtx.getSnapshotPages(reference);
final Versioning revisioning = mPageRtx.mResourceManager.getResourceConfig().mRevisionKind;
final int mileStoneRevision = mPageRtx.mResourceManager.getResourceConfig().mRevisionsToRestore;
return revisioning.combineRecordPagesForModification(revs, mileStoneRevision, mPageRtx, reference);
}
Aggregations