All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sirix.index.path.PathIndexBuilderFactory Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 0.11.0
Show newest version
package io.sirix.index.path;

import static java.util.Objects.requireNonNull;

import io.sirix.access.DatabaseType;
import io.sirix.index.IndexDef;
import io.sirix.index.IndexType;
import io.sirix.api.PageTrx;
import io.sirix.index.path.summary.PathSummaryReader;
import io.sirix.index.redblacktree.RBTreeWriter;
import io.sirix.index.redblacktree.keyvalue.NodeReferences;


public final class PathIndexBuilderFactory {

  private final DatabaseType databaseType;

  public PathIndexBuilderFactory(final DatabaseType databaseType) {
    this.databaseType = databaseType;
  }

  public PathIndexBuilder create(final PageTrx pageTrx,
      final PathSummaryReader pathSummaryReader, final IndexDef indexDef) {
    final var pathSummary = requireNonNull(pathSummaryReader);
    final var paths = requireNonNull(indexDef.getPaths());
    assert indexDef.getType() == IndexType.PATH;
    final var rbTreeWriter = RBTreeWriter.getInstance(
            this.databaseType, pageTrx, indexDef.getType(), indexDef.getID());

    return new PathIndexBuilder(rbTreeWriter, pathSummary, paths);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy