@livy/util
Version:
Common utilities for the Livy logger
31 lines (30 loc) • 972 B
TypeScript
import { HandlerInterface } from '@livy/contracts/lib/handler-interface';
import { LogLevel } from '@livy/contracts/lib/log-level';
import { LogRecord } from '@livy/contracts/lib/log-record';
/**
* Base Handler class providing `handleBatch` and `handleBatchSync`
* by sequentially hanlding records
*
* Note that `handleBatchSync` is a no-op as long as no `handleSync`
* is implemented by classes extending this handler.
*/
export declare abstract class AbstractBatchHandler implements HandlerInterface {
/**
* @inheritdoc
*/
handleBatch(records: LogRecord[]): Promise<void>;
/**
* Handles a set of records at once.
*
* @param records The records to handle (an array of record arrays)
*/
handleBatchSync(records: LogRecord[]): void;
/**
* @inheritdoc
*/
abstract isHandling(level: LogLevel): boolean;
/**
* @inheritdoc
*/
abstract handle(record: LogRecord): Promise<boolean | void>;
}