use of com.datastax.oss.simulacron.common.cluster.RequestPrime in project dsbulk by datastax.
the class EndToEndUtils method createParameterizedQuery.
public static RequestPrime createParameterizedQuery(String query, Map<String, Object> params, Result then) {
LinkedHashMap<String, String> paramTypes = new LinkedHashMap<>();
paramTypes.put("country_code", "varchar");
paramTypes.put("country_name", "varchar");
paramTypes.put("beginning_ip_address", "inet");
paramTypes.put("ending_ip_address", "inet");
paramTypes.put("beginning_ip_number", "bigint");
paramTypes.put("ending_ip_number", "bigint");
LinkedHashMap<String, Object> defaultParams = new LinkedHashMap<>();
defaultParams.put("country_code", "*");
defaultParams.put("country_name", "*");
defaultParams.put("beginning_ip_address", "*");
defaultParams.put("ending_ip_address", "*");
defaultParams.put("beginning_ip_number", "*");
defaultParams.put("ending_ip_number", "*");
for (String key : params.keySet()) {
defaultParams.put(key, params.get(key));
}
Query when = new Query(query, Collections.emptyList(), defaultParams, paramTypes);
return new RequestPrime(when, then);
}
Aggregations