zamza
Version:
Apache Kafka discovery, indexing, searches, storage, hooks and HTTP gateway
124 lines • 4.4 kB
TypeScript
/// <reference types="node" />
import { KeyIndex, TopicMetadata } from "../../interfaces";
import Zamza from "../../Zamza";
import { Metrics } from "../../Metrics";
import Discovery from "../../kafka/Discovery";
import { TopicConfig } from "../../interfaces";
export declare class KeyIndexModel {
readonly metrics: Metrics;
readonly discovery: Discovery;
readonly zamza: Zamza;
readonly name: string;
private readonly models;
private mongoose;
private schemaConstructor;
constructor(zamza: Zamza);
registerModel(mongoosePassed: any, schemaConstructor: any): void;
ensureModelAndIndicesExist(topic: string, topicConfig: TopicConfig): void;
private getOrCreateModel;
private hash;
private static cleanMessageResultForResponse;
private static cleanMessageResultsForResponse;
getSimpleCountOfMessagesStoredForTopic(topic: string, fromMetadata?: boolean): Promise<number>;
getMetadataForTopic(topic: string): Promise<TopicMetadata>;
private partitionsToTotalCount;
getEarliestOffset(topic: string): Promise<any>;
getLatestOffset(topic: string): Promise<any>;
getEarliestTimestamp(topic: string): Promise<any>;
getLatestTimestamp(topic: string): Promise<any>;
getPartitionCountsForTopicViaAggregation(topic: string): Promise<any>;
getPartitionCountsForTopic(topic: string, partitionCount: number): Promise<any>;
findMessageForKey(topic: string, key: string): Promise<{
result: {
$index: string;
topic: string;
partition: number;
offset: number;
key: Buffer;
value: any;
timestamp: number;
};
}>;
findMessageForPartitionAndOffset(topic: string, partition: number, offset: number): Promise<{
result: {
$index: string;
topic: string;
partition: number;
offset: number;
key: Buffer;
value: any;
timestamp: number;
};
}>;
findMessageForTimestamp(topic: string, timestamp: number): Promise<{
result: {
$index: string;
topic: string;
partition: number;
offset: number;
key: Buffer;
value: any;
timestamp: number;
};
}>;
findRangeAroundKey(topic: string, key: string, range?: number): Promise<{
results: never[];
}>;
paginateThroughTopic(topic: string, skipToIndex: string | null, limit?: number, order?: number): Promise<{
results: {
$index: string;
topic: string;
partition: number;
offset: number;
key: Buffer;
value: any;
timestamp: number;
}[];
}>;
getResultsForQueryWithCacheKey(cacheKey: number): Promise<any[] | null>;
filterForQuery(topic: string, origQuery: any, limit?: number | null, skipToIndex?: string | null, order?: number, dontAwait?: boolean): Promise<{
cacheKey: any;
results?: undefined;
} | {
results: {
$index: string;
topic: string;
partition: number;
offset: number;
key: Buffer;
value: any;
timestamp: number;
}[];
cacheKey?: undefined;
}>;
getRangeFromLatest(topic: string, range?: number): Promise<{
results: {
$index: string;
topic: string;
partition: number;
offset: number;
key: Buffer;
value: any;
timestamp: number;
}[];
}>;
getRangeFromEarliest(topic: string, range?: number): Promise<{
results: {
$index: string;
topic: string;
partition: number;
offset: number;
key: Buffer;
value: any;
timestamp: number;
}[];
}>;
analyseSingleMessageJSONSchema(topic: string): Promise<any>;
analyseSingleMessageBigQuerySchema(topic: string): Promise<any>;
analyseJSONSchema(topic: string): Promise<any>;
insert(topic: string, document: KeyIndex): Promise<KeyIndex>;
upsert(topic: string, document: KeyIndex): Promise<KeyIndex>;
delete(topic: string, key: string, fromStream?: boolean): any;
deleteForTopic(topic: string): any;
}
//# sourceMappingURL=KeyIndexModel.d.ts.map