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

io.sirix.index.cas.json.JsonCASIndexImpl 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.cas.json;

import io.sirix.access.DatabaseType;
import io.sirix.api.PageTrx;
import io.sirix.api.json.JsonNodeReadOnlyTrx;
import io.sirix.index.IndexDef;
import io.sirix.index.cas.CASIndexBuilderFactory;
import io.sirix.index.cas.CASIndexListenerFactory;
import io.sirix.index.path.summary.PathSummaryReader;

public final class JsonCASIndexImpl implements JsonCASIndex {

  private final CASIndexBuilderFactory casIndexBuilderFactory;

  private final CASIndexListenerFactory casIndexListenerFactory;

  public JsonCASIndexImpl() {
    casIndexBuilderFactory = new CASIndexBuilderFactory(DatabaseType.JSON);
    casIndexListenerFactory = new CASIndexListenerFactory(DatabaseType.JSON);
  }

  @Override
  public JsonCASIndexBuilder createBuilder(JsonNodeReadOnlyTrx rtx,
      PageTrx pageTrx, PathSummaryReader pathSummaryReader,
      IndexDef indexDef) {
    final var indexBuilderDelegate = casIndexBuilderFactory.create(pageTrx, pathSummaryReader, indexDef);
    return new JsonCASIndexBuilder(indexBuilderDelegate, rtx);
  }

  @Override
  public JsonCASIndexListener createListener(PageTrx pageTrx,
      PathSummaryReader pathSummaryReader, IndexDef indexDef) {
    final var indexListenerDelegate = casIndexListenerFactory.create(pageTrx, pathSummaryReader, indexDef);
    return new JsonCASIndexListener(indexListenerDelegate);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy