DataReelDataReelC++ Toolkit Documentation

Object Server Vector Searches

The database object server (gxdbobject.h) answers vector searches on a database whose config names its vectors (DataReel 7.4).

Contents

Overview
gxObjectService

Overview

A gxObjectService serves named databases over multiplex channels (gxdbmux.h) on a gxStream server with mutual TLS. In 7.4 a database's config may name its vectors, a .vixset manifest or one .vix file (gxObjectDbConfig::vectors). Two requests read them:

Vector requests never take the database's own lock. On a replicated copy the vectors are searched under the copy's apply lock, so a search never sees a half-applied batch; a search takes its slot (at most vec_max at a time, SetVectorLimits()) before that lock. Every field is length-checked; a bad request is refused with a reason. The example: vector_search_service; the client tool: object_client --vinfo / --vsearch. Linux and Windows (7.4).

gxObjectService

gxObjectService(const std::vector<gxObjectDbConfig> &dbs, const std::string &legacy_db = std::string())

The service for the configured databases (name, path, journal, access read or write, vectors).

void SetVectorLimits(unsigned threads, unsigned max_concurrent)

Threads per vector search and searches at a time (one more waits up to 5 s, then "busy").

int Request(const std::string &name, bool write, uint8_t op, const std::vector<unsigned char> &body, std::vector<unsigned char> &reply, std::string &err)

One request (ADD, CHANGE, DELETE, REQUEST, the vector ops); 0 or -1 with err.

void ServeChannel(gxdMuxSession &mux, uint32_t ch, const std::string &name, const std::string &mode, std::atomic<bool> &stop)

Serves one open channel until it closes or stop is set.

void ProtectRoot(const std::string &root, const std::string &apply_journal)

Databases and vectors under a replicated copy's root are read only and read under its apply lock.