Search in sources :

Example 1 with PathNode

use of org.sirix.index.path.summary.PathNode in project sirix by sirixdb.

the class NodeFactoryImpl method createPathNode.

@Override
public PathNode createPathNode(@Nonnegative final long parentKey, @Nonnegative final long leftSibKey, final long rightSibKey, final long hash, @Nonnull final QNm name, @Nonnull final Kind kind, @Nonnegative final int level) throws SirixIOException {
    final int uriKey = NamePageHash.generateHashForString(name.getNamespaceURI());
    final int prefixKey = name.getPrefix() != null && !name.getPrefix().isEmpty() ? NamePageHash.generateHashForString(name.getPrefix()) : -1;
    final int localName = name.getLocalName() != null && !name.getLocalName().isEmpty() ? NamePageHash.generateHashForString(name.getLocalName()) : -1;
    final long revision = mPageWriteTrx.getRevisionNumber();
    final NodeDelegate nodeDel = new NodeDelegate(((PathSummaryPage) mPageWriteTrx.getActualRevisionRootPage().getPathSummaryPageReference().getPage()).getMaxNodeKey(0) + 1, parentKey, 0, revision, Optional.<SirixDeweyID>empty());
    final StructNodeDelegate structDel = new StructNodeDelegate(nodeDel, Fixed.NULL_NODE_KEY.getStandardProperty(), rightSibKey, leftSibKey, 0, 0);
    final NameNodeDelegate nameDel = new NameNodeDelegate(nodeDel, uriKey, prefixKey, localName, 0);
    return (PathNode) mPageWriteTrx.createEntry(nodeDel.getNodeKey(), new PathNode(nodeDel, structDel, nameDel, kind, 1, level), PageKind.PATHSUMMARYPAGE, 0, Optional.<UnorderedKeyValuePage>empty());
}
Also used : PathSummaryPage(org.sirix.page.PathSummaryPage) StructNodeDelegate(org.sirix.node.delegates.StructNodeDelegate) UnorderedKeyValuePage(org.sirix.page.UnorderedKeyValuePage) PathNode(org.sirix.index.path.summary.PathNode) NodeDelegate(org.sirix.node.delegates.NodeDelegate) StructNodeDelegate(org.sirix.node.delegates.StructNodeDelegate) NameNodeDelegate(org.sirix.node.delegates.NameNodeDelegate) ValNodeDelegate(org.sirix.node.delegates.ValNodeDelegate) NameNodeDelegate(org.sirix.node.delegates.NameNodeDelegate)

Aggregations

PathNode (org.sirix.index.path.summary.PathNode)1 NameNodeDelegate (org.sirix.node.delegates.NameNodeDelegate)1 NodeDelegate (org.sirix.node.delegates.NodeDelegate)1 StructNodeDelegate (org.sirix.node.delegates.StructNodeDelegate)1 ValNodeDelegate (org.sirix.node.delegates.ValNodeDelegate)1 PathSummaryPage (org.sirix.page.PathSummaryPage)1 UnorderedKeyValuePage (org.sirix.page.UnorderedKeyValuePage)1