public static Map < Integer , Map < Integer , DRSiteDrIdTracker > > dejsonifyClusterTrackers ( final String jsonData , boolean resetLastReceivedLogIds ) throws JSONException { Map < Integer , Map < Integer , DRSiteDrIdTracker > > producerTrackers = new HashMap <> ( ) ; JSONObject clusterData = new JSONObject ( jsonData ) ; final JSONObject trackers = clusterData . getJSONObject ( "trackers" ) ; Iterator < String > clusterIdKeys = trackers . keys ( ) ; while ( clusterIdKeys . hasNext ( ) ) { final String clusterIdStr = clusterIdKeys . next ( ) ; final int clusterId = Integer . parseInt ( clusterIdStr ) ; final JSONObject trackerData = trackers . getJSONObject ( clusterIdStr ) ; Iterator < String > srcPidKeys = trackerData . keys ( ) ; while ( srcPidKeys . hasNext ( ) ) { final String srcPidStr = srcPidKeys . next ( ) ; final int srcPid = Integer . valueOf ( srcPidStr ) ; final JSONObject ids = trackerData . getJSONObject ( srcPidStr ) ; final DRSiteDrIdTracker tracker = new DRSiteDrIdTracker ( ids , resetLastReceivedLogIds ) ; Map < Integer , DRSiteDrIdTracker > clusterTrackers = producerTrackers . computeIfAbsent ( clusterId , k -> new HashMap <> ( ) ) ; clusterTrackers . put ( srcPid , tracker ) ; } } return producerTrackers ; }
Deserialize the trackers retrieved from each consumer partitions .