# US 2014/0207940 A1 · Method and system for using a recursive event listener on a node in hierarchical data structure

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2014/0207940 A1
- Document ID: US20140207940A1
- Status: Published application
- Kind: A1
- Application number: 13/748,173
- Filed: 2013-01-23
- Published: 2014-07-24
- Earliest claimed: 2013-01-23
- Assignees: Facebook, Inc.
- Applicants: Facebook, Inc.
- Inventors: Phillip LIU; Vishal KATHURIA
- Web page: https://patentgrep.com/patent/US20140207940A1

## CPC

- H04L 41/0609: {based on severity or priority}
- H04L 67/10: in which an application is distributed across nodes in the network (software deployment G06F8/60; multiprogramming arrangements G06F9/46)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Disclosed is a method and system for registering a recursive watch on a node in hierarchical data structure. Embodiments of the disclosed technique may include (i) receiving a request to register an event listener on a source node, the source node being one of a plurality of nodes that are related to each other in a hierarchy; (ii) registering the event listener on the source node, the event listener configured to notify a client of an occurrence of a first event in the source node; and (iii) if the source node has a descendant node in the hierarchy, setting the event listener to notify the client of an occurrence of a second event in the descendant node without requiring registration of another event listener on the descendant node. Each of the nodes may represent, for example, a logical partition of a storage device.

## Claims

### Claim 1

A method comprising:
receiving, at a computer system in a computer network, a request to register an event listener on a source node, from a client in the computer system, the source node being one of a plurality of nodes that are related to each other in a hierarchy, each of the nodes representing a logical partition of a storage device in the computer system;
registering, by a server in the computer system, the event listener on the source node, wherein the event listener is configured to notify the client of an occurrence of a first event in the source node;
determining, by the server, whether the source node has a descendant node in the hierarchy; and
responsive to a determination that the source node has a descendant node in the hierarchy, setting, by the server, the event listener to notify the client of an occurrence of a second event in the descendant node without requiring registration of another event listener on the descendant node.

### Claim 2 (depends on 1)

The method of claim 1 further comprising:
notifying, the client and on an occurrence of at least one of the first event in the source node or the second event in the descendant node, of the occurrence of at least one of the first event or the second event.

### Claim 3 (depends on 2)

The method of claim 2, wherein registering the event listener on the source node includes
persisting the event listener even after notifying the client of the occurrence of the first event or the second event, and
persisting the event listener until removed by the client.

### Claim 4 (depends on 2)

The method of claim 2, wherein notifying the client of the occurrence of the first event or the second event includes
listening for an occurrence of the first event, wherein listening for the occurrence of the first event includes determining, by the server, whether a field, in a memory of the server corresponding to the source node, is set to a predetermined value indicative of a registration of the event listener on the source node,
listening to an occurrence of the second event without requiring a determination of whether a field, in a memory of the server corresponding to the source node, is set to the predetermined value indicative of a registration of the event listener on the descendant node, and
notifying the client of the occurrence of the first event in the source node or the occurrence of the second event in the descendant node.

### Claim 5 (depends on 1)

The method of claim 1, wherein registering the event listener on the source node includes configuring the event listener to notify the client of an occurrence of a predetermined type of the first event or the second event.

### Claim 6 (depends on 5)

The method of claim 5, wherein the predetermined type of the first event or the second event includes at least one of (i) creation of a new node, (ii) deletion of an existing node, or (iii) modification of the existing node.

### Claim 7 (depends on 1)

The method of claim 1, wherein the first event and the second event are of a same predetermined type of event.

### Claim 8 (depends on 1)

The method of claim 1, wherein the first event and the second event are of different predetermined types of event.

### Claim 9 (depends on 1)

The method of claim 1, wherein the storage device includes a plurality of logical partitions, each of the logical partitions containing a separate non-overlapping subset of data contained in the storage device.

### Claim 10 (depends on 1)

The method of claim 1, wherein setting the event listener to notify the client of the occurrence of the second event in the descendant node includes configuring the event listener to notify the client of an occurrence of an event in descendant nodes along a selected path starting from the source node in the hierarchy.

### Claim 11 (depends on 1)

The method of claim 1, wherein registering the event listener on the source node includes restricting, by configuring access control, registration of the event listener on the source node to a predetermined set of user roles in the computer system.

### Claim 12

A method comprising:
determining, by a computer system in a computer network, if an event has occurred on a source node in a server of the computer system, the source node being one of a plurality of nodes that are related to each other in a hierarchy, each of the nodes representing a logical partition of a storage device in the computer system; and
responsive to a determination that the event has occurred in the source node,
determining, by the server, if an event listener is registered on the source node by a client in the computer system,
responsive to a determination that the event listener is registered on the source node, notifying, the client, of an occurrence of the event in the source node, and
responsive to a determination that the event listener is not registered on the source node,
determining, by the server, if the source node has an ascendant node in the hierarchy,
responsive to a determination that the source node has an ascendant node in the hierarchy,
determining, by the server, if the event listener is registered on the ascendant node, and
responsive to a determination that the event listener is registered on the ascendant node, notifying, the client, of the occurrence of the event in the source node.

### Claim 13 (depends on 12)

The method of claim 12, wherein the event listener registered on the source node is persisted even after the act of notifying the client of the occurrence of the event to the client.

### Claim 14 (depends on 12)

The method of claim 12, wherein the event includes at least one of (i) creation of a new node, (ii) deletion of an existing node, or (iii) modification of the existing node.

### Claim 15 (depends on 12)

The method of claim 12 further comprising:
receiving, in response to a communication failure between the server and the client, a request from the client to register a new event listener on the source node in a new server, the new server having a copy of at least a portion of the nodes in the hierarchy, and the request including a transaction number of a latest event received from the server;
obtaining, by the new server and using the transaction number, a list of events that occurred on the source node and descendants of the source node from the time the latest event was received; and
sending, by the new server to the client, the list of events.

### Claim 16

An apparatus comprising:
a server;
a receiver module configured to cooperate with the server device to receive a request, from a client, to register an event listener on a source node, the source node being one of a plurality of nodes that are connected to each other in a hierarchy, each of the nodes representing a logical partition of a storage unit;
a registration module configured to cooperate with receiver module to register the event listener on the source node, the event listener configured to notify, the client, of an occurrence of a first event in the source node;
a hierarchy determination module configured to cooperate with the registration module for determining whether the source node has a descendant node in the hierarchy; and
a hierarchy event processor module configured to cooperate with the hierarchy determination module to set, responsive to a determination that the source node has a descendant node in the hierarchy, the event listener to notify the client of an occurrence of a second event in the descendant node without requiring a registration of another event listener on the descendant node.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the event listener is further configured to cooperate with the registration module to notify, the client and on an occurrence of at least one of the first event in the source node or the second event in the descendant node, of the occurrence of at least one of the first event or the second event to the client.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the event listener module is further configured to
listen to an occurrence of the first event, wherein listening to the occurrence of the first event includes determining, by the server, whether a bit, in a memory of the server corresponding to the source node, is set to a predetermined value that indicates a registration of the event listener on the source node,
listen to an occurrence of the second event without requiring a determination of whether a bit, in a memory of the server corresponding to the source node, is set to a predetermined value that indicates a registration of the event listener on the descendant node, and
notify the client of the occurrence of the first event in the source node or the occurrence of the second event in the descendant node.

### Claim 19 (depends on 16)

The apparatus of claim 16, wherein the event listener is further configured to notify an occurrence of a predetermined type of an event, the predetermined type of the event including at least one of (i) creation of a new node, (ii) deletion of an existing node, or (iii) modification of the existing node.

### Claim 20 (depends on 16)

The apparatus of claim 16, wherein the storage unit includes a plurality of logical partitions, each of the logical partitions containing a separate non-overlapping subset of data contained in the storage unit.
