Merge commit 'd803bfe2b1fe7f5e219e50ac20d6801a0a58ac75' as 'vendor/ruvector'
This commit is contained in:
55
vendor/ruvector/npm/packages/replication/src/replica-set.d.ts
vendored
Normal file
55
vendor/ruvector/npm/packages/replication/src/replica-set.d.ts
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Replica Set Management
|
||||
* Manages a set of replicas for distributed data storage
|
||||
*/
|
||||
import EventEmitter from 'eventemitter3';
|
||||
import { type Replica, type ReplicaId, type ReplicaSetConfig, ReplicaRole, ReplicaStatus } from './types.js';
|
||||
/** Manages a set of replicas */
|
||||
export declare class ReplicaSet extends EventEmitter {
|
||||
private replicas;
|
||||
private config;
|
||||
private heartbeatTimer;
|
||||
constructor(name: string, config?: Partial<ReplicaSetConfig>);
|
||||
/** Get replica set name */
|
||||
get name(): string;
|
||||
/** Get the primary replica */
|
||||
get primary(): Replica | undefined;
|
||||
/** Get all secondary replicas */
|
||||
get secondaries(): Replica[];
|
||||
/** Get all active replicas */
|
||||
get activeReplicas(): Replica[];
|
||||
/** Get replica count */
|
||||
get size(): number;
|
||||
/** Check if quorum is met */
|
||||
get hasQuorum(): boolean;
|
||||
/** Add a replica to the set */
|
||||
addReplica(id: ReplicaId, address: string, role: ReplicaRole): Replica;
|
||||
/** Remove a replica from the set */
|
||||
removeReplica(id: ReplicaId): boolean;
|
||||
/** Get a replica by ID */
|
||||
getReplica(id: ReplicaId): Replica | undefined;
|
||||
/** Update replica status */
|
||||
updateStatus(id: ReplicaId, status: ReplicaStatus): void;
|
||||
/** Update replica lag */
|
||||
updateLag(id: ReplicaId, lag: number): void;
|
||||
/** Promote a secondary to primary */
|
||||
promote(id: ReplicaId): void;
|
||||
/** Trigger automatic failover */
|
||||
private triggerFailover;
|
||||
/** Start heartbeat monitoring */
|
||||
startHeartbeat(): void;
|
||||
/** Stop heartbeat monitoring */
|
||||
stopHeartbeat(): void;
|
||||
/** Get all replicas */
|
||||
getAllReplicas(): Replica[];
|
||||
/** Get replica set stats */
|
||||
getStats(): {
|
||||
total: number;
|
||||
active: number;
|
||||
syncing: number;
|
||||
offline: number;
|
||||
failed: number;
|
||||
hasQuorum: boolean;
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=replica-set.d.ts.map
|
||||
Reference in New Issue
Block a user