private int getCountForRange ( TableCountProbingContext probingContext , StrSubstitutor sub , Map < String , String > subValues , long startTime , long endTime ) { String startTimeStr = Utils . dateToString ( new Date ( startTime ) , SalesforceExtractor . SALESFORCE_TIMESTAMP_FORMAT ) ; String endTimeStr = Utils . dateToString ( new Date ( endTime ) , SalesforceExtractor . SALESFORCE_TIMESTAMP_FORMAT ) ; subValues . put ( "start" , startTimeStr ) ; subValues . put ( "end" , endTimeStr ) ; String query = sub . replace ( PROBE_PARTITION_QUERY_TEMPLATE ) ; log . debug ( "Count query: " + query ) ; probingContext . probeCount ++ ; JsonArray records = getRecordsForQuery ( probingContext . connector , query ) ; Iterator < JsonElement > elements = records . iterator ( ) ; JsonObject element = elements . next ( ) . getAsJsonObject ( ) ; return element . get ( "cnt" ) . getAsInt ( ) ; }
Get the row count for a time range