@@ -31,6 +31,13 @@ class RocksDBWrapper;
3131class TransactionManager ;
3232} // namespace themis
3333
34+ // Interface forward declarations (always available without proto stubs)
35+ namespace themis {
36+ class IQueryEngine ;
37+ class IVectorIndex ;
38+ using IQueryEnginePtr = std::shared_ptr<IQueryEngine>;
39+ } // namespace themis
40+
3441namespace themis {
3542namespace api {
3643
@@ -45,7 +52,7 @@ namespace api {
4552 *
4653 * Lifecycle – register with GrpcApiServer before calling start():
4754 * @code
48- * ThemisDBGrpcService svc(db, txn_mgr);
55+ * ThemisDBGrpcService svc(db, txn_mgr, aql_engine, vector_index );
4956 * grpc_api_server.registerService(svc.service()); // nullptr when stubs absent
5057 * grpc_api_server.start();
5158 * @endcode
@@ -56,10 +63,16 @@ namespace api {
5663 * - AQL : ExecuteAQL, StreamAQL (server-side streaming)
5764 * - Vector search : VectorSearch, FilteredVectorSearch, HybridSearch, FullTextSearch
5865 * - Health : HealthCheck
66+ *
67+ * When an AQL engine and/or vector index are provided via the extended
68+ * constructor the corresponding RPC stubs delegate to them rather than
69+ * returning UNIMPLEMENTED. See ThemisDBGrpcServiceFactory for a fluent
70+ * builder that wires all components together.
5971 */
6072class ThemisDBGrpcService {
6173public:
6274 /* *
75+ * @brief Construct with storage only (AQL and vector search return UNIMPLEMENTED).
6376 * @param db Storage backend (must outlive this object).
6477 * @param txn_mgr Transaction manager (must outlive this object).
6578 */
@@ -68,6 +81,24 @@ class ThemisDBGrpcService {
6881 std::shared_ptr<TransactionManager> txn_mgr
6982 );
7083
84+ /* *
85+ * @brief Construct with all components wired in.
86+ *
87+ * AQL engine enables ExecuteAQL, StreamAQL, HybridSearch, and FullTextSearch.
88+ * Vector index enables VectorSearch and FilteredVectorSearch.
89+ *
90+ * @param db Storage backend (must outlive this object).
91+ * @param txn_mgr Transaction manager (must outlive this object).
92+ * @param aql_engine Query engine for AQL RPCs (may be nullptr).
93+ * @param vector_index Vector similarity index (may be nullptr).
94+ */
95+ ThemisDBGrpcService (
96+ std::shared_ptr<RocksDBWrapper> db,
97+ std::shared_ptr<TransactionManager> txn_mgr,
98+ std::shared_ptr<themis::IQueryEngine> aql_engine,
99+ std::shared_ptr<themis::IVectorIndex> vector_index
100+ );
101+
71102 ~ThemisDBGrpcService ();
72103
73104 /* *
@@ -80,11 +111,16 @@ class ThemisDBGrpcService {
80111 void * service ();
81112
82113private:
83- std::shared_ptr<RocksDBWrapper> db_;
84- std::shared_ptr<TransactionManager> txn_mgr_;
114+ std::shared_ptr<RocksDBWrapper> db_;
115+ std::shared_ptr<TransactionManager> txn_mgr_;
116+ std::shared_ptr<themis::IQueryEngine> aql_engine_;
117+ std::shared_ptr<themis::IVectorIndex> vector_index_;
85118
86119 class Impl ;
87120 std::unique_ptr<Impl> impl_;
121+
122+ // / Internal helper used by both constructors.
123+ void buildImpl ();
88124};
89125
90126} // namespace api
0 commit comments