use of org.sirix.node.delegates.NodeDelegate 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!");
}
}
Aggregations