use of datawave.webservice.query.QueryImpl.Parameter in project datawave by NationalSecurityAgency.
the class PartitionedQueryLogic method initialize.
@Override
public GenericQueryConfiguration initialize(Connector connection, Query settings, Set<Authorizations> auths) throws Exception {
log.trace("initialize()");
this.connector = connection;
this.auths = auths;
this.settings = settings.duplicate(settings.getQueryName() + "-chunk");
this.settings.setQuery(getJexlQueryString(this.settings));
chunker.setBaseQuery(this.settings);
// this logic only accepts a list of selectors, possibly with ORs between them (simplified LUCENE)
// but if the parent class thinks that the syntax is LUCENE, it will convert it to JEXL which screws up the chuncker
Set<Parameter> params = new HashSet<>();
Set<Parameter> origParams = this.settings.getParameters();
for (Parameter p : origParams) {
if (p.getParameterName().equals(QueryParameters.QUERY_SYNTAX) == false) {
params.add(p);
}
}
// ensure that the parent logic thinks that the syntax is JEXL so that it leaves it alone
params.add(new Parameter(QueryParameters.QUERY_SYNTAX, "JEXL"));
this.settings.setParameters(params);
if (chunker.preInitializeQueryLogic()) {
GenericQueryConfiguration config = super.initialize(this.connector, this.settings, this.auths);
if (!config.getQueries().hasNext()) {
return config;
}
chunker.initialize(config);
}
return initializeNextChunk();
}
use of datawave.webservice.query.QueryImpl.Parameter in project datawave-query-metric-service by NationalSecurityAgency.
the class QueryMetricsDetailListResponse method toParametersString.
private static String toParametersString(final Set<Parameter> parameters) {
final StringBuilder params = new StringBuilder();
final String PARAMETER_SEPARATOR = ";";
final String PARAMETER_NAME_VALUE_SEPARATOR = ":";
if (null != parameters) {
for (final Parameter param : parameters) {
if (params.length() > 0) {
params.append(PARAMETER_SEPARATOR);
}
params.append(param.getParameterName());
params.append(PARAMETER_NAME_VALUE_SEPARATOR);
params.append(param.getParameterValue());
}
}
return params.toString();
}
Aggregations