protected ArrayList filterXidsByCruuidAndEpoch ( ArrayList xidList , byte [ ] cruuid , int epoch ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "filterXidsByCruuidAndEpoch" , new Object [ ] { xidList , cruuid , epoch } ) ; for ( int x = xidList . size ( ) - 1 ; x >= 0 ; x -- ) { final XidImpl ourXid = ( XidImpl ) xidList . get ( x ) ; final byte [ ] xidCruuid = ourXid . getCruuid ( ) ; final int xidEpoch = ourXid . getEpoch ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Trace other Cruuid: " + xidCruuid + ", or: " + Util . toHexString ( xidCruuid ) ) ; Tr . debug ( tc , "Trace my Cruuid: " + cruuid + ", or: " + Util . toHexString ( cruuid ) ) ; } if ( ( ! java . util . Arrays . equals ( cruuid , xidCruuid ) ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "filterXidsByCruuidAndEpoch: cruuid is different: " + ourXid . getCruuid ( ) ) ; xidList . remove ( x ) ; } else if ( xidEpoch >= epoch ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "filterXidsByCruuidAndEpoch: xid epoch is " + xidEpoch ) ; xidList . remove ( x ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "filterXidsByCruuidAndEpoch" , xidList ) ; return xidList ; }
Removes all Xids from an ArrayList that don t have our cruuid in their bqual . Assumes that all Xids are XidImpls .