Options
All
  • Public
  • Public/Protected
  • All
Menu

External module node-zk-treecache

TODO Desc module (in ConnectionState)

Index

Type aliases

ConnectionStateListener

ConnectionStateListener: function

Type declaration

    • (client: CuratorFramework, state: ConnectionState.CONNECTED | ConnectionState.SUSPENDED | ConnectionState.RECONNECTED | ConnectionState.LOST | ConnectionState.READ_ONLY): void
    • Parameters

      • client: CuratorFramework
      • state: ConnectionState.CONNECTED | ConnectionState.SUSPENDED | ConnectionState.RECONNECTED | ConnectionState.LOST | ConnectionState.READ_ONLY

      Returns void

CuratorEvent

TreeCacheListener

TreeCacheListener: function

Type declaration

UnhandledErrorListener

UnhandledErrorListener: function

Type declaration

    • (message: string, error: Error): void
    • Parameters

      • message: string
      • error: Error

      Returns void

Variables

ANYONE_ID_UNSAFE

ANYONE_ID_UNSAFE: Id = new Id("world", "anyone")

OPEN_ACL_UNSAFE

OPEN_ACL_UNSAFE: ACL[] = [new ACL(31, ANYONE_ID_UNSAFE)]

PATH_SEPARATOR

PATH_SEPARATOR: "/" = "/"

Functions

EMPTY_CALLBACK

  • EMPTY_CALLBACK(): void

Private checkNotNull

  • checkNotNull<T>(ref: T, message: string): T
  • Type parameters

    • T

    Parameters

    • ref: T
    • message: string

    Returns T

compareChildData

consoleLogger

  • consoleLogger(id: number, console: ConsoleLike): object
  • Parameters

    Returns object

    • id: number
    • debug: function
      • debug(msg: string, ...args: any[]): void
    • error: function
      • error(msg: string, ...args: any[]): void
    • info: function
      • info(msg: string, ...args: any[]): void
    • warn: function
      • warn(msg: string, ...args: any[]): void

createExistsCuratorEvent

  • createExistsCuratorEvent(path: string, stat: Stat | null, returnCode: ZooKeeperCode.OK | ZooKeeperCode.SYSTEMERROR | ZooKeeperCode.RUNTIMEINCONSISTENCY | ZooKeeperCode.DATAINCONSISTENCY | ZooKeeperCode.CONNECTIONLOSS | ZooKeeperCode.MARSHALLINGERROR | ZooKeeperCode.UNIMPLEMENTED | ZooKeeperCode.OPERATIONTIMEOUT | ZooKeeperCode.BADARGUMENTS | ZooKeeperCode.NEWCONFIGNOQUORUM | ZooKeeperCode.RECONFIGINPROGRESS | ZooKeeperCode.UNKNOWNSESSION | ZooKeeperCode.APIERROR | ZooKeeperCode.NONODE | ZooKeeperCode.NOAUTH | ZooKeeperCode.BADVERSION | ZooKeeperCode.NOCHILDRENFOREPHEMERALS | ZooKeeperCode.NODEEXISTS | ZooKeeperCode.NOTEMPTY | ZooKeeperCode.SESSIONEXPIRED | ZooKeeperCode.INVALIDCALLBACK | ZooKeeperCode.INVALIDACL | ZooKeeperCode.AUTHFAILED | ZooKeeperCode.SESSIONMOVED | ZooKeeperCode.NOTREADONLY | ZooKeeperCode.EPHEMERALONLOCALSESSION | ZooKeeperCode.NOWATCHER | ZooKeeperCode.RECONFIGDISABLED): ExistsCuratorEvent
  • Parameters

    • path: string
    • stat: Stat | null
    • returnCode: ZooKeeperCode.OK | ZooKeeperCode.SYSTEMERROR | ZooKeeperCode.RUNTIMEINCONSISTENCY | ZooKeeperCode.DATAINCONSISTENCY | ZooKeeperCode.CONNECTIONLOSS | ZooKeeperCode.MARSHALLINGERROR | ZooKeeperCode.UNIMPLEMENTED | ZooKeeperCode.OPERATIONTIMEOUT | ZooKeeperCode.BADARGUMENTS | ZooKeeperCode.NEWCONFIGNOQUORUM | ZooKeeperCode.RECONFIGINPROGRESS | ZooKeeperCode.UNKNOWNSESSION | ZooKeeperCode.APIERROR | ZooKeeperCode.NONODE | ZooKeeperCode.NOAUTH | ZooKeeperCode.BADVERSION | ZooKeeperCode.NOCHILDRENFOREPHEMERALS | ZooKeeperCode.NODEEXISTS | ZooKeeperCode.NOTEMPTY | ZooKeeperCode.SESSIONEXPIRED | ZooKeeperCode.INVALIDCALLBACK | ZooKeeperCode.INVALIDACL | ZooKeeperCode.AUTHFAILED | ZooKeeperCode.SESSIONMOVED | ZooKeeperCode.NOTREADONLY | ZooKeeperCode.EPHEMERALONLOCALSESSION | ZooKeeperCode.NOWATCHER | ZooKeeperCode.RECONFIGDISABLED

    Returns ExistsCuratorEvent

Private createGetChildrenCuratorEvent

  • createGetChildrenCuratorEvent(path: string, stat: Stat | undefined, children: string[] | undefined, returnCode: ZooKeeperCode.OK | ZooKeeperCode.SYSTEMERROR | ZooKeeperCode.RUNTIMEINCONSISTENCY | ZooKeeperCode.DATAINCONSISTENCY | ZooKeeperCode.CONNECTIONLOSS | ZooKeeperCode.MARSHALLINGERROR | ZooKeeperCode.UNIMPLEMENTED | ZooKeeperCode.OPERATIONTIMEOUT | ZooKeeperCode.BADARGUMENTS | ZooKeeperCode.NEWCONFIGNOQUORUM | ZooKeeperCode.RECONFIGINPROGRESS | ZooKeeperCode.UNKNOWNSESSION | ZooKeeperCode.APIERROR | ZooKeeperCode.NONODE | ZooKeeperCode.NOAUTH | ZooKeeperCode.BADVERSION | ZooKeeperCode.NOCHILDRENFOREPHEMERALS | ZooKeeperCode.NODEEXISTS | ZooKeeperCode.NOTEMPTY | ZooKeeperCode.SESSIONEXPIRED | ZooKeeperCode.INVALIDCALLBACK | ZooKeeperCode.INVALIDACL | ZooKeeperCode.AUTHFAILED | ZooKeeperCode.SESSIONMOVED | ZooKeeperCode.NOTREADONLY | ZooKeeperCode.EPHEMERALONLOCALSESSION | ZooKeeperCode.NOWATCHER | ZooKeeperCode.RECONFIGDISABLED): GetChildrenCuratorEvent
  • Parameters

    • path: string
    • stat: Stat | undefined
    • children: string[] | undefined
    • returnCode: ZooKeeperCode.OK | ZooKeeperCode.SYSTEMERROR | ZooKeeperCode.RUNTIMEINCONSISTENCY | ZooKeeperCode.DATAINCONSISTENCY | ZooKeeperCode.CONNECTIONLOSS | ZooKeeperCode.MARSHALLINGERROR | ZooKeeperCode.UNIMPLEMENTED | ZooKeeperCode.OPERATIONTIMEOUT | ZooKeeperCode.BADARGUMENTS | ZooKeeperCode.NEWCONFIGNOQUORUM | ZooKeeperCode.RECONFIGINPROGRESS | ZooKeeperCode.UNKNOWNSESSION | ZooKeeperCode.APIERROR | ZooKeeperCode.NONODE | ZooKeeperCode.NOAUTH | ZooKeeperCode.BADVERSION | ZooKeeperCode.NOCHILDRENFOREPHEMERALS | ZooKeeperCode.NODEEXISTS | ZooKeeperCode.NOTEMPTY | ZooKeeperCode.SESSIONEXPIRED | ZooKeeperCode.INVALIDCALLBACK | ZooKeeperCode.INVALIDACL | ZooKeeperCode.AUTHFAILED | ZooKeeperCode.SESSIONMOVED | ZooKeeperCode.NOTREADONLY | ZooKeeperCode.EPHEMERALONLOCALSESSION | ZooKeeperCode.NOWATCHER | ZooKeeperCode.RECONFIGDISABLED

    Returns GetChildrenCuratorEvent

Private createGetDataCuratorEvent

  • createGetDataCuratorEvent(path: string, stat: Stat | undefined, data: Buffer | undefined, returnCode: ZooKeeperCode.OK | ZooKeeperCode.SYSTEMERROR | ZooKeeperCode.RUNTIMEINCONSISTENCY | ZooKeeperCode.DATAINCONSISTENCY | ZooKeeperCode.CONNECTIONLOSS | ZooKeeperCode.MARSHALLINGERROR | ZooKeeperCode.UNIMPLEMENTED | ZooKeeperCode.OPERATIONTIMEOUT | ZooKeeperCode.BADARGUMENTS | ZooKeeperCode.NEWCONFIGNOQUORUM | ZooKeeperCode.RECONFIGINPROGRESS | ZooKeeperCode.UNKNOWNSESSION | ZooKeeperCode.APIERROR | ZooKeeperCode.NONODE | ZooKeeperCode.NOAUTH | ZooKeeperCode.BADVERSION | ZooKeeperCode.NOCHILDRENFOREPHEMERALS | ZooKeeperCode.NODEEXISTS | ZooKeeperCode.NOTEMPTY | ZooKeeperCode.SESSIONEXPIRED | ZooKeeperCode.INVALIDCALLBACK | ZooKeeperCode.INVALIDACL | ZooKeeperCode.AUTHFAILED | ZooKeeperCode.SESSIONMOVED | ZooKeeperCode.NOTREADONLY | ZooKeeperCode.EPHEMERALONLOCALSESSION | ZooKeeperCode.NOWATCHER | ZooKeeperCode.RECONFIGDISABLED): GetDataCuratorEvent
  • Parameters

    • path: string
    • stat: Stat | undefined
    • data: Buffer | undefined
    • returnCode: ZooKeeperCode.OK | ZooKeeperCode.SYSTEMERROR | ZooKeeperCode.RUNTIMEINCONSISTENCY | ZooKeeperCode.DATAINCONSISTENCY | ZooKeeperCode.CONNECTIONLOSS | ZooKeeperCode.MARSHALLINGERROR | ZooKeeperCode.UNIMPLEMENTED | ZooKeeperCode.OPERATIONTIMEOUT | ZooKeeperCode.BADARGUMENTS | ZooKeeperCode.NEWCONFIGNOQUORUM | ZooKeeperCode.RECONFIGINPROGRESS | ZooKeeperCode.UNKNOWNSESSION | ZooKeeperCode.APIERROR | ZooKeeperCode.NONODE | ZooKeeperCode.NOAUTH | ZooKeeperCode.BADVERSION | ZooKeeperCode.NOCHILDRENFOREPHEMERALS | ZooKeeperCode.NODEEXISTS | ZooKeeperCode.NOTEMPTY | ZooKeeperCode.SESSIONEXPIRED | ZooKeeperCode.INVALIDCALLBACK | ZooKeeperCode.INVALIDACL | ZooKeeperCode.AUTHFAILED | ZooKeeperCode.SESSIONMOVED | ZooKeeperCode.NOTREADONLY | ZooKeeperCode.EPHEMERALONLOCALSESSION | ZooKeeperCode.NOWATCHER | ZooKeeperCode.RECONFIGDISABLED

    Returns GetDataCuratorEvent

createWatcher

getCreateMode

  • getCreateMode(asContainers: boolean): number
  • Parameters

    • asContainers: boolean

    Returns number

Private getNodeFromPath

  • getNodeFromPath(path: string): string
  • Given a full path, return the node name. i.e. "/one/two/three" will return "three"

    Parameters

    • path: string

      the path

    Returns string

    the node

Private isConnected

  • isConnected(cs: ConnectionState.CONNECTED | ConnectionState.SUSPENDED | ConnectionState.RECONNECTED | ConnectionState.LOST | ConnectionState.READ_ONLY): boolean
  • Check if this state indicates that Curator has a connection to ZooKeeper

    Parameters

    • cs: ConnectionState.CONNECTED | ConnectionState.SUSPENDED | ConnectionState.RECONNECTED | ConnectionState.LOST | ConnectionState.READ_ONLY

    Returns boolean

    True if connected, false otherwise

makePath

  • makePath(parent: string, child: string): string
  • Given a parent path and a child node, create a combined full path

    Parameters

    • parent: string

      the parent

    • child: string

      the child

    Returns string

    full path

Private mkdirs

  • mkdirs(zkClient: Client, path: string, makeLastNode: boolean, aclProvider: ACLProvider | null, asContainers: boolean, cb?: undefined | function): void
  • Make sure all the nodes in the path are created. NOTE: Unlike File.mkdirs(), Zookeeper doesn't distinguish between directories and files. So, every node in the path is created. The data for each node is an empty blob

    Parameters

    • zkClient: Client

      the client

    • path: string

      path to ensure

    • makeLastNode: boolean

      if true, all nodes are created. If false, only the parent nodes are created

    • aclProvider: ACLProvider | null

      if not null, the ACL provider to use when creating parent nodes

    • asContainers: boolean

      if true, nodes are created as {@link CreateMode#CONTAINER} (need ZK > 3.5)

    • Optional cb: undefined | function

      the callback to call after having created the path

    Returns void

newCuratorFramework

newExistsBuilder

Private newGetChildrenBuilder

newGetDataBuilder

normalizeZooKeeperEvent

Private split

  • split(path: string): string[]
  • Parameters

    • path: string

      the path to split

    Returns string[]

treeCacheBuilder

validatePath

  • validatePath(path: string): string
  • Validate the provided znode path string

    throws

    Error if the path is invalid

    Parameters

    • path: string

      znode path string

    Returns string

    The given path if it was valid, for fluent chaining

Object literals

DEFAULT_ACL_PROVIDER

DEFAULT_ACL_PROVIDER: object

getAclForPath

  • getAclForPath(): null

getDefaultAcl

  • getDefaultAcl(): null

Generated using TypeDoc