public ParallelTaskBuilder setReplaceVarMapToSingleTarget ( List < StrStrMap > replacementVarMapList , String uniformTargetHost ) { if ( Strings . isNullOrEmpty ( uniformTargetHost ) ) { logger . error ( "uniform target host is empty or null. skil setting." ) ; return this ; } this . replacementVarMapNodeSpecific . clear ( ) ; this . targetHosts . clear ( ) ; int i = 0 ; for ( StrStrMap ssm : replacementVarMapList ) { if ( ssm == null ) continue ; String hostName = PcConstants . API_PREFIX + i ; ssm . addPair ( PcConstants . UNIFORM_TARGET_HOST_VAR , uniformTargetHost ) ; replacementVarMapNodeSpecific . put ( hostName , ssm ) ; targetHosts . add ( hostName ) ; ++ i ; } this . requestReplacementType = RequestReplacementType . TARGET_HOST_SPECIFIC_VAR_REPLACEMENT ; logger . info ( "Set requestReplacementType as {} for single target. Will disable the set target hosts." + "Also Simulated " + "Now Already set targetHost list with size {}. \nPLEASE NOT TO SET TARGET HOSTS AGAIN WITH THIS API." , requestReplacementType . toString ( ) , targetHosts . size ( ) ) ; return this ; }
Sets the replace var map to single target .