Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RedisBloomTopK

Hierarchy

  • Module
    • RedisBloomTopK

Index

Constructors

  • new RedisBloomTopK(clusterNodes: ClusterNode[], moduleOptions?: RedisModuleOptions, clusterOptions?: ClusterOptions): RedisBloomTopK
  • new RedisBloomTopK(redisOptions: RedisOptions, moduleOptions?: RedisModuleOptions): RedisBloomTopK
  • Initializing the module object

    Parameters

    • clusterNodes: ClusterNode[]

      The nodes of the cluster

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    • Optional clusterOptions: ClusterOptions

      The options of the clusters

    Returns RedisBloomTopK

  • Initializing the module object

    Parameters

    • redisOptions: RedisOptions

      The options of the redis database

    • Optional moduleOptions: RedisModuleOptions

      The additional module options

    Returns RedisBloomTopK

Properties

bloomTopkCommander: BloomTopkCommander = ...
cluster: Cluster
clusterNodes: ClusterNode[]
clusterOptions: ClusterOptions
isHandleError: boolean
name: string
redis: Redis
redisOptions: RedisOptions
returnRawResponse: boolean
showDebugLogs: boolean

Methods

  • add(key: string, items: (string | number)[]): Promise<string[]>
  • Adding an item to the data structure.

    Parameters

    • key: string

      Name of sketch where item is added.

    • items: (string | number)[]

      Item/s to be added.

    Returns Promise<string[]>

  • connect(): Promise<void>
  • Connecting to the Redis database with the module

    Returns Promise<void>

  • count(key: string, items: (string | number)[]): Promise<number[]>
  • Returning count for an item.

    Parameters

    • key: string

      Name of sketch where item is counted.

    • items: (string | number)[]

      Item/s to be counted.

    Returns Promise<number[]>

  • disconnect(): Promise<void>
  • Disconnecting from the Redis database with the module

    Returns Promise<void>

  • handleError(error: string): any
  • Handling a error

    Parameters

    • error: string

      The message of the error

    Returns any

  • handleResponse(response: any): any
  • Simpilizing the response of the Module command

    Parameters

    • response: any

      The array response from the module

    Returns any

  • info(key: string): Promise<(string | number)[]>
  • isOnlyTwoDimensionalArray(array: any[]): boolean
  • Check if array is fully two dimensional. Only items in the array are arrays.

    Parameters

    • array: any[]

      The potential two dimensional array

    Returns boolean

  • list(key: string): Promise<(string | number)[]>
  • paramToString(paramValue: string): string
  • Formatting given param value to string

    Parameters

    • paramValue: string

      The given param value

    Returns string

    A param value converted to string

  • query(key: string, items: (string | number)[]): Promise<TOPKResponse[]>
  • reduceArrayDimension(array: any[][]): any[]
  • Reducing an array by one level. i.e. from two dimensional to 1 dimensional.

    Parameters

    • array: any[][]

      The potentional two dimensional array

    Returns any[]

  • reserve(key: string, topk: number, width: number, depth: number, decay: number): Promise<"OK">
  • Initializing a TopK with specified parameters

    Parameters

    • key: string

      The key under which the sketch is to be found.

    • topk: number

      The number of top occurring items to keep.

    • width: number

      The number of counters kept in each array.

    • depth: number

      The number of arrays.

    • decay: number

      The probability of reducing a counter in an occupied bucket. It is raised to power of it's counter (decay ^ bucket[i].counter). Therefore, as the counter gets higher, the chance of a reduction is being reduced.

    Returns Promise<"OK">

  • sendCommand(data: CommandData): Promise<any>
  • Running a Redis command

    Parameters

    • data: CommandData

      The command data of a command to send. Consists of command and args.

    Returns Promise<any>

Generated using TypeDoc