US 9,811,563 B2
System and method for recursively iterating over a loosely associated data structure
David Gilder, Austin, TX (US)
Assigned to NETSUITE Inc., San Mateo, CA (US)
Filed by NETSUITE INC., San Mateo, CA (US)
Filed on Sep. 16, 2013, as Appl. No. 14/28,046.
Claims priority of provisional application 61/702,145, filed on Sep. 17, 2012.
Prior Publication US 2017/0235795 A1, Aug. 17, 2017
Int. Cl. G06F 17/30 (2006.01)
CPC G06F 17/30513 (2013.01) 15 Claims
OG exemplary drawing
 
1. A method of performing a processing step on each node of a loosely associated data structure, the method comprising:
(a) arbitrarily identifying an initial node from a plurality of nodes of the loosely associated data structure, wherein each one of the plurality of nodes comprises a single association identifier storing information about an originating node of the one of the plurality of nodes, where the originating node has a parent association to the one of the plurality of nodes in the loosely associated data structure;
(b) receiving a single association identifier of the initial node of the loosely associated data structure;
(c) checking a processed flag associated with the initial node in a globally accessible cache memory to determine whether the processing step has already been performed on the initial node;
(d) if the processed flag associated with the initial node is absent in the globally accessible cache memory, then performing sub-steps, comprising:
(i) identifying an originating node of the initial node based on the single association identifier;
(ii) performing a database query and determining one or more associated nodes that refer to the initial node as an originating node;
(iii) adding the associated nodes and the originating node of the initial node to a stored list;
(iv) filtering the stored list to remove one or more duplicates of the associated nodes and one or more duplicates of the originating node, and removing associated node references to each of the remaining nodes that initiated the processing step in the list; and
(v) setting a processed flag to the initial node in the globally accessible cache memory;
(e) if the processed flag associated with the initial node is present in the globally accessible cache memory, then performing sub-steps, comprising:
(i) receiving a single association identifier of at least one of the originating nodes of the initial node in the loosely associated data structure;
(ii) checking a processed flag of the at least one of the originating nodes of the initial node in the globally accessible cache memory to determine whether the processing step has already been performed on the at least one of the originating nodes of the initial node;
(iii) if the processed flag associated with the at least one of the originating nodes is absent, then performing step (d); and
(iv) if the processed flag associated with the at least one of the originating nodes is present, then performing step (e);
(f) performing steps (a) through (e) for at least one node identified in the stored list until all the nodes in the loosely associated data structure are associated with the processed flags and ceasing to repeat steps (a) through (e); and
(g) performing the processing step on the initial node.