@delali/narsil 0.3.0 → 0.3.1-next.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/dist/adapters/filesystem.d.ts +1 -1
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/indexeddb.d.ts +1 -1
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/memory.d.ts +1 -1
- package/dist/{adapters-79OIa4xm.d.ts → adapters-BQFQ4PRz.d.ts} +27 -1
- package/dist/browser/chunk-BDOSMEEP.mjs +493 -0
- package/dist/browser/chunk-EJDUFWSO.mjs +602 -0
- package/dist/browser/chunk-HOZW3PKP.mjs +9 -0
- package/dist/browser/chunk-JOVZ6HMT.mjs +4358 -0
- package/dist/browser/chunk-JPTQZWJQ.mjs +10 -0
- package/dist/browser/chunk-KPJMDPHG.mjs +24558 -0
- package/dist/browser/chunk-PGIM3HIM.mjs +2743 -0
- package/dist/browser/chunk-RHG4O77A.mjs +206 -0
- package/dist/browser/chunk-RIJSLY2I.mjs +360 -0
- package/dist/browser/durability-wiring-SRUYT3VV.mjs +3875 -0
- package/dist/browser/module-CBB2ETYP.mjs +3111 -0
- package/dist/browser/release-76MXRPGV.mjs +33 -0
- package/dist/browser/replace-RURXTGVG.mjs +57 -0
- package/dist/browser/restore-queue-EEZQO6RF.mjs +35 -0
- package/dist/browser/runtime-7ZAHCHWR.mjs +557 -0
- package/dist/browser/snapshot-OAAA5UJ7.mjs +1210 -0
- package/dist/browser/write-7D6VIK6O.mjs +208 -0
- package/dist/{capabilities-DSsOGz6F.d.ts → capabilities-ByQRMOx-.d.ts} +68 -7
- package/dist/chunk-2RIRGOUL.mjs +113 -0
- package/dist/chunk-37CD3OKS.mjs +87 -0
- package/dist/chunk-44W3CBNG.mjs +7 -0
- package/dist/chunk-46D6JQIG.mjs +426 -0
- package/dist/{chunk-VMRR3DQU.mjs → chunk-5JNA5SKS.mjs} +546 -35
- package/dist/chunk-747OHOUA.mjs +11 -0
- package/dist/chunk-75XIEF6H.mjs +126 -0
- package/dist/chunk-7X5JST5L.mjs +114 -0
- package/dist/chunk-BOFBLJFZ.mjs +209 -0
- package/dist/{chunk-USKFU7J5.mjs → chunk-BWJVNZPR.mjs} +8 -1
- package/dist/chunk-C7SLA6CM.mjs +19 -0
- package/dist/{chunk-POWOTUKJ.mjs → chunk-CQUMNIIG.mjs} +3 -6
- package/dist/chunk-CVXLLEQ3.mjs +1011 -0
- package/dist/chunk-DJHHF2L5.mjs +17 -0
- package/dist/chunk-E74YLAIG.mjs +24 -0
- package/dist/{chunk-UXNWQZST.mjs → chunk-EMRMGYRE.mjs} +236 -18
- package/dist/chunk-EWZLIYHV.mjs +57 -0
- package/dist/chunk-GBEEG5AN.mjs +35 -0
- package/dist/chunk-GES7U2PM.mjs +68 -0
- package/dist/chunk-HJSN7UYG.mjs +10 -0
- package/dist/chunk-HLPRHOSO.mjs +17 -0
- package/dist/chunk-HMFNFVP7.mjs +14 -0
- package/dist/chunk-J5QP52HA.mjs +1751 -0
- package/dist/{chunk-YNVIUGF5.mjs → chunk-JZVARCRZ.mjs} +3 -28
- package/dist/chunk-KOKM4PQN.mjs +52 -0
- package/dist/{chunk-B2TFROFX.mjs → chunk-KWTW6VTG.mjs} +465 -250
- package/dist/chunk-KZ3NX2P7.mjs +21 -0
- package/dist/chunk-L5ORED7V.mjs +25 -0
- package/dist/{chunk-THYRHHO2.mjs → chunk-LGAMKHA2.mjs} +2009 -2351
- package/dist/chunk-LKOB5COA.mjs +117 -0
- package/dist/chunk-LPQOEU5M.mjs +96 -0
- package/dist/{chunk-3LHGNRYE.mjs → chunk-LXWDQLTW.mjs} +7 -2
- package/dist/{chunk-L6TNPLAR.mjs → chunk-OEYI3KRB.mjs} +270 -108
- package/dist/chunk-OM362BRO.mjs +948 -0
- package/dist/chunk-OZDFA4WC.mjs +67 -0
- package/dist/chunk-P36MUFEJ.mjs +10 -0
- package/dist/chunk-PC2G76VW.mjs +2540 -0
- package/dist/{chunk-GCM3JFVA.mjs → chunk-PNEYIHA4.mjs} +11 -2
- package/dist/chunk-PNFKUCG3.mjs +1130 -0
- package/dist/chunk-Q6XWVUZX.mjs +44 -0
- package/dist/chunk-R27EMH5M.mjs +617 -0
- package/dist/{chunk-YMZCMH5M.mjs → chunk-R6A773WK.mjs} +19 -24
- package/dist/chunk-RF7PLG43.mjs +106 -0
- package/dist/chunk-RFBLQLLZ.mjs +16 -0
- package/dist/{chunk-Y3L5MDRV.mjs → chunk-RFVUDM5E.mjs} +17 -2
- package/dist/chunk-S7FL6UAH.mjs +521 -0
- package/dist/chunk-S7GNDRPS.mjs +651 -0
- package/dist/chunk-SP3NM3ZG.mjs +3537 -0
- package/dist/chunk-U476IXKQ.mjs +10 -0
- package/dist/chunk-UA3AUGNV.mjs +462 -0
- package/dist/chunk-UTG5YNXV.mjs +507 -0
- package/dist/chunk-VI4R6W25.mjs +8484 -0
- package/dist/chunk-WQBCBKY3.mjs +8 -0
- package/dist/{chunk-24RXHMEL.mjs → chunk-WVCOCKBU.mjs} +3794 -7570
- package/dist/chunk-X5CV2E2B.mjs +1 -0
- package/dist/chunk-XADZPPZI.mjs +614 -0
- package/dist/chunk-YEEQHT4V.mjs +212 -0
- package/dist/chunk-YTJCGKM4.mjs +56 -0
- package/dist/chunk-YYQIODMF.mjs +275 -0
- package/dist/chunk-ZI34TVOA.mjs +144 -0
- package/dist/{chunk-OOSIDHA3.mjs → chunk-ZKWYWW4Y.mjs} +1 -1
- package/dist/chunk-ZM7KU4YW.mjs +35 -0
- package/dist/{client-BQK6Tf6A.d.ts → client-BOStAkc5.d.ts} +160 -37
- package/dist/client.d.ts +11 -10
- package/dist/client.mjs +209 -45
- package/dist/{config-DmXULPa-.d.ts → config-Cjvzbs_j.d.ts} +51 -3
- package/dist/config-H6SGzbPH.d.ts +421 -0
- package/dist/direct-executor-ZD64PPEZ.mjs +24 -0
- package/dist/distribution/coordinator/etcd.d.ts +79 -18
- package/dist/distribution/coordinator/etcd.mjs +553 -109
- package/dist/distribution/coordinator/in-memory.d.ts +4 -3
- package/dist/distribution/coordinator/in-memory.mjs +22 -3
- package/dist/distribution/transport/grpc.d.ts +2 -2
- package/dist/distribution/transport/grpc.mjs +79 -14
- package/dist/distribution/transport/in-memory.d.ts +2 -2
- package/dist/distribution/transport/in-memory.mjs +12 -7
- package/dist/distribution/transport/tcp.d.ts +2 -2
- package/dist/distribution/transport/tcp.mjs +50 -28
- package/dist/distribution.d.ts +144 -23
- package/dist/distribution.mjs +14479 -8173
- package/dist/durability-wiring-FEUBR5BT.mjs +3330 -0
- package/dist/embeddings/openai.d.ts +2 -2
- package/dist/embeddings/openai.mjs +22 -133
- package/dist/{engine-CIOyFozK.d.ts → engine-rC0vjjY-.d.ts} +165 -141
- package/dist/{memory-yFaVn2xZ.d.ts → events-DqOIg5xa.d.ts} +645 -136
- package/dist/{types-DAK7mnUZ.d.ts → index-Bkdt8nDw.d.ts} +182 -45
- package/dist/index.browser.mjs +4 -32180
- package/dist/index.d.ts +91 -20
- package/dist/index.mjs +33 -16
- package/dist/invalidation/broadcast-channel.d.ts +1 -1
- package/dist/invalidation/filesystem.d.ts +1 -1
- package/dist/invalidation/filesystem.mjs +2 -1
- package/dist/invalidation/noop.d.ts +1 -1
- package/dist/module-3S65MVCM.mjs +2151 -0
- package/dist/partial-words-DTIHO8G4.d.ts +19 -0
- package/dist/partial-words.d.ts +22 -0
- package/dist/partial-words.mjs +17 -0
- package/dist/pattern-Cledccbl.d.ts +18 -0
- package/dist/pattern.d.ts +22 -0
- package/dist/pattern.mjs +12 -0
- package/dist/persistence/durability/checkpoint-worker.d.ts +119 -72
- package/dist/persistence/durability/checkpoint-worker.mjs +51 -18
- package/dist/react.d.ts +279 -183
- package/dist/react.mjs +201 -48
- package/dist/release-BH3DKW3T.mjs +33 -0
- package/dist/replace-CEO5KJJ3.mjs +57 -0
- package/dist/rerank-K7C4WZFG.mjs +60 -0
- package/dist/rerankers/http.d.ts +50 -0
- package/dist/rerankers/http.mjs +104 -0
- package/dist/restore-queue-KQHA7ZV2.mjs +35 -0
- package/dist/runtime-6Y4ZYXOG.mjs +177 -0
- package/dist/{schema-d5Afu03A.d.ts → schema-4W_7tk1f.d.ts} +81 -11
- package/dist/server.d.ts +13 -12
- package/dist/server.mjs +611 -80
- package/dist/snapshot-QGZPODM5.mjs +799 -0
- package/dist/synonyms-CpOAHPa-.d.ts +52 -0
- package/dist/synonyms.d.ts +22 -0
- package/dist/synonyms.mjs +12 -0
- package/dist/{tasks-CH2Dod8w.d.ts → tasks-CwPTz-tP.d.ts} +10 -3
- package/dist/thread-N3IUGUS3.mjs +697 -0
- package/dist/{types-BQDlIvfS.d.ts → types-2qoitTXg.d.ts} +1 -1
- package/dist/{types-D5OwhtsQ.d.ts → types-Cz5okLml.d.ts} +2 -2
- package/dist/vector/search-worker.d.ts +46 -4
- package/dist/vector/search-worker.mjs +21 -11
- package/dist/workers/entry.mjs +9 -6
- package/dist/write-U5RI7MAX.mjs +241 -0
- package/package.json +55 -9
- package/dist/chunk-3L4U6EJQ.mjs +0 -49
- package/dist/chunk-IFBKLBGB.mjs +0 -7
- package/dist/chunk-ORBLD3EL.mjs +0 -6
- package/dist/chunk-U7KYW4BA.mjs +0 -135
- package/dist/chunk-ZJ4CSAB2.mjs +0 -13
- package/dist/chunk-ZNZBXMP5.mjs +0 -2117
- package/dist/chunk-ZZT3EAUC.mjs +0 -11168
- package/dist/config-BhldZgaK.d.ts +0 -194
- package/dist/direct-executor-ALAVE7FC.mjs +0 -12
- package/dist/serialization/crc32-worker.d.ts +0 -20
- package/dist/serialization/crc32-worker.mjs +0 -62
- package/dist/simd-DW5AtJ6B.d.ts +0 -41
- package/dist/thread-DYHEQRVY.mjs +0 -402
package/dist/distribution.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-
|
|
2
|
-
export { c as ClusterControllerConfig, d as
|
|
3
|
-
import {
|
|
4
|
-
import { B as BatchResult, L as ListParams, g as ListResult,
|
|
5
|
-
import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
import './
|
|
10
|
-
|
|
1
|
+
import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-H6SGzbPH.js';
|
|
2
|
+
export { c as ClusterControllerConfig, d as ClusterHealth, e as ClusterHealthStatus, f as ClusterMemoryConfig, g as ClusterMetrics, h as ClusterNodeInfo, i as ClusterQueryConfig, j as CommitPointFigure, k as CoordinatorRequestFigure, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, l as ReplicationConfig } from './config-H6SGzbPH.js';
|
|
3
|
+
import { R as RerankAdapter } from './adapters-BQFQ4PRz.js';
|
|
4
|
+
import { B as BatchResult, L as ListParams, g as ListResult, h as SuggestParams, j as SuggestResult, Q as QueryParams, P as PreflightResult, I as IndexInfo, k as IndexStats, l as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './events-DqOIg5xa.js';
|
|
5
|
+
import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-4W_7tk1f.js';
|
|
6
|
+
import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
|
|
7
|
+
import { b as NodeCapacity, N as NodeRole } from './index-Bkdt8nDw.js';
|
|
8
|
+
export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, I as IndexPartitionBytes, e as NodeEvent, f as NodeMemoryReport, a as NodeRegistration, P as PartitionAssignment, g as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-Bkdt8nDw.js';
|
|
9
|
+
import { N as Narsil } from './engine-rC0vjjY-.js';
|
|
10
|
+
export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-Cz5okLml.js';
|
|
11
|
+
import './config-Cjvzbs_j.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* The cluster splits an index into this many partitions when
|
|
@@ -17,9 +18,11 @@ import './adapters-79OIa4xm.js';
|
|
|
17
18
|
*/
|
|
18
19
|
declare const DEFAULT_PARTITION_COUNT = 5;
|
|
19
20
|
/**
|
|
20
|
-
* The cluster keeps this many
|
|
21
|
-
* {@link CreateIndexOptions} names no factor. One
|
|
22
|
-
*
|
|
21
|
+
* The cluster keeps this many replicas of each partition, besides its
|
|
22
|
+
* primary, when {@link CreateIndexOptions} names no factor. One replica
|
|
23
|
+
* gives two copies of every partition, so the cluster keeps each partition
|
|
24
|
+
* through the loss of one node, and 0 leaves a partition with its primary
|
|
25
|
+
* alone.
|
|
23
26
|
*
|
|
24
27
|
* @public
|
|
25
28
|
*/
|
|
@@ -146,6 +149,39 @@ interface ClusterNode {
|
|
|
146
149
|
* @param name - The index to drop.
|
|
147
150
|
*/
|
|
148
151
|
dropIndex(name: string): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Replaces the synonym set of an index across the cluster, so that every
|
|
154
|
+
* search that starts after the promise resolves expands its words with the
|
|
155
|
+
* new set.
|
|
156
|
+
*
|
|
157
|
+
* The node stores the set in the coordinator before it asks each node that
|
|
158
|
+
* holds a partition of the index to apply the set. The promise resolves
|
|
159
|
+
* once every one of those nodes answers. Pass an empty list to remove the
|
|
160
|
+
* set.
|
|
161
|
+
*
|
|
162
|
+
* @param indexName - The index whose set the cluster replaces.
|
|
163
|
+
* @param synonyms - The new set, in the shape that {@link SynonymRule}
|
|
164
|
+
* describes.
|
|
165
|
+
* @throws A `NarsilError` with `CONFIG_INVALID` when a rule breaks that
|
|
166
|
+
* shape, when a word analyses to no token or to more than one, or when the
|
|
167
|
+
* set passes 100,000 rules, 500,000 words, or 4,194,304 bytes of words in
|
|
168
|
+
* UTF-8. It throws `CLUSTER_WRITE_BLOCKED` when the index metadata changes
|
|
169
|
+
* between the node's read and its write on every one of its tries, and
|
|
170
|
+
* `QUERY_NODE_TIMEOUT` when a node holding a partition gives no answer.
|
|
171
|
+
* After a timeout, the coordinator keeps the new set, so a retry of the
|
|
172
|
+
* same call can finish applying it.
|
|
173
|
+
*/
|
|
174
|
+
updateSynonyms(indexName: string, synonyms: SynonymRule[]): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Returns the synonym set that the coordinator holds for an index, with
|
|
177
|
+
* every word as the caller wrote it, or an empty list when the index holds
|
|
178
|
+
* no set.
|
|
179
|
+
*
|
|
180
|
+
* @param indexName - The index whose set the node returns.
|
|
181
|
+
* @throws A `NarsilError` with `INDEX_NOT_FOUND` when the cluster holds no
|
|
182
|
+
* index under that name.
|
|
183
|
+
*/
|
|
184
|
+
getSynonyms(indexName: string): Promise<SynonymRule[]>;
|
|
149
185
|
/**
|
|
150
186
|
* Removes every document from an index across the cluster and keeps the
|
|
151
187
|
* index itself, along with its schema and allocation.
|
|
@@ -202,6 +238,48 @@ interface ClusterNode {
|
|
|
202
238
|
* @returns The match count and the time the count took.
|
|
203
239
|
*/
|
|
204
240
|
preflight(indexName: string, params: QueryParams): Promise<PreflightResult>;
|
|
241
|
+
/**
|
|
242
|
+
* Lists every index that the cluster holds a schema for, with its document count summed over every partition, its
|
|
243
|
+
* partition count, and its language.
|
|
244
|
+
*
|
|
245
|
+
* The state, the reopen count, and the stale analysis flag describe this node's own copy, so an index that this node
|
|
246
|
+
* holds no copy of reports `open` and 0 reopens. An index that a caller drops while the listing runs drops out of it.
|
|
247
|
+
*
|
|
248
|
+
* @returns One entry per index, in the order the coordinator lists the schemas.
|
|
249
|
+
* @throws A `NarsilError` with `QUERY_PARTIAL_FAILURE` where no copy of some partition answers its count.
|
|
250
|
+
*/
|
|
251
|
+
listIndexes(): Promise<IndexInfo[]>;
|
|
252
|
+
/**
|
|
253
|
+
* Rebuilds the terms of an index on every node that holds a copy, and resolves once every one of those nodes has
|
|
254
|
+
* finished.
|
|
255
|
+
*
|
|
256
|
+
* Each node rebuilds its own copies from their documents, so a primary and its replicas reach the same terms without
|
|
257
|
+
* sending entries, and a node skips a copy whose analysis is already current. A node that answers late keeps its
|
|
258
|
+
* rebuild running, and this call waits for it for as long as the node stays registered.
|
|
259
|
+
*
|
|
260
|
+
* @param indexName - The index whose terms are rebuilt.
|
|
261
|
+
* @throws A `NarsilError` with `INDEX_NOT_FOUND` where the cluster holds no such index, and with
|
|
262
|
+
* `QUERY_PARTIAL_FAILURE`, naming each node in `details.nodeIds`, where a node fails, cannot be reached, or leaves
|
|
263
|
+
* the cluster before it answers.
|
|
264
|
+
*/
|
|
265
|
+
rebuildAnalysis(indexName: string): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Moves an index onto a new number of partitions, and resolves once every read and write of the index goes to the new
|
|
268
|
+
* layout.
|
|
269
|
+
*
|
|
270
|
+
* The controller copies every document into a hidden index that has the new partition count while the current
|
|
271
|
+
* layout keeps serving reads and writes. Once the copy has caught up, writes to the index wait for a cutover of a few
|
|
272
|
+
* seconds at most, failing with `PARTITION_REBALANCING_BACKPRESSURE` until it finishes, and the index name moves onto
|
|
273
|
+
* the new layout in a single allocation write.
|
|
274
|
+
*
|
|
275
|
+
* @param indexName - The index whose partition count changes.
|
|
276
|
+
* @param targetPartitionCount - The number of partitions that the index ends up with.
|
|
277
|
+
* @throws A `NarsilError` with `INDEX_NOT_FOUND` where the cluster holds no such index, with `CONFIG_INVALID` for a
|
|
278
|
+
* count outside the allowed range or equal to the current one, with `PARTITION_REBALANCING_BACKPRESSURE` while
|
|
279
|
+
* another change to the same index runs, with `NODE_NOT_CONTROLLER` where no node holds the controller lease, and
|
|
280
|
+
* with `ALLOCATION_FAILED` where the controller aborts the change.
|
|
281
|
+
*/
|
|
282
|
+
rebalance(indexName: string, targetPartitionCount: number): Promise<void>;
|
|
205
283
|
/**
|
|
206
284
|
* Describes one index across the cluster: its document count and memory
|
|
207
285
|
* estimate summed over every partition, its partition count, its language,
|
|
@@ -234,6 +312,16 @@ interface ClusterNode {
|
|
|
234
312
|
* @returns Process heap figures and this node's engine estimate.
|
|
235
313
|
*/
|
|
236
314
|
getMemoryStats(): Promise<MemoryStats>;
|
|
315
|
+
/**
|
|
316
|
+
* Registers a rerank adapter on this node under a name that a query gives
|
|
317
|
+
* in `rerank.adapter`. The node that receives a reranked query scores it
|
|
318
|
+
* with its own adapter, so register the adapter on every node that takes
|
|
319
|
+
* queries from clients. A data node needs none.
|
|
320
|
+
*
|
|
321
|
+
* @param name - The name that a query gives in `rerank.adapter`.
|
|
322
|
+
* @param adapter - The adapter that scores the top hits of a query.
|
|
323
|
+
*/
|
|
324
|
+
registerRerankAdapter(name: string, adapter: RerankAdapter): void;
|
|
237
325
|
/**
|
|
238
326
|
* Starts delivering one kind of engine event from this node's local engine
|
|
239
327
|
* to your listener.
|
|
@@ -301,9 +389,38 @@ interface ClusterNode {
|
|
|
301
389
|
has(indexName: string, docId: string): Promise<boolean>;
|
|
302
390
|
/** This reaches the cluster-facing side of the node. */
|
|
303
391
|
cluster: ClusterNamespace;
|
|
304
|
-
/**
|
|
392
|
+
/**
|
|
393
|
+
* Joins the cluster: the node registers, takes on its allocated partitions, and starts serving.
|
|
394
|
+
*
|
|
395
|
+
* The start fails with `NODE_VERSION_INCOMPATIBLE` where the active controller follows a specification version
|
|
396
|
+
* with another major version, because nodes on different major versions cannot share a cluster. A node that finds
|
|
397
|
+
* no active controller joins, and a later controller on another major version gives it no partition.
|
|
398
|
+
*/
|
|
305
399
|
start(): Promise<void>;
|
|
306
|
-
/**
|
|
400
|
+
/**
|
|
401
|
+
* Leaves the cluster for good: the controller moves every copy that the node holds to other nodes, and the node then
|
|
402
|
+
* deregisters and shuts down.
|
|
403
|
+
*
|
|
404
|
+
* The node publishes its registration with `draining` set, so the controller places nothing new on it, hands each
|
|
405
|
+
* partition that it leads to an in-sync replica elsewhere, and moves each of its replicas by adding the new copy
|
|
406
|
+
* before it drops this one. The call returns once no allocation table names the node and {@link ClusterNode.shutdown}
|
|
407
|
+
* has finished. The drain waits for as long as the cluster has no other node that can take a copy, so pass `signal`
|
|
408
|
+
* to give up. An abort rejects with the signal's reason and publishes the registration without `draining`, which
|
|
409
|
+
* stops the drain and leaves the node in the cluster.
|
|
410
|
+
*
|
|
411
|
+
* @param options - Holds `signal`, which ends the wait and keeps the node in the cluster.
|
|
412
|
+
* @returns A promise that settles once the node has left the cluster and shut down.
|
|
413
|
+
*/
|
|
414
|
+
decommission(options?: {
|
|
415
|
+
signal?: AbortSignal;
|
|
416
|
+
}): Promise<void>;
|
|
417
|
+
/**
|
|
418
|
+
* Leaves the cluster at once: the node deregisters and closes the engine it ran.
|
|
419
|
+
*
|
|
420
|
+
* The controller treats the node as failed, so it promotes a replica for each partition that the node led and waits
|
|
421
|
+
* `nodeLeftDelayMs` before it moves the node's replicas, which lets a node that restarts in place take them back.
|
|
422
|
+
* Call {@link ClusterNode.decommission} to move the copies off the node first.
|
|
423
|
+
*/
|
|
307
424
|
shutdown(): Promise<void>;
|
|
308
425
|
}
|
|
309
426
|
|
|
@@ -315,13 +432,13 @@ interface ClusterNode {
|
|
|
315
432
|
* answering. A node whose roles include `controller` stands for election and
|
|
316
433
|
* runs allocation for the whole cluster while it holds the lease.
|
|
317
434
|
*
|
|
318
|
-
* @param
|
|
435
|
+
* @param callerConfig - The coordinator, the transport, this node's address, and the
|
|
319
436
|
* settings for the engine it runs locally.
|
|
320
437
|
* @returns The node, ready for {@link ClusterNode.start}.
|
|
321
438
|
*
|
|
322
439
|
* @public
|
|
323
440
|
*/
|
|
324
|
-
declare function createClusterNode(
|
|
441
|
+
declare function createClusterNode(callerConfig: ClusterNodeConfig): Promise<ClusterNode>;
|
|
325
442
|
|
|
326
443
|
/**
|
|
327
444
|
* How {@link clusterNodeEngine} shapes the operations it forwards.
|
|
@@ -338,14 +455,18 @@ interface ClusterEngineOptions {
|
|
|
338
455
|
* serves a single engine.
|
|
339
456
|
*
|
|
340
457
|
* Writes, updates, searches, suggestions, listings, counts, index creation,
|
|
341
|
-
* index removal, and document reads route through the cluster.
|
|
342
|
-
* memory statistics, index opens, index closes,
|
|
343
|
-
* node's local engine, because
|
|
458
|
+
* index removal, analysis rebuilds, synonym sets, and document reads route through the cluster.
|
|
459
|
+
* Checkpointing, memory statistics, index opens, index closes, engine events,
|
|
460
|
+
* and rerank adapter registration reach this node's local engine, because
|
|
461
|
+
* each covers a per-node fact. This node reranks the searches that it
|
|
462
|
+
* receives with the adapters registered on it. Every other operation fails with
|
|
344
463
|
* `CLUSTER_OPERATION_UNSUPPORTED`, which the HTTP server answers with status
|
|
345
464
|
* 501, so a caller learns the operation is missing rather than reading a
|
|
346
|
-
* wrong answer.
|
|
347
|
-
*
|
|
348
|
-
*
|
|
465
|
+
* wrong answer. The HTTP server answers the index list, the index figures,
|
|
466
|
+
* and the partition figures from the whole cluster. The adapter's own
|
|
467
|
+
* `getStats`, `getPartitionStats`, and `listIndexes` still fail with
|
|
468
|
+
* `CLUSTER_OPERATION_UNSUPPORTED`, because {@link Narsil} declares them
|
|
469
|
+
* synchronous and a cluster answer needs a round trip, so call them on the
|
|
349
470
|
* {@link ClusterNode} itself, where they are asynchronous.
|
|
350
471
|
*
|
|
351
472
|
* @param node - The cluster node the adapter serves.
|