本文整理了Java中datawave.webservice.query.Query.findParameter
方法的一些代码示例,展示了Query.findParameter
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.findParameter
方法的具体详情如下:
包路径:datawave.webservice.query.Query
类名称:Query
方法名:findParameter
暂无
代码示例来源:origin: NationalSecurityAgency/datawave
private String getTrimmedOrNull(Query settings, String value) {
QueryImpl.Parameter param = settings.findParameter(value);
if (param == null) {
return null;
}
String val = param.getParameterValue().trim();
if (val.isEmpty()) {
return null;
}
return val;
}
代码示例来源:origin: NationalSecurityAgency/datawave
void configureDocumentAggregation(Query settings) {
Parameter disabledIndexOnlyDocument = settings.findParameter(QueryOptions.DISABLE_DOCUMENTS_WITHOUT_EVENTS);
if (null != disabledIndexOnlyDocument) {
final String disabledIndexOnlyDocumentStr = disabledIndexOnlyDocument.getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(disabledIndexOnlyDocumentStr)) {
Boolean disabledIndexOnlyDocuments = Boolean.parseBoolean(disabledIndexOnlyDocumentStr);
setDisableIndexOnlyDocuments(disabledIndexOnlyDocuments);
}
}
}
代码示例来源:origin: NationalSecurityAgency/datawave
public DocumentTransformerSupport(String tableName, Query settings, MarkingFunctions markingFunctions, ResponseObjectFactory responseObjectFactory,
Boolean reducedResponse) {
super(tableName, settings, markingFunctions, responseObjectFactory);
this.deserializer = DocumentSerialization.getDocumentDeserializer(settings);
this.reducedResponse = reducedResponse;
String logTimingDetailsStr = settings.findParameter(QueryOptions.LOG_TIMING_DETAILS).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(logTimingDetailsStr)) {
logTimingDetails = Boolean.parseBoolean(logTimingDetailsStr);
}
}
代码示例来源:origin: NationalSecurityAgency/datawave
private void configTypeFilter(ShardQueryConfiguration config, Query settings) {
// Get the datatype set if specified
if (null == settings.findParameter(QueryParameters.DATATYPE_FILTER_SET)) {
config.setDatatypeFilter(new HashSet<>());
return;
}
String typeList = settings.findParameter(QueryParameters.DATATYPE_FILTER_SET).getParameterValue();
HashSet<String> typeFilter;
if (null != typeList && !typeList.isEmpty()) {
typeFilter = new HashSet<>();
typeFilter.addAll(Arrays.asList(StringUtils.split(typeList, Constants.PARAM_VALUE_SEP)));
if (!typeFilter.isEmpty()) {
config.setDatatypeFilter(typeFilter);
if (logger.isDebugEnabled()) {
logger.debug("Type Filter: " + typeFilter);
}
}
}
}
代码示例来源:origin: NationalSecurityAgency/datawave
/**
* If a user-supplied ReturnType is specified, use it; otherwise, use the default ReturnType of {@link #DEFAULT_RETURN_TYPE}
*
* @param settings
* @return
*/
public static ReturnType getReturnType(Query settings) {
Parameter returnType = settings.findParameter(Constants.RETURN_TYPE);
if (null != returnType && !org.apache.commons.lang.StringUtils.isBlank(returnType.getParameterValue())) {
return ReturnType.valueOf(returnType.getParameterValue());
}
return DEFAULT_RETURN_TYPE;
}
代码示例来源:origin: NationalSecurityAgency/datawave
@Override
public QueryLogicTransformer getTransformer(Query settings) {
boolean reducedInSettings = false;
String reducedResponseStr = settings.findParameter(QueryOptions.REDUCED_RESPONSE).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(reducedResponseStr)) {
reducedInSettings = Boolean.parseBoolean(reducedResponseStr);
}
boolean reduced = (this.isReducedResponse() || reducedInSettings);
FacetedTransformer transformer = new FacetedTransformer(this, settings, markingFunctions, responseObjectFactory, reduced);
transformer.setEventQueryDataDecoratorTransformer(eventQueryDataDecoratorTransformer);
transformer.setQm(queryModel);
return transformer;
}
代码示例来源:origin: NationalSecurityAgency/datawave
@Override
public List<String> extractSelectors(Query query) throws IllegalArgumentException {
List<String> selectorList = new ArrayList<>();
String selectorSeparator = this.separatorCharacter;
if (this.separatorParameter != null) {
QueryImpl.Parameter parameter = query.findParameter(separatorParameter);
if (parameter != null && parameter.getParameterValue() != null) {
String value = parameter.getParameterValue();
if (StringUtils.isNotBlank(value) && value.length() == 1) {
selectorSeparator = value;
}
}
}
String queryStr = query.getQuery();
if (selectorSeparator == null) {
selectorList.add(query.getQuery());
} else {
String[] querySplit = queryStr.split(selectorSeparator);
for (int splitNumber = 0; splitNumber < querySplit.length; splitNumber++) {
if (useSplitsList == null || useSplit(useSplitsList, splitNumber)) {
String s = querySplit[splitNumber];
selectorList.add(s.trim());
}
}
}
return selectorList;
}
代码示例来源:origin: NationalSecurityAgency/datawave
final String facetedFields = settings.findParameter(FacetedConfiguration.FACETED_FIELDS).getParameterValue().trim();
final String limitFieldsString = settings.findParameter(QueryParameters.LIMIT_FIELDS).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(limitFieldsString)) {
Boolean limitFields = Boolean.parseBoolean(limitFieldsString);
final String streamingEnabledStr = settings.findParameter(FacetedConfiguration.STREAMING_ENABLED).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(streamingEnabledStr)) {
Boolean streamingEnabled = Boolean.parseBoolean(streamingEnabledStr);
final String facetedType = settings.findParameter(FacetedConfiguration.FACETED_SEARCH_TYPE).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(facetedType)) {
facetedConfig.setType(FacetedSearchType.valueOf(facetedType));
final String maximumGroupCount = settings.findParameter(FacetedConfiguration.MAXIMUM_GROUP_COUNT).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(maximumGroupCount)) {
facetedConfig.setMaximumFacetGroupCount(Integer.valueOf(maximumGroupCount));
final String minimumCount = settings.findParameter(FacetedConfiguration.MINIMUM_COUNT).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(minimumCount)) {
facetedConfig.setMinimumCount(Integer.valueOf(minimumCount));
代码示例来源:origin: NationalSecurityAgency/datawave
if (settings.getParameters() != null) {
QueryImpl.Parameter p = settings.findParameter(SUMMARIZE);
if (p != null && !p.getParameterValue().isEmpty()) {
this.aggregateResults = Boolean.parseBoolean(p.getParameterValue());
p = settings.findParameter(querySyntax);
if (p != null && !p.getParameterValue().isEmpty()) {
String paramVal = p.getParameterValue();
p = settings.findParameter(IGNORE_STATS_PARAM);
if (p != null && !p.getParameterValue().isEmpty()) {
if (Boolean.parseBoolean(p.getParameterValue())) {
p = settings.findParameter(IGNORE_RELATIONSHIPS_PARAM);
if (p != null && !p.getParameterValue().isEmpty()) {
if (Boolean.parseBoolean(p.getParameterValue())) {
p = settings.findParameter(QUERY_DELIMITER_PARAM);
if (p != null && !p.getParameterValue().isEmpty()) {
if (p.getParameterValue().length() != 1) {
p = settings.findParameter(EDGE_TYPES_PARAM);
if (p != null && !p.getParameterValue().isEmpty()) {
edgeTypes = p.getParameterValue();
代码示例来源:origin: NationalSecurityAgency/datawave
QueryImpl.Parameter p = settings.findParameter(INCLUDE_STATS);
if (p != null && !p.getParameterValue().isEmpty()) {
this.includeStats = Boolean.parseBoolean(p.getParameterValue());
p = settings.findParameter(DATE_RANGE_TYPE);
if (p != null && !p.getParameterValue().isEmpty()) {
String paramVal = p.getParameterValue();
p = settings.findParameter(SUMMARIZE);
if (p != null && !p.getParameterValue().isEmpty()) {
this.aggregateResults = Boolean.parseBoolean(p.getParameterValue());
代码示例来源:origin: NationalSecurityAgency/datawave
String maxResultsOverrideStr = settings.findParameter(QueryParameters.MAX_RESULTS_OVERRIDE).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(maxResultsOverrideStr)) {
try {
代码示例来源:origin: NationalSecurityAgency/datawave
String querySyntax = settings.findParameter(QueryParameters.QUERY_SYNTAX).getParameterValue();
代码示例来源:origin: NationalSecurityAgency/datawave
String modelTableName = this.getModelTableName();
if (null != settings.findParameter(QueryParameters.PARAMETER_MODEL_NAME)
&& !settings.findParameter(QueryParameters.PARAMETER_MODEL_NAME).getParameterValue().trim().isEmpty()) {
modelName = settings.findParameter(QueryParameters.PARAMETER_MODEL_NAME).getParameterValue().trim();
if (null != settings.findParameter(QueryParameters.PARAMETER_MODEL_TABLE_NAME)
&& !settings.findParameter(QueryParameters.PARAMETER_MODEL_TABLE_NAME).getParameterValue().trim().isEmpty()) {
modelTableName = settings.findParameter(QueryParameters.PARAMETER_MODEL_TABLE_NAME).getParameterValue().trim();
if (null != settings.findParameter(Constants.UNIQ_DATATYPE)) {
this.uniqueByDataType = Boolean.parseBoolean(settings.findParameter(Constants.UNIQ_DATATYPE).getParameterValue());
if (logger.isTraceEnabled()) {
logger.trace("uniqueByDataType: " + uniqueByDataType);
if (null != settings.findParameter(Constants.UNIQ_VISIBILITY)) {
this.uniqueByVisibility = Boolean.parseBoolean(settings.findParameter(Constants.UNIQ_VISIBILITY).getParameterValue());
if (logger.isTraceEnabled()) {
logger.trace("uniqueByVisibility: " + uniqueByVisibility);
代码示例来源:origin: NationalSecurityAgency/datawave
String typeList = query.findParameter(QueryParameters.DATATYPE_FILTER_SET).getParameterValue();
HashSet<String> typeFilter = null;
代码示例来源:origin: NationalSecurityAgency/datawave
@Override
public GenericQueryConfiguration initialize(final Connector connection, final Query settings, final Set<Authorizations> auths) throws Exception {
// Initialize the config and scanner factory
final ContentQueryConfiguration config = new ContentQueryConfiguration(this, settings);
this.scannerFactory = new ScannerFactory(connection);
config.setConnector(connection);
config.setAuthorizations(auths);
// Re-assign the view name if specified via params
Parameter p = settings.findParameter(QueryParameters.CONTENT_VIEW_NAME);
if (null != p && !StringUtils.isEmpty(p.getParameterValue())) {
this.viewName = p.getParameterValue();
}
// Decide whether or not to include the content of child events
String end;
p = settings.findParameter(QueryParameters.CONTENT_VIEW_ALL);
if ((null != p) && (null != p.getParameterValue()) && StringUtils.isNotBlank(p.getParameterValue())) {
end = ALL;
} else {
end = PARENT_ONLY;
}
// Configure ranges
final Collection<Range> ranges = this.createRanges(settings, end);
config.setRanges(ranges);
return config;
}
代码示例来源:origin: NationalSecurityAgency/datawave
String maxResultsOverrideStr = settings.findParameter(QueryParameters.MAX_RESULTS_OVERRIDE).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(maxResultsOverrideStr)) {
try {
代码示例来源:origin: NationalSecurityAgency/datawave
String defaultDateType = config.getDefaultDateTypeName();
String dateType = defaultDateType;
Parameter dateTypeParameter = settings.findParameter(QueryParameters.DATE_RANGE_TYPE);
if (dateTypeParameter != null && dateTypeParameter.getParameterValue() != null) {
String parm = dateTypeParameter.getParameterValue().trim();
代码示例来源:origin: NationalSecurityAgency/datawave
String maxResultsOverrideStr = settings.findParameter(MAX_RESULTS_OVERRIDE).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(maxResultsOverrideStr)) {
try {
代码示例来源:origin: NationalSecurityAgency/datawave
private void basicExpects(Document d, Key key, Map.Entry<Key,Value> entry) throws MarkingFunctions.Exception {
// AbstractMap.SimpleEntry<Key, Document> documentEntry = new AbstractMap.SimpleEntry<>(key, mockDocument);
d.put("field1", new Numeric("5", key, true));
AbstractMap.SimpleEntry<Key,Document> documentEntry = new AbstractMap.SimpleEntry<>(key, d);
// Map<String,Attribute<?extends Comparable<?>>> dictionary = new HashMap<>();
// dictionary.put("field1", mockNumeric);
SimpleField simpleField = new SimpleField();
SimpleEvent simpleEvent = new SimpleEvent();
PowerMock.mockStatic(DocumentSerialization.class);
EasyMock.expect(DocumentSerialization.getDocumentDeserializer(mockQuery)).andReturn(mockDeserializer);
EasyMock.expect(mockLogic.getTableName()).andReturn("table1");
EasyMock.expect(mockQuery.getQueryAuthorizations()).andReturn("A,B,C");
EasyMock.expect(mockQuery.findParameter("log.timing.details")).andReturn(new QueryImpl.Parameter("", ""));
EasyMock.expect(mockDeserializer.apply(entry)).andReturn(documentEntry);
// EasyMock.expect(mockDocument.getDictionary()).andReturn(Collections.EMPTY_MAP);
// mockDocument.debugDocumentSize(key);
EasyMock.expect(mockMarkingFunctions.translateFromColumnVisibility(key.getColumnVisibilityParsed())).andReturn(Collections.EMPTY_MAP);
// EasyMock.expect(mockDocument.getDictionary()).andReturn(dictionary);
// EasyMock.expect(mockNumeric.getData()).andReturn("5");
EasyMock.expect(mockResponseFactory.getField()).andReturn(simpleField);
EasyMock.expect(mockResponseFactory.getEvent()).andReturn(simpleEvent);
// EasyMock.expect(mockDocument.sizeInBytes()).andReturn(1l);
}
代码示例来源:origin: NationalSecurityAgency/datawave
String reducedResponseStr = settings.findParameter(QueryOptions.REDUCED_RESPONSE).getParameterValue().trim();
if (org.apache.commons.lang.StringUtils.isNotBlank(reducedResponseStr)) {
reducedInSettings = Boolean.parseBoolean(reducedResponseStr);
内容来源于网络,如有侵权,请联系作者删除!