io.sirix.index.name.NameIndexBuilderFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sirix-core Show documentation
Show all versions of sirix-core Show documentation
SirixDB is a hybrid on-disk and in-memory document oriented, versioned database system. It has a lightweight buffer manager, stores everything in a huge persistent and durable tree and allows efficient reconstruction of every revision. Furthermore, SirixDB implements change tracking, diffing and supports time travel queries.
package io.sirix.index.name;
import static java.util.Objects.requireNonNull;
import io.sirix.access.DatabaseType;
import io.sirix.api.PageTrx;
import io.sirix.index.IndexDef;
import io.sirix.index.IndexType;
import io.sirix.index.redblacktree.RBTreeWriter;
import io.sirix.index.redblacktree.keyvalue.NodeReferences;
import io.brackit.query.atomic.QNm;
public final class NameIndexBuilderFactory {
private final DatabaseType databaseType;
public NameIndexBuilderFactory(final DatabaseType databaseType) {
this.databaseType = databaseType;
}
public NameIndexBuilder create(final PageTrx pageTrx, final IndexDef indexDefinition) {
final var includes = requireNonNull(indexDefinition.getIncluded());
final var excludes = requireNonNull(indexDefinition.getExcluded());
assert indexDefinition.getType() == IndexType.NAME;
final var rbTreeWriter = RBTreeWriter.getInstance(
this.databaseType,
pageTrx,
indexDefinition.getType(),
indexDefinition.getID()
);
return new NameIndexBuilder(includes, excludes, rbTreeWriter);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy