Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated methods in QueryData and QueryPlan #2448

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,35 +95,6 @@ public QueryData(QueryData other) {
this.finished = other.finished;
}

@Deprecated(since = "6.5.0", forRemoval = true)
public QueryData(String tableName, String query, Collection<Range> ranges, List<IteratorSetting> settings) {
setTableName(tableName);
setQuery(query);
setRanges(ranges);
setSettings(settings);
}

/**
* Weak copy constructor that updates the ranges
*
* @param other
* another QueryData
* @param ranges
* a collection of updated ranges
* @deprecated
*/
@Deprecated(since = "6.5.0", forRemoval = true)
public QueryData(QueryData other, Collection<Range> ranges) {
this(other);
setRanges(ranges);
}

@Deprecated(since = "6.5.0", forRemoval = true)
public QueryData(String tableName, String queryString, List<Range> ranges, List<IteratorSetting> settings, Collection<String> columnFamilies) {
this(tableName, queryString, ranges, settings);
this.columnFamilies.addAll(columnFamilies);
}

// builder style methods

public QueryData withTableName(String tableName) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
package datawave.query.planner;

import static datawave.query.iterator.QueryOptions.QUERY;
import static datawave.query.iterator.QueryOptions.RANGES;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.data.Range;
import org.apache.commons.jexl3.parser.ASTJexlScript;
import org.apache.commons.jexl3.parser.JexlNode;
import org.apache.commons.jexl3.parser.ParseException;
import org.apache.commons.lang.builder.EqualsBuilder;
Expand All @@ -20,10 +14,8 @@

import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;

import datawave.core.common.logging.ThreadConfigurableLogger;
import datawave.core.query.configuration.QueryData;
import datawave.query.jexl.JexlASTHelper;
import datawave.query.jexl.visitors.JexlStringBuildingVisitor;
import datawave.query.util.count.CountMap;
Expand Down Expand Up @@ -118,105 +110,6 @@ public QueryPlan(QueryPlan other) {
this.rebuildHashCode = other.rebuildHashCode;
}

/**
* Partial constructor, missing IteratorSetting
*
* @param tableName
* the table name
* @param queryTreeString
* the query string
* @param queryTree
* the query tree
* @param ranges
* the ranges
* @deprecated
*/
@Deprecated(since = "6.9.0", forRemoval = true)
public QueryPlan(String tableName, String queryTreeString, JexlNode queryTree, Iterable<Range> ranges) {
this(tableName, queryTreeString, queryTree, ranges, null);
}

@Deprecated(since = "6.9.0", forRemoval = true)
public QueryPlan(String tableName, String queryTreeString, JexlNode queryTree, Iterable<Range> ranges, List<IteratorSetting> settings) {
Preconditions.checkNotNull(queryTree);
this.tableName = tableName;
this.queryTree = queryTree;
this.queryTreeString = queryTreeString;
this.ranges = Lists.newArrayList(ranges);
if (null != settings) {
this.settings = settings;
}
resetHashCode();
}

@Deprecated(since = "6.9.0", forRemoval = true)
public QueryPlan(String tableName, JexlNode queryTree, Iterable<Range> ranges, Collection<String> columnFamilies) {
Preconditions.checkNotNull(queryTree);
this.tableName = tableName;
this.queryTree = queryTree;
this.ranges = Lists.newArrayList(ranges);
this.columnFamilies = Lists.newArrayList(columnFamilies);
resetHashCode();
}

@Deprecated(since = "6.9.0", forRemoval = true)
public QueryPlan(String tableName, JexlNode queryTree, Range range) {
Preconditions.checkNotNull(queryTree);
this.tableName = tableName;
this.queryTree = queryTree;
this.ranges = Lists.newArrayList(range);
resetHashCode();
}

@Deprecated(since = "6.9.0", forRemoval = true)
public QueryPlan(QueryData currentQueryData) throws ParseException {
this.tableName = currentQueryData.getTableName();
this.queryTreeString = currentQueryData.getQuery();
this.ranges = Lists.newArrayList(currentQueryData.getRanges());
this.settings.addAll(currentQueryData.getSettings());
this.columnFamilies.addAll(currentQueryData.getColumnFamilies());
resetHashCode();
}

/**
* @param tableName
* @param queryTree
* @param rangeIter
* @param settings
* @param columnFamilies
*/
@Deprecated(since = "6.9.0", forRemoval = true)
public QueryPlan(String tableName, JexlNode queryTree, Iterable<Range> rangeIter, List<IteratorSetting> settings, Collection<String> columnFamilies) {
this.tableName = tableName;
this.queryTree = queryTree;
this.ranges = Lists.newArrayList(rangeIter);
for (IteratorSetting setting : settings) {
IteratorSetting newSetting = new IteratorSetting(setting.getPriority(), setting.getName(), setting.getIteratorClass());
newSetting.addOptions(setting.getOptions());
if (newSetting.getOptions().containsKey(QUERY)) {
newSetting.addOption(QUERY, JexlStringBuildingVisitor.buildQuery(queryTree));
newSetting.addOption(RANGES, this.ranges.stream().map(Range::toString).collect(Collectors.joining(",", "[", "]")));
}
this.settings.add(newSetting);

}
if (null != columnFamilies) {
this.columnFamilies.addAll(columnFamilies);
}
resetHashCode();
}

/**
* @param tableName
* @param queryTree
* @param rangeIter
* @param settings
*/
@Deprecated(since = "6.9.0", forRemoval = true)
public QueryPlan(String tableName, JexlNode queryTree, Iterable<Range> rangeIter, List<IteratorSetting> settings) {
this(tableName, queryTree, rangeIter, settings, null);
}

public QueryPlan(JexlNode queryTree, Collection<Range> ranges) {
this.queryTree = queryTree;
this.ranges = ranges;
Expand Down Expand Up @@ -340,20 +233,6 @@ public void setQueryTreeString(String queryString) {
resetHashCode();
}

@Deprecated(since = "6.9.0", forRemoval = true)
public void setQuery(String queryString, JexlNode queryTree) {
this.queryTree = queryTree;
this.queryTreeString = queryString;
resetHashCode();
}

@Deprecated(since = "6.9.0", forRemoval = true)
public void setQuery(String queryString, ASTJexlScript queryTree) {
this.queryTree = queryTree;
this.queryTreeString = queryString;
resetHashCode();
}

public String getQueryString() {
if (null == queryTreeString) {
Preconditions.checkNotNull(queryTree);
Expand Down
Loading