Package org.zvec.binding
Class Zvec
java.lang.Object
org.zvec.binding.Zvec
Top-level entry point for the Zvec Java binding.
Provides library lifecycle (initialize(org.zvec.binding.ConfigData), shutdown()),
version information, and collection factory methods.
Typical usage:
Zvec.initialize(null);
try (Collection coll = Zvec.createAndOpen("/tmp/mydb", schema, null)) {
// ...
}
Zvec.shutdown();
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckVersion(int major, int minor, int patch) static voidClear the last error status.static CollectioncreateAndOpen(String path, CollectionSchema schema, CollectionOptions options) Create a new collection at the given path and open it.static StringHuman-readable description of the current I/O backend.static IoBackendTypeGet the I/O backend used for DiskAnn disk reads.static StringReturns the human-readable name of the given I/O backend type.static Stringstatic intstatic intstatic intstatic voidinitialize(ConfigData config) Initialize the Zvec library.static booleanReturns true if the library has been initialized.static Collectionopen(String path, CollectionOptions options) Open an existing collection.static voidshutdown()Shutdown the Zvec library and release all global resources.
-
Method Details
-
getVersion
-
getVersionMajor
public static int getVersionMajor() -
getVersionMinor
public static int getVersionMinor() -
getVersionPatch
public static int getVersionPatch() -
checkVersion
public static boolean checkVersion(int major, int minor, int patch) -
getIoBackendType
Get the I/O backend used for DiskAnn disk reads. On Linux zvec selects the first usable backend in this order: io_uring, libaio, pread; macOS uses pread; Windows uses unbuffered overlapped I/O. -
getIoBackendTypeName
Returns the human-readable name of the given I/O backend type. -
getIoBackendDescription
Human-readable description of the current I/O backend. On Linux with the pread fallback it also explains how to enable an async backend. -
initialize
Initialize the Zvec library. Passnullfor default config.The
jiebaFTS tokenizer needs no setup: its default dictionary and HMM model are embedded in the native library (zvec ≥ v0.8.0), so there is nothing to extract or register. An external dictionary can still be selected per field through the analyzer'sextra_params.jieba_dict_dir, or process-wide through theZVEC_JIEBA_DICT_DIRenvironment variable; the per-field value wins over the environment, which wins over the embedded default. -
shutdown
public static void shutdown()Shutdown the Zvec library and release all global resources. -
isInitialized
public static boolean isInitialized()Returns true if the library has been initialized. -
clearError
public static void clearError()Clear the last error status. -
createAndOpen
public static Collection createAndOpen(String path, CollectionSchema schema, CollectionOptions options) Create a new collection at the given path and open it. -
open
Open an existing collection.
-