aboutsummaryrefslogtreecommitdiff
path: root/exec/java-exec/src/main
diff options
context:
space:
mode:
authorVolodymyr Vysotskyi <vvovyk@gmail.com>2018-04-23 11:38:39 +0300
committerVolodymyr Vysotskyi <vvovyk@gmail.com>2018-08-28 20:04:25 +0300
commit44e63bd0deda72af726f51e0ff78fc2b636c64eb (patch)
tree6729d28338ead5c071a1c23f2cbcabe1e340387f /exec/java-exec/src/main
parentd8f9fb6a5cf22a01fa3f48bd40e7dbeb3cb6e4e4 (diff)
DRILL-6422: Update guava to 23.0 and shade it
- Fix compilation errors for new version of Guava. - Remove usage of deprecated API - Shade guava and add dependencies to the shaded version - Ban unshaded package - Introduce drill-shaded module and move guava-shaded under it - Add methods to convert shaded guava lists to the unshaded ones - Add instruction for publishing artifacts to the Apache repository
Diffstat (limited to 'exec/java-exec/src/main')
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/coord/zk/ZKClusterCoordinator.java11
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/expr/HoldingContainerExpression.java5
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractReceiver.java8
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractSubScan.java5
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/UnnestPOP.java4
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/Values.java4
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java3
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillValuesRelBase.java12
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillValuesRel.java6
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ValuesPrel.java8
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/schema/Field.java8
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/schema/NamedField.java46
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/schema/OrderedField.java34
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java22
14 files changed, 85 insertions, 91 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/coord/zk/ZKClusterCoordinator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/coord/zk/ZKClusterCoordinator.java
index cc23a99ec..083b48fb4 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/coord/zk/ZKClusterCoordinator.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/coord/zk/ZKClusterCoordinator.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.coord.zk;
-import static com.google.common.base.Throwables.propagate;
import static com.google.common.collect.Collections2.transform;
import java.io.IOException;
@@ -32,6 +31,7 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import com.google.common.base.Throwables;
import org.apache.commons.collections.keyvalue.MultiKey;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.CuratorFramework;
@@ -179,7 +179,8 @@ public class ZKClusterCoordinator extends ClusterCoordinator {
discovery.registerService(serviceInstance);
return new ZKRegistrationHandle(serviceInstance.getId(),data);
} catch (Exception e) {
- throw propagate(e);
+ Throwables.throwIfUnchecked(e);
+ throw new RuntimeException(e);
}
}
@@ -202,7 +203,8 @@ public class ZKClusterCoordinator extends ClusterCoordinator {
.build();
discovery.unregisterService(serviceInstance);
} catch (Exception e) {
- propagate(e);
+ Throwables.throwIfUnchecked(e);
+ throw new RuntimeException(e);
}
}
@@ -222,7 +224,8 @@ public class ZKClusterCoordinator extends ClusterCoordinator {
.payload(endpoint).build();
discovery.updateService(serviceInstance);
} catch (Exception e) {
- propagate(e);
+ Throwables.throwIfUnchecked(e);
+ throw new RuntimeException(e);
}
return handle;
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/HoldingContainerExpression.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/HoldingContainerExpression.java
index 882ac58bd..ccabb8a3c 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/HoldingContainerExpression.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/HoldingContainerExpression.java
@@ -17,6 +17,7 @@
*/
package org.apache.drill.exec.expr;
+import java.util.Collections;
import java.util.Iterator;
import org.apache.drill.common.expression.ExpressionPosition;
@@ -25,8 +26,6 @@ import org.apache.drill.common.expression.visitors.ExprVisitor;
import org.apache.drill.common.types.TypeProtos.MajorType;
import org.apache.drill.exec.expr.ClassGenerator.HoldingContainer;
-import com.google.common.collect.Iterators;
-
public class HoldingContainerExpression implements LogicalExpression{
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HoldingContainerExpression.class);
@@ -38,7 +37,7 @@ public class HoldingContainerExpression implements LogicalExpression{
@Override
public Iterator<LogicalExpression> iterator() {
- return Iterators.emptyIterator();
+ return Collections.emptyIterator();
}
@Override
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractReceiver.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractReceiver.java
index 7fa746016..debb865e6 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractReceiver.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractReceiver.java
@@ -17,6 +17,7 @@
*/
package org.apache.drill.exec.physical.base;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -24,10 +25,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterators;
import org.apache.drill.exec.physical.MinorFragmentEndpoint;
-public abstract class AbstractReceiver extends AbstractBase implements Receiver{
+public abstract class AbstractReceiver extends AbstractBase implements Receiver {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AbstractReceiver.class);
@@ -40,7 +40,7 @@ public abstract class AbstractReceiver extends AbstractBase implements Receiver{
* @param senders List of sender MinorFragmentEndpoints each containing sender MinorFragmentId and Drillbit endpoint
* where it is running.
*/
- public AbstractReceiver(int oppositeMajorFragmentId, List<MinorFragmentEndpoint> senders, boolean spooling){
+ public AbstractReceiver(int oppositeMajorFragmentId, List<MinorFragmentEndpoint> senders, boolean spooling) {
this.oppositeMajorFragmentId = oppositeMajorFragmentId;
this.senders = ImmutableList.copyOf(senders);
this.spooling = spooling;
@@ -48,7 +48,7 @@ public abstract class AbstractReceiver extends AbstractBase implements Receiver{
@Override
public Iterator<PhysicalOperator> iterator() {
- return Iterators.emptyIterator();
+ return Collections.emptyIterator();
}
@Override
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractSubScan.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractSubScan.java
index 923b1d116..d744db424 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractSubScan.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/base/AbstractSubScan.java
@@ -17,6 +17,7 @@
*/
package org.apache.drill.exec.physical.base;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -24,8 +25,6 @@ import org.apache.drill.common.exceptions.ExecutionSetupException;
import org.apache.drill.common.graph.GraphVisitor;
import org.apache.drill.exec.record.BatchSchema.SelectionVectorMode;
-import com.google.common.collect.Iterators;
-
public abstract class AbstractSubScan extends AbstractBase implements SubScan{
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AbstractSubScan.class);
@@ -58,7 +57,7 @@ public abstract class AbstractSubScan extends AbstractBase implements SubScan{
@Override
public Iterator<PhysicalOperator> iterator() {
- return Iterators.emptyIterator();
+ return Collections.emptyIterator();
}
@Override
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/UnnestPOP.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/UnnestPOP.java
index 022ea3720..42635a83d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/UnnestPOP.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/UnnestPOP.java
@@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.google.common.collect.Iterators;
import org.apache.drill.common.exceptions.ExecutionSetupException;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.exec.physical.base.AbstractBase;
@@ -30,6 +29,7 @@ import org.apache.drill.exec.physical.base.PhysicalOperator;
import org.apache.drill.exec.physical.base.PhysicalVisitor;
import org.apache.drill.exec.physical.impl.unnest.UnnestRecordBatch;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -66,7 +66,7 @@ public class UnnestPOP extends AbstractBase implements Leaf {
@Override
public Iterator<PhysicalOperator> iterator() {
- return Iterators.emptyIterator();
+ return Collections.emptyIterator();
}
public SchemaPath getColumn() {
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/Values.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/Values.java
index 445851132..c454d60b4 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/Values.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/Values.java
@@ -17,6 +17,7 @@
*/
package org.apache.drill.exec.physical.config;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -29,7 +30,6 @@ import org.apache.drill.exec.physical.base.PhysicalVisitor;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.collect.Iterators;
public class Values extends AbstractBase implements Leaf {
@@ -66,7 +66,7 @@ public class Values extends AbstractBase implements Leaf {
@Override
public Iterator<PhysicalOperator> iterator() {
- return Iterators.emptyIterator();
+ return Collections.emptyIterator();
}
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
index 49c9726e9..cce36fb1c 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/FileSystemPartitionDescriptor.java
@@ -26,6 +26,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import org.apache.drill.common.util.GuavaUtils;
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
@@ -261,7 +262,7 @@ public class FileSystemPartitionDescriptor extends AbstractPartitionDescriptor {
table.getUserName(),
newFormatSelection));
final RelOptTableImpl newOptTableImpl = RelOptTableImpl.create(t.getRelOptSchema(), t.getRowType(), newTable,
- ImmutableList.<String>of());
+ GuavaUtils.convertToUnshadedImmutableList(ImmutableList.of()));
// return an EnumerableTableScan with fileSelection being part of digest of TableScan node.
return DirPrunedEnumerableTableScan.create(oldScan.getCluster(), newOptTableImpl, newFileSelection.toString());
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillValuesRelBase.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillValuesRelBase.java
index f6f72738f..933dc357c 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillValuesRelBase.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillValuesRelBase.java
@@ -34,6 +34,7 @@ import org.apache.calcite.rex.RexLiteral;
import org.apache.calcite.util.NlsString;
import org.apache.drill.common.JSONOptions;
import org.apache.drill.common.exceptions.DrillRuntimeException;
+import org.apache.drill.common.util.GuavaUtils;
import org.apache.drill.exec.vector.complex.fn.ExtendedJsonOutput;
import org.apache.drill.exec.vector.complex.fn.JsonOutput;
import org.joda.time.DateTime;
@@ -44,7 +45,6 @@ import com.fasterxml.jackson.core.JsonLocation;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.TokenBuffer;
-import com.google.common.collect.ImmutableList;
/**
* Base class for logical and physical Values implemented in Drill.
@@ -55,7 +55,7 @@ public abstract class DrillValuesRelBase extends Values implements DrillRelNode
protected final JSONOptions content;
- public DrillValuesRelBase(RelOptCluster cluster, RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples, RelTraitSet traits) {
+ public DrillValuesRelBase(RelOptCluster cluster, RelDataType rowType, List<? extends List<RexLiteral>> tuples, RelTraitSet traits) {
this(cluster, rowType, tuples, traits, convertToJsonOptions(rowType, tuples));
}
@@ -65,10 +65,10 @@ public abstract class DrillValuesRelBase extends Values implements DrillRelNode
*/
public DrillValuesRelBase(RelOptCluster cluster,
RelDataType rowType,
- ImmutableList<ImmutableList<RexLiteral>> tuples,
+ List<? extends List<RexLiteral>> tuples,
RelTraitSet traits,
JSONOptions content) {
- super(cluster, rowType, tuples, traits);
+ super(cluster, rowType, GuavaUtils.convertToNestedUnshadedImmutableList(tuples), traits);
this.content = content;
}
@@ -87,7 +87,7 @@ public abstract class DrillValuesRelBase extends Values implements DrillRelNode
* @param tuples list of constant values in a row-expression
* @return json representation of tuples
*/
- private static JSONOptions convertToJsonOptions(RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples) {
+ private static JSONOptions convertToJsonOptions(RelDataType rowType, List<? extends List<RexLiteral>> tuples) {
try {
return new JSONOptions(convertToJsonNode(rowType, tuples), JsonLocation.NA);
} catch (IOException e) {
@@ -95,7 +95,7 @@ public abstract class DrillValuesRelBase extends Values implements DrillRelNode
}
}
- private static JsonNode convertToJsonNode(RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples) throws IOException {
+ private static JsonNode convertToJsonNode(RelDataType rowType, List<? extends List<RexLiteral>> tuples) throws IOException {
TokenBuffer out = new TokenBuffer(MAPPER.getFactory().getCodec(), false);
JsonOutput json = new ExtendedJsonOutput(out);
json.writeStartArray();
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillValuesRel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillValuesRel.java
index fb66acd4c..492e6a39f 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillValuesRel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/logical/DrillValuesRel.java
@@ -19,7 +19,6 @@ package org.apache.drill.exec.planner.logical;
import java.util.List;
-import com.google.common.collect.ImmutableList;
import org.apache.drill.common.JSONOptions;
import org.apache.drill.common.logical.data.LogicalOperator;
import org.apache.calcite.rel.RelNode;
@@ -36,11 +35,11 @@ import org.apache.drill.exec.planner.common.DrillValuesRelBase;
*/
public class DrillValuesRel extends DrillValuesRelBase implements DrillRel {
- public DrillValuesRel(RelOptCluster cluster, RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples, RelTraitSet traits) {
+ public DrillValuesRel(RelOptCluster cluster, RelDataType rowType, List<? extends List<RexLiteral>> tuples, RelTraitSet traits) {
super(cluster, rowType, tuples, traits);
}
- public DrillValuesRel(RelOptCluster cluster, RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples, RelTraitSet traits, JSONOptions content) {
+ public DrillValuesRel(RelOptCluster cluster, RelDataType rowType, List<? extends List<RexLiteral>> tuples, RelTraitSet traits, JSONOptions content) {
super(cluster, rowType, tuples, traits, content);
}
@@ -57,5 +56,4 @@ public class DrillValuesRel extends DrillValuesRelBase implements DrillRel {
.build();
}
-
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ValuesPrel.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ValuesPrel.java
index 095519fa1..e464b1ad2 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ValuesPrel.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ValuesPrel.java
@@ -22,7 +22,6 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import com.google.common.collect.ImmutableList;
import org.apache.calcite.plan.RelOptCluster;
import org.apache.calcite.plan.RelTraitSet;
import org.apache.calcite.rel.RelNode;
@@ -40,11 +39,14 @@ import org.apache.drill.exec.record.BatchSchema.SelectionVectorMode;
*/
public class ValuesPrel extends DrillValuesRelBase implements Prel {
- public ValuesPrel(RelOptCluster cluster, RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples, RelTraitSet traits) {
+ public ValuesPrel(RelOptCluster cluster, RelDataType rowType, List<? extends List<RexLiteral>> tuples, RelTraitSet traits) {
super(cluster, rowType, tuples, traits);
}
- public ValuesPrel(RelOptCluster cluster, RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples, RelTraitSet traits, JSONOptions content) {
+ public ValuesPrel(RelOptCluster cluster,
+ RelDataType rowType,
+ List<? extends List<RexLiteral>> tuples, RelTraitSet traits,
+ JSONOptions content) {
super(cluster, rowType, tuples, traits, content);
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/schema/Field.java b/exec/java-exec/src/main/java/org/apache/drill/exec/schema/Field.java
index 7280ca3fa..5468df033 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/schema/Field.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/schema/Field.java
@@ -19,7 +19,7 @@ package org.apache.drill.exec.schema;
import org.apache.drill.common.types.TypeProtos.MajorType;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
public abstract class Field {
@@ -52,10 +52,10 @@ public abstract class Field {
this.read = read;
}
- protected abstract Objects.ToStringHelper addAttributesToHelper(Objects.ToStringHelper helper);
+ protected abstract MoreObjects.ToStringHelper addAttributesToHelper(MoreObjects.ToStringHelper helper);
- Objects.ToStringHelper getAttributesStringHelper() {
- return Objects.toStringHelper(this).add("type", fieldType)
+ MoreObjects.ToStringHelper getAttributesStringHelper() {
+ return MoreObjects.toStringHelper(this).add("type", fieldType)
.add("fullFieldName", getFullFieldName())
.add("schema", schema == null ? null : schema.toSchemaString()).omitNullValues();
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/schema/NamedField.java b/exec/java-exec/src/main/java/org/apache/drill/exec/schema/NamedField.java
index d6c4b6bdd..b37b53b1a 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/schema/NamedField.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/schema/NamedField.java
@@ -20,33 +20,33 @@ package org.apache.drill.exec.schema;
import org.apache.drill.common.types.TypeProtos.MajorType;
import org.apache.drill.exec.schema.json.jackson.JacksonHelper;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
public class NamedField extends Field {
- final MajorType keyType;
- String fieldName;
+ final MajorType keyType;
+ String fieldName;
- public NamedField(RecordSchema parentSchema, String prefixFieldName, String fieldName, MajorType fieldType) {
- this(parentSchema, prefixFieldName, fieldName, fieldType, JacksonHelper.STRING_TYPE);
- }
+ public NamedField(RecordSchema parentSchema, String prefixFieldName, String fieldName, MajorType fieldType) {
+ this(parentSchema, prefixFieldName, fieldName, fieldType, JacksonHelper.STRING_TYPE);
+ }
- public NamedField(RecordSchema parentSchema,
- String prefixFieldName,
- String fieldName,
- MajorType fieldType,
- MajorType keyType) {
- super(parentSchema, fieldType, prefixFieldName);
- this.fieldName = fieldName;
- this.keyType = keyType;
- }
+ public NamedField(RecordSchema parentSchema,
+ String prefixFieldName,
+ String fieldName,
+ MajorType fieldType,
+ MajorType keyType) {
+ super(parentSchema, fieldType, prefixFieldName);
+ this.fieldName = fieldName;
+ this.keyType = keyType;
+ }
- @Override
- public String getFieldName() {
- return fieldName;
- }
+ @Override
+ public String getFieldName() {
+ return fieldName;
+ }
- @Override
- protected Objects.ToStringHelper addAttributesToHelper(Objects.ToStringHelper helper) {
- return helper.add("keyType", keyType);
- }
+ @Override
+ protected MoreObjects.ToStringHelper addAttributesToHelper(MoreObjects.ToStringHelper helper) {
+ return helper.add("keyType", keyType);
+ }
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/schema/OrderedField.java b/exec/java-exec/src/main/java/org/apache/drill/exec/schema/OrderedField.java
index 5cc51faae..bd9cb9fae 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/schema/OrderedField.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/schema/OrderedField.java
@@ -19,26 +19,26 @@ package org.apache.drill.exec.schema;
import org.apache.drill.common.types.TypeProtos.MajorType;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
public class OrderedField extends Field {
- private final int index;
+ private final int index;
- public OrderedField(RecordSchema parentSchema,
- MajorType type,
- String prefixFieldName,
- int index) {
- super(parentSchema, type, prefixFieldName);
- this.index = index;
- }
+ public OrderedField(RecordSchema parentSchema,
+ MajorType type,
+ String prefixFieldName,
+ int index) {
+ super(parentSchema, type, prefixFieldName);
+ this.index = index;
+ }
- @Override
- public String getFieldName() {
- return "[" + index + "]";
- }
+ @Override
+ public String getFieldName() {
+ return "[" + index + "]";
+ }
- @Override
- protected Objects.ToStringHelper addAttributesToHelper(Objects.ToStringHelper helper) {
- return helper;
- }
+ @Override
+ protected MoreObjects.ToStringHelper addAttributesToHelper(MoreObjects.ToStringHelper helper) {
+ return helper;
+ }
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java
index 1ff6324e2..3fb8cd211 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/WorkspaceSchemaFactory.java
@@ -17,8 +17,6 @@
*/
package org.apache.drill.exec.store.dfs;
-import static com.google.common.collect.Collections2.transform;
-import static com.google.common.collect.Sets.newHashSet;
import static java.util.Collections.unmodifiableList;
import java.io.FileNotFoundException;
@@ -34,6 +32,7 @@ import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rel.type.RelDataTypeFactory;
@@ -479,13 +478,9 @@ public class WorkspaceSchemaFactory {
}
private Set<String> rawTableNames() {
- return newHashSet(
- transform(tables.keySet(), new com.google.common.base.Function<TableInstance, String>() {
- @Override
- public String apply(TableInstance input) {
- return input.sig.name;
- }
- }));
+ return tables.keySet().stream()
+ .map(input -> input.sig.name)
+ .collect(Collectors.toSet());
}
@Override
@@ -501,12 +496,9 @@ public class WorkspaceSchemaFactory {
@Override
public List<Function> getFunctions(String name) {
List<TableSignature> sigs = optionExtractor.getTableSignatures(name);
- return Lists.transform(sigs, new com.google.common.base.Function<TableSignature, Function>() {
- @Override
- public Function apply(TableSignature input) {
- return new WithOptionsTableMacro(input, WorkspaceSchema.this);
- }
- });
+ return sigs.stream()
+ .map(input -> new WithOptionsTableMacro(input, WorkspaceSchema.this))
+ .collect(Collectors.toList());
}
private View getView(DotDrillFile f) throws IOException {