private void traverseNode ( String path ) { DataNode node = getNode ( path ) ; String children [ ] = null ; synchronized ( node ) { Set < String > childs = node . getChildren ( ) ; if ( childs != null ) { children = childs . toArray ( new String [ childs . size ( ) ] ) ; } } if ( children != null ) { if ( children . length == 0 ) { // this node does not have a child // is the leaf node // check if its the leaf node String endString = "/" + Quotas . limitNode ; if ( path . endsWith ( endString ) ) { // ok this is the limit node // get the real node and update // the count and the bytes String realPath = path . substring ( Quotas . quotaZookeeper . length ( ) , path . indexOf ( endString ) ) ; updateQuotaForPath ( realPath ) ; this . pTrie . addPath ( realPath ) ; } return ; } for ( String child : children ) { traverseNode ( path + "/" + child ) ; } } }
this method traverses the quota path and update the path trie and sets