You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by lu...@apache.org on 2022/02/02 01:23:04 UTC
[drill] branch master updated: DRILL-8111: Remove lombok usage (#2433)
This is an automated email from the ASF dual-hosted git repository.
luoc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git
The following commit(s) were added to refs/heads/master by this push:
new 2fdf6b1 DRILL-8111: Remove lombok usage (#2433)
2fdf6b1 is described below
commit 2fdf6b180202a18611b48cb95ee6a00dbef6641b
Author: Volodymyr Vysotskyi <vv...@gmail.com>
AuthorDate: Wed Feb 2 03:22:54 2022 +0200
DRILL-8111: Remove lombok usage (#2433)
---
.../exec/store/iceberg/IcebergBlockMapBuilder.java | 6 +-
.../drill/exec/store/iceberg/IcebergGroupScan.java | 123 +++++++--
.../drill/exec/store/iceberg/IcebergSubScan.java | 110 +++++++-
.../drill/exec/store/iceberg/IcebergWork.java | 44 ++-
.../store/iceberg/format/IcebergFormatMatcher.java | 6 +-
.../store/iceberg/format/IcebergFormatPlugin.java | 2 +-
.../iceberg/format/IcebergFormatPluginConfig.java | 161 +++++++++--
.../iceberg/plan/DrillExprToIcebergTranslator.java | 12 +-
.../store/iceberg/read/IcebergRecordReader.java | 2 -
.../exec/store/iceberg/snapshot/SnapshotAfter.java | 6 +-
.../store/iceberg/snapshot/SnapshotByTime.java | 6 +-
.../store/iceberg/snapshot/SnapshotFactory.java | 65 ++++-
.../store/iceberg/snapshot/SnapshotsBetween.java | 7 +-
.../drill/exec/store/pdf/PdfFormatConfig.java | 126 +++++++--
.../drill/exec/store/sas/SasFormatConfig.java | 30 ++-
.../drill/exec/store/http/HttpApiConfig.java | 296 +++++++++++++++++++--
.../drill/exec/store/http/HttpJsonOptions.java | 108 +++++++-
.../drill/exec/store/http/HttpPaginatorConfig.java | 233 ++++++++++++++--
.../drill/exec/store/http/HttpXMLBatchReader.java | 6 +-
.../store/http/oauth/AccessTokenAuthenticator.java | 9 +-
.../store/http/oauth/AccessTokenInterceptor.java | 6 +-
.../drill/exec/store/http/util/SimpleHttp.java | 59 +++-
.../drill/exec/store/jdbc/JdbcWriterField.java | 16 +-
.../exec/store/mongo/BaseMongoSubScanSpec.java | 48 +++-
.../drill/exec/store/mongo/MongoFilterBuilder.java | 10 +-
.../drill/exec/store/mongo/MongoGroupScan.java | 6 +-
.../drill/exec/store/mongo/MongoScanSpec.java | 40 ++-
.../exec/store/mongo/MongoStoragePluginConfig.java | 76 +++++-
.../drill/exec/store/mongo/MongoSubScan.java | 125 ++++++++-
.../exec/store/phoenix/PhoenixDataSource.java | 4 +-
.../phoenix/secured/SecuredPhoenixBaseTest.java | 7 +-
distribution/src/assemble/component.xml | 1 -
.../apache/drill/exec/alias/ResolvedAliases.java | 8 +-
.../planner/sql/handlers/BaseAliasHandler.java | 6 +-
.../planner/sql/handlers/CreateAliasHandler.java | 6 +-
.../planner/sql/handlers/DropAliasHandler.java | 6 +-
.../sql/handlers/DropAllAliasesHandler.java | 6 +-
.../exec/planner/sql/parser/SqlCreateAlias.java | 106 ++++++--
.../exec/planner/sql/parser/SqlDropAlias.java | 94 ++++++-
.../exec/planner/sql/parser/SqlDropAllAliases.java | 67 ++++-
.../rpc/user/security/VaultUserAuthenticator.java | 29 +-
.../store/enumerable/EnumerableRecordReader.java | 6 +-
.../exec/store/parquet/ParquetFormatConfig.java | 164 ++++++++++--
.../exec/store/plan/rule/PluginConverterRule.java | 2 -
.../org/apache/drill/exec/testing/Injection.java | 22 +-
.../drill/exec/store/sys/PStoreTestUtil.java | 11 +-
.../drill/exec/store/sys/TestPStoreProviders.java | 3 +-
lombok.config | 19 --
pom.xml | 8 -
49 files changed, 1966 insertions(+), 353 deletions(-)
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergBlockMapBuilder.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergBlockMapBuilder.java
index 7230302..7972f9e 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergBlockMapBuilder.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergBlockMapBuilder.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.store.iceberg;
-import lombok.extern.slf4j.Slf4j;
import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint;
import org.apache.drill.exec.store.TimedCallable;
import org.apache.drill.exec.store.schedule.EndpointByteMap;
@@ -31,6 +30,8 @@ import org.apache.hadoop.fs.Path;
import org.apache.iceberg.BaseCombinedScanTask;
import org.apache.iceberg.CombinedScanTask;
import org.apache.iceberg.FileScanTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
@@ -41,9 +42,10 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
-@Slf4j
public class IcebergBlockMapBuilder {
+ private static final Logger logger = LoggerFactory.getLogger(IcebergBlockMapBuilder.class);
+
private final Map<FileScanTask, RangeMap<Long, BlockLocation>> blockMapMap;
private final Map<String, DrillbitEndpoint> endPointMap;
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergGroupScan.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergGroupScan.java
index dc309d2..5944b82 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergGroupScan.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergGroupScan.java
@@ -22,10 +22,8 @@ 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 lombok.Builder;
-import lombok.SneakyThrows;
-import lombok.extern.slf4j.Slf4j;
import org.apache.drill.common.PlanStringBuilder;
+import org.apache.drill.common.exceptions.DrillRuntimeException;
import org.apache.drill.common.expression.LogicalExpression;
import org.apache.drill.common.expression.PathSegment;
import org.apache.drill.common.expression.SchemaPath;
@@ -50,16 +48,20 @@ import org.apache.drill.shaded.guava.com.google.common.collect.ListMultimap;
import org.apache.iceberg.TableScan;
import org.apache.iceberg.expressions.Expression;
import org.apache.iceberg.hadoop.HadoopTables;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
-@Slf4j
@JsonTypeName("iceberg-scan")
@SuppressWarnings("unused")
public class IcebergGroupScan extends AbstractGroupScan {
+ private static final Logger logger = LoggerFactory.getLogger(IcebergGroupScan.class);
+
private final IcebergFormatPlugin formatPlugin;
private final String path;
@@ -92,22 +94,25 @@ public class IcebergGroupScan extends AbstractGroupScan {
@JsonProperty("path") String path,
@JsonProperty("condition") LogicalExpression condition,
@JsonProperty("maxRecords") Integer maxRecords,
- @JacksonInject StoragePluginRegistry pluginRegistry) {
- this(userName,
- pluginRegistry.resolveFormat(storageConfig, formatConfig, IcebergFormatPlugin.class),
- schema, path, condition, columns, maxRecords);
- }
-
- @Builder(toBuilder = true)
- private IcebergGroupScan(String userName, IcebergFormatPlugin formatPlugin,
- TupleMetadata schema, String path, LogicalExpression condition, List<SchemaPath> columns, int maxRecords) {
- super(userName);
- this.formatPlugin = formatPlugin;
- this.columns = columns;
- this.path = path;
- this.schema = schema;
- this.condition = condition;
- this.maxRecords = maxRecords;
+ @JacksonInject StoragePluginRegistry pluginRegistry) throws IOException {
+ this(builder()
+ .userName(userName)
+ .formatPlugin(pluginRegistry.resolveFormat(storageConfig, formatConfig, IcebergFormatPlugin.class))
+ .schema(schema)
+ .path(path)
+ .condition(condition)
+ .columns(columns)
+ .maxRecords(maxRecords));
+ }
+
+ private IcebergGroupScan(IcebergGroupScanBuilder builder) throws IOException {
+ super(builder.userName);
+ this.formatPlugin = builder.formatPlugin;
+ this.columns = builder.columns;
+ this.path = builder.path;
+ this.schema = builder.schema;
+ this.condition = builder.condition;
+ this.maxRecords = builder.maxRecords;
this.fs = ImpersonationUtil.createFileSystem(ImpersonationUtil.resolveUserName(userName), formatPlugin.getFsConf());
this.tableScan = initTableScan(formatPlugin, path, condition);
@@ -166,9 +171,17 @@ public class IcebergGroupScan extends AbstractGroupScan {
this.endpointAffinities = that.endpointAffinities;
}
+ public static IcebergGroupScanBuilder builder() {
+ return new IcebergGroupScanBuilder();
+ }
+
@Override
public IcebergGroupScan clone(List<SchemaPath> columns) {
- return toBuilder().columns(columns).build();
+ try {
+ return toBuilder().columns(columns).build();
+ } catch (IOException e) {
+ throw new DrillRuntimeException(e);
+ }
}
@Override
@@ -263,8 +276,7 @@ public class IcebergGroupScan extends AbstractGroupScan {
return new IcebergGroupScan(this);
}
- @SneakyThrows
- private void init() {
+ private void init() throws IOException {
tableScan = projectColumns(tableScan, columns);
chunks = new IcebergBlockMapBuilder(fs, formatPlugin.getContext().getBits())
.generateFileWork(tableScan.planTasks());
@@ -358,4 +370,69 @@ public class IcebergGroupScan extends AbstractGroupScan {
.toString();
}
+ public IcebergGroupScanBuilder toBuilder() {
+ return new IcebergGroupScanBuilder()
+ .userName(this.userName)
+ .formatPlugin(this.formatPlugin)
+ .schema(this.schema)
+ .path(this.path)
+ .condition(this.condition)
+ .columns(this.columns)
+ .maxRecords(this.maxRecords);
+ }
+
+ public static class IcebergGroupScanBuilder {
+ private String userName;
+
+ private IcebergFormatPlugin formatPlugin;
+
+ private TupleMetadata schema;
+
+ private String path;
+
+ private LogicalExpression condition;
+
+ private List<SchemaPath> columns;
+
+ private int maxRecords;
+
+ public IcebergGroupScanBuilder userName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public IcebergGroupScanBuilder formatPlugin(IcebergFormatPlugin formatPlugin) {
+ this.formatPlugin = formatPlugin;
+ return this;
+ }
+
+ public IcebergGroupScanBuilder schema(TupleMetadata schema) {
+ this.schema = schema;
+ return this;
+ }
+
+ public IcebergGroupScanBuilder path(String path) {
+ this.path = path;
+ return this;
+ }
+
+ public IcebergGroupScanBuilder condition(LogicalExpression condition) {
+ this.condition = condition;
+ return this;
+ }
+
+ public IcebergGroupScanBuilder columns(List<SchemaPath> columns) {
+ this.columns = columns;
+ return this;
+ }
+
+ public IcebergGroupScanBuilder maxRecords(int maxRecords) {
+ this.maxRecords = maxRecords;
+ return this;
+ }
+
+ public IcebergGroupScan build() throws IOException {
+ return new IcebergGroupScan(this);
+ }
+ }
}
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergSubScan.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergSubScan.java
index 0566ce4..1ceada7 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergSubScan.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergSubScan.java
@@ -22,7 +22,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 lombok.Builder;
import org.apache.drill.common.expression.LogicalExpression;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.logical.FormatPluginConfig;
@@ -85,19 +84,20 @@ public class IcebergSubScan extends AbstractBase implements SubScan {
this.maxRecords = maxRecords;
}
- @Builder(toBuilder = true)
- private IcebergSubScan(String userName, IcebergFormatPlugin formatPlugin,
- List<SchemaPath> columns, LogicalExpression condition, TupleMetadata schema,
- List<IcebergWork> workList, TableScan tableScan, String path, int maxRecords) {
- super(userName);
- this.formatPlugin = formatPlugin;
- this.columns = columns;
- this.condition = condition;
- this.schema = schema;
- this.workList = workList;
- this.tableScan = tableScan;
- this.path = path;
- this.maxRecords = maxRecords;
+ private IcebergSubScan(IcebergSubScanBuilder builder) {
+ super(builder.userName);
+ this.formatPlugin = builder.formatPlugin;
+ this.columns = builder.columns;
+ this.condition = builder.condition;
+ this.schema = builder.schema;
+ this.workList = builder.workList;
+ this.tableScan = builder.tableScan;
+ this.path = builder.path;
+ this.maxRecords = builder.maxRecords;
+ }
+
+ public static IcebergSubScanBuilder builder() {
+ return new IcebergSubScanBuilder();
}
private TableScan getTableScan(List<SchemaPath> columns, String path, LogicalExpression condition) {
@@ -166,4 +166,86 @@ public class IcebergSubScan extends AbstractBase implements SubScan {
public TupleMetadata getSchema() {
return schema;
}
+
+ public IcebergSubScanBuilder toBuilder() {
+ return new IcebergSubScanBuilder()
+ .userName(this.userName)
+ .formatPlugin(this.formatPlugin)
+ .columns(this.columns)
+ .condition(this.condition)
+ .schema(this.schema)
+ .workList(this.workList)
+ .tableScan(this.tableScan)
+ .path(this.path)
+ .maxRecords(this.maxRecords);
+ }
+
+ public static class IcebergSubScanBuilder {
+ private String userName;
+
+ private IcebergFormatPlugin formatPlugin;
+
+ private List<SchemaPath> columns;
+
+ private LogicalExpression condition;
+
+ private TupleMetadata schema;
+
+ private List<IcebergWork> workList;
+
+ private TableScan tableScan;
+
+ private String path;
+
+ private int maxRecords;
+
+ public IcebergSubScanBuilder userName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public IcebergSubScanBuilder formatPlugin(IcebergFormatPlugin formatPlugin) {
+ this.formatPlugin = formatPlugin;
+ return this;
+ }
+
+ public IcebergSubScanBuilder columns(List<SchemaPath> columns) {
+ this.columns = columns;
+ return this;
+ }
+
+ public IcebergSubScanBuilder condition(LogicalExpression condition) {
+ this.condition = condition;
+ return this;
+ }
+
+ public IcebergSubScanBuilder schema(TupleMetadata schema) {
+ this.schema = schema;
+ return this;
+ }
+
+ public IcebergSubScanBuilder workList(List<IcebergWork> workList) {
+ this.workList = workList;
+ return this;
+ }
+
+ public IcebergSubScanBuilder tableScan(TableScan tableScan) {
+ this.tableScan = tableScan;
+ return this;
+ }
+
+ public IcebergSubScanBuilder path(String path) {
+ this.path = path;
+ return this;
+ }
+
+ public IcebergSubScanBuilder maxRecords(int maxRecords) {
+ this.maxRecords = maxRecords;
+ return this;
+ }
+
+ public IcebergSubScan build() {
+ return new IcebergSubScan(this);
+ }
+ }
}
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergWork.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergWork.java
index f43e97e..63da528 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergWork.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/IcebergWork.java
@@ -26,9 +26,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import lombok.Value;
-import lombok.extern.slf4j.Slf4j;
import org.apache.iceberg.CombinedScanTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -36,20 +36,54 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Base64;
+import java.util.Objects;
+import java.util.StringJoiner;
-@Value
@JsonSerialize(using = IcebergWork.IcebergWorkSerializer.class)
@JsonDeserialize(using = IcebergWork.IcebergWorkDeserializer.class)
public class IcebergWork {
- CombinedScanTask scanTask;
+ private final CombinedScanTask scanTask;
+
+ public IcebergWork(CombinedScanTask scanTask) {
+ this.scanTask = scanTask;
+ }
+
+ public CombinedScanTask getScanTask() {
+ return this.scanTask;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ IcebergWork that = (IcebergWork) o;
+ return Objects.equals(scanTask, that.scanTask);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(scanTask);
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(", ", IcebergWork.class.getSimpleName() + "[", "]")
+ .add("scanTask=" + scanTask)
+ .toString();
+ }
/**
* Special deserializer for {@link IcebergWork} class that deserializes
* {@code scanTask} field from byte array string created using {@link java.io.Serializable}.
*/
- @Slf4j
public static class IcebergWorkDeserializer extends StdDeserializer<IcebergWork> {
+ private static final Logger logger = LoggerFactory.getLogger(IcebergWorkDeserializer.class);
+
public IcebergWorkDeserializer() {
super(IcebergWork.class);
}
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatMatcher.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatMatcher.java
index e4d6f3b..fd9caa4 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatMatcher.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatMatcher.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.store.iceberg.format;
-import lombok.AllArgsConstructor;
import org.apache.drill.exec.planner.logical.DrillTable;
import org.apache.drill.exec.store.SchemaConfig;
import org.apache.drill.exec.store.dfs.DrillFileSystem;
@@ -33,12 +32,15 @@ import org.apache.hadoop.fs.Path;
import java.io.IOException;
-@AllArgsConstructor
public class IcebergFormatMatcher extends FormatMatcher {
private static final String METADATA_DIR_NAME = "metadata";
private final IcebergFormatPlugin formatPlugin;
+ public IcebergFormatMatcher(IcebergFormatPlugin formatPlugin) {
+ this.formatPlugin = formatPlugin;
+ }
+
@Override
public boolean supportDirectoryReads() {
return true;
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatPlugin.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatPlugin.java
index 00b7139..36c51c0 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatPlugin.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatPlugin.java
@@ -140,7 +140,7 @@ public class IcebergFormatPlugin implements FormatPlugin {
}
@Override
- public AbstractGroupScan getGroupScan(String userName, FileSelection selection, List<SchemaPath> columns) {
+ public AbstractGroupScan getGroupScan(String userName, FileSelection selection, List<SchemaPath> columns) throws IOException {
return IcebergGroupScan.builder()
.userName(userName)
.formatPlugin(this)
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatPluginConfig.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatPluginConfig.java
index 0b0b94e..9e53803 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatPluginConfig.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/format/IcebergFormatPluginConfig.java
@@ -19,20 +19,18 @@ package org.apache.drill.exec.store.iceberg.format;
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 lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import org.apache.drill.common.logical.FormatPluginConfig;
import org.apache.drill.exec.store.iceberg.snapshot.Snapshot;
import org.apache.drill.exec.store.iceberg.snapshot.SnapshotFactory;
import java.util.Map;
+import java.util.Objects;
-@Getter
-@EqualsAndHashCode
@JsonTypeName(IcebergFormatPluginConfig.NAME)
+@JsonDeserialize(builder=IcebergFormatPluginConfig.IcebergFormatPluginConfigBuilder.class)
public class IcebergFormatPluginConfig implements FormatPluginConfig {
public static final String NAME = "iceberg";
@@ -55,25 +53,17 @@ public class IcebergFormatPluginConfig implements FormatPluginConfig {
private final Long toSnapshotId;
- @Builder
@JsonCreator
public IcebergFormatPluginConfig(
- @JsonProperty("properties") Map<String, String> properties,
- @JsonProperty("caseSensitive") Boolean caseSensitive,
- @JsonProperty("includeColumnStats") Boolean includeColumnStats,
- @JsonProperty("ignoreResiduals") Boolean ignoreResiduals,
- @JsonProperty("snapshotId") Long snapshotId,
- @JsonProperty("snapshotAsOfTime") Long snapshotAsOfTime,
- @JsonProperty("fromSnapshotId") Long fromSnapshotId,
- @JsonProperty("toSnapshotId") Long toSnapshotId) {
- this.properties = properties;
- this.caseSensitive = caseSensitive;
- this.includeColumnStats = includeColumnStats;
- this.ignoreResiduals = ignoreResiduals;
- this.snapshotId = snapshotId;
- this.snapshotAsOfTime = snapshotAsOfTime;
- this.fromSnapshotId = fromSnapshotId;
- this.toSnapshotId = toSnapshotId;
+ IcebergFormatPluginConfigBuilder builder) {
+ this.properties = builder.properties;
+ this.caseSensitive = builder.caseSensitive;
+ this.includeColumnStats = builder.includeColumnStats;
+ this.ignoreResiduals = builder.ignoreResiduals;
+ this.snapshotId = builder.snapshotId;
+ this.snapshotAsOfTime = builder.snapshotAsOfTime;
+ this.fromSnapshotId = builder.fromSnapshotId;
+ this.toSnapshotId = builder.toSnapshotId;
SnapshotFactory.SnapshotContext context = SnapshotFactory.SnapshotContext.builder()
.snapshotId(snapshotId)
@@ -85,8 +75,133 @@ public class IcebergFormatPluginConfig implements FormatPluginConfig {
this.snapshot = SnapshotFactory.INSTANCE.createSnapshot(context);
}
+ public static IcebergFormatPluginConfigBuilder builder() {
+ return new IcebergFormatPluginConfigBuilder();
+ }
+
@JsonIgnore
public Snapshot getSnapshot() {
return snapshot;
}
+
+ public Map<String, String> getProperties() {
+ return this.properties;
+ }
+
+ public Boolean getCaseSensitive() {
+ return this.caseSensitive;
+ }
+
+ public Boolean getIncludeColumnStats() {
+ return this.includeColumnStats;
+ }
+
+ public Boolean getIgnoreResiduals() {
+ return this.ignoreResiduals;
+ }
+
+ public Long getSnapshotId() {
+ return this.snapshotId;
+ }
+
+ public Long getSnapshotAsOfTime() {
+ return this.snapshotAsOfTime;
+ }
+
+ public Long getFromSnapshotId() {
+ return this.fromSnapshotId;
+ }
+
+ public Long getToSnapshotId() {
+ return this.toSnapshotId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ IcebergFormatPluginConfig that = (IcebergFormatPluginConfig) o;
+ return Objects.equals(properties, that.properties)
+ && Objects.equals(snapshot, that.snapshot)
+ && Objects.equals(caseSensitive, that.caseSensitive)
+ && Objects.equals(includeColumnStats, that.includeColumnStats)
+ && Objects.equals(ignoreResiduals, that.ignoreResiduals)
+ && Objects.equals(snapshotId, that.snapshotId)
+ && Objects.equals(snapshotAsOfTime, that.snapshotAsOfTime)
+ && Objects.equals(fromSnapshotId, that.fromSnapshotId)
+ && Objects.equals(toSnapshotId, that.toSnapshotId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(properties, snapshot, caseSensitive, includeColumnStats,
+ ignoreResiduals, snapshotId, snapshotAsOfTime, fromSnapshotId, toSnapshotId);
+ }
+
+ @JsonPOJOBuilder(withPrefix = "")
+ public static class IcebergFormatPluginConfigBuilder {
+ private Map<String, String> properties;
+
+ private Boolean caseSensitive;
+
+ private Boolean includeColumnStats;
+
+ private Boolean ignoreResiduals;
+
+ private Long snapshotId;
+
+ private Long snapshotAsOfTime;
+
+ private Long fromSnapshotId;
+
+ private Long toSnapshotId;
+
+ public IcebergFormatPluginConfigBuilder properties(Map<String, String> properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ public IcebergFormatPluginConfigBuilder caseSensitive(Boolean caseSensitive) {
+ this.caseSensitive = caseSensitive;
+ return this;
+ }
+
+ public IcebergFormatPluginConfigBuilder includeColumnStats(Boolean includeColumnStats) {
+ this.includeColumnStats = includeColumnStats;
+ return this;
+ }
+
+ public IcebergFormatPluginConfigBuilder ignoreResiduals(Boolean ignoreResiduals) {
+ this.ignoreResiduals = ignoreResiduals;
+ return this;
+ }
+
+ public IcebergFormatPluginConfigBuilder snapshotId(Long snapshotId) {
+ this.snapshotId = snapshotId;
+ return this;
+ }
+
+ public IcebergFormatPluginConfigBuilder snapshotAsOfTime(Long snapshotAsOfTime) {
+ this.snapshotAsOfTime = snapshotAsOfTime;
+ return this;
+ }
+
+ public IcebergFormatPluginConfigBuilder fromSnapshotId(Long fromSnapshotId) {
+ this.fromSnapshotId = fromSnapshotId;
+ return this;
+ }
+
+ public IcebergFormatPluginConfigBuilder toSnapshotId(Long toSnapshotId) {
+ this.toSnapshotId = toSnapshotId;
+ return this;
+ }
+
+ public IcebergFormatPluginConfig build() {
+ return new IcebergFormatPluginConfig(this);
+ }
+ }
}
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/plan/DrillExprToIcebergTranslator.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/plan/DrillExprToIcebergTranslator.java
index a42e8a2..3449935 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/plan/DrillExprToIcebergTranslator.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/plan/DrillExprToIcebergTranslator.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.store.iceberg.plan;
-import lombok.Value;
import org.apache.drill.common.FunctionNames;
import org.apache.drill.common.expression.FunctionCall;
import org.apache.drill.common.expression.LogicalExpression;
@@ -208,13 +207,20 @@ public class DrillExprToIcebergTranslator extends AbstractExprVisitor<Expression
return null;
}
- @Value
private static class ConstantExpression<T> implements Expression {
- T value;
+ private final T value;
+
+ public ConstantExpression(T value) {
+ this.value = value;
+ }
@Override
public Operation op() {
return null;
}
+
+ public T getValue() {
+ return value;
+ }
}
}
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/read/IcebergRecordReader.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/read/IcebergRecordReader.java
index 7239764..314f70b 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/read/IcebergRecordReader.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/read/IcebergRecordReader.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.store.iceberg.read;
-import lombok.extern.slf4j.Slf4j;
import org.apache.drill.common.AutoCloseables;
import org.apache.drill.exec.physical.impl.scan.framework.ManagedReader;
import org.apache.drill.exec.physical.impl.scan.framework.SchemaNegotiator;
@@ -36,7 +35,6 @@ import org.apache.iceberg.io.CloseableIterable;
import java.util.Iterator;
-@Slf4j
public class IcebergRecordReader implements ManagedReader<SchemaNegotiator> {
private final IcebergWork work;
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotAfter.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotAfter.java
index 4ea5e80f..14e41e2 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotAfter.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotAfter.java
@@ -18,14 +18,16 @@
package org.apache.drill.exec.store.iceberg.snapshot;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import lombok.AllArgsConstructor;
import org.apache.iceberg.TableScan;
@JsonTypeName("appendsAfter")
-@AllArgsConstructor
public class SnapshotAfter implements Snapshot {
private final long fromSnapshotId;
+ public SnapshotAfter(long fromSnapshotId) {
+ this.fromSnapshotId = fromSnapshotId;
+ }
+
@Override
public TableScan apply(TableScan tableScan) {
return tableScan.appendsAfter(fromSnapshotId);
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotByTime.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotByTime.java
index 1c0432b..ac257bc 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotByTime.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotByTime.java
@@ -18,15 +18,17 @@
package org.apache.drill.exec.store.iceberg.snapshot;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import lombok.AllArgsConstructor;
import org.apache.iceberg.TableScan;
@JsonTypeName("asOfTime")
-@AllArgsConstructor
public class SnapshotByTime implements Snapshot {
private final long snapshotAtTime;
+ public SnapshotByTime(long snapshotAtTime) {
+ this.snapshotAtTime = snapshotAtTime;
+ }
+
@Override
public TableScan apply(TableScan tableScan) {
return tableScan.asOfTime(snapshotAtTime);
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotFactory.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotFactory.java
index 68ae56d..9f73844 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotFactory.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotFactory.java
@@ -17,8 +17,6 @@
*/
package org.apache.drill.exec.store.iceberg.snapshot;
-import lombok.Builder;
-import lombok.Getter;
import org.apache.drill.shaded.guava.com.google.common.base.Preconditions;
public class SnapshotFactory {
@@ -56,8 +54,6 @@ public class SnapshotFactory {
}
}
- @Builder
- @Getter
public static class SnapshotContext {
private final Long snapshotId;
@@ -66,5 +62,66 @@ public class SnapshotFactory {
private final Long fromSnapshotId;
private final Long toSnapshotId;
+
+ SnapshotContext(SnapshotContextBuilder builder) {
+ this.snapshotId = builder.snapshotId;
+ this.snapshotAsOfTime = builder.snapshotAsOfTime;
+ this.fromSnapshotId = builder.fromSnapshotId;
+ this.toSnapshotId = builder.toSnapshotId;
+ }
+
+ public static SnapshotContextBuilder builder() {
+ return new SnapshotContextBuilder();
+ }
+
+ public Long getSnapshotId() {
+ return this.snapshotId;
+ }
+
+ public Long getSnapshotAsOfTime() {
+ return this.snapshotAsOfTime;
+ }
+
+ public Long getFromSnapshotId() {
+ return this.fromSnapshotId;
+ }
+
+ public Long getToSnapshotId() {
+ return this.toSnapshotId;
+ }
+
+ public static class SnapshotContextBuilder {
+ private Long snapshotId;
+
+ private Long snapshotAsOfTime;
+
+ private Long fromSnapshotId;
+
+ private Long toSnapshotId;
+
+ public SnapshotContextBuilder snapshotId(Long snapshotId) {
+ this.snapshotId = snapshotId;
+ return this;
+ }
+
+ public SnapshotContextBuilder snapshotAsOfTime(Long snapshotAsOfTime) {
+ this.snapshotAsOfTime = snapshotAsOfTime;
+ return this;
+ }
+
+ public SnapshotContextBuilder fromSnapshotId(Long fromSnapshotId) {
+ this.fromSnapshotId = fromSnapshotId;
+ return this;
+ }
+
+ public SnapshotContextBuilder toSnapshotId(Long toSnapshotId) {
+ this.toSnapshotId = toSnapshotId;
+ return this;
+ }
+
+ public SnapshotContext build() {
+ return new SnapshotContext(this);
+ }
+ }
}
}
diff --git a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotsBetween.java b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotsBetween.java
index 93d2678..d8a4f95 100644
--- a/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotsBetween.java
+++ b/contrib/format-iceberg/src/main/java/org/apache/drill/exec/store/iceberg/snapshot/SnapshotsBetween.java
@@ -18,15 +18,18 @@
package org.apache.drill.exec.store.iceberg.snapshot;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import lombok.AllArgsConstructor;
import org.apache.iceberg.TableScan;
@JsonTypeName("appendsBetween")
-@AllArgsConstructor
public class SnapshotsBetween implements Snapshot {
private final long fromSnapshotId;
private final long toSnapshotId;
+ public SnapshotsBetween(long fromSnapshotId, long toSnapshotId) {
+ this.fromSnapshotId = fromSnapshotId;
+ this.toSnapshotId = toSnapshotId;
+ }
+
@Override
public TableScan apply(TableScan tableScan) {
return tableScan.appendsBetween(fromSnapshotId, toSnapshotId);
diff --git a/contrib/format-pdf/src/main/java/org/apache/drill/exec/store/pdf/PdfFormatConfig.java b/contrib/format-pdf/src/main/java/org/apache/drill/exec/store/pdf/PdfFormatConfig.java
index d590a05..4c909f4 100644
--- a/contrib/format-pdf/src/main/java/org/apache/drill/exec/store/pdf/PdfFormatConfig.java
+++ b/contrib/format-pdf/src/main/java/org/apache/drill/exec/store/pdf/PdfFormatConfig.java
@@ -22,40 +22,31 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
-
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
+import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.common.exceptions.UserException;
import org.apache.drill.common.logical.FormatPluginConfig;
import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import technology.tabula.extractors.BasicExtractionAlgorithm;
import technology.tabula.extractors.ExtractionAlgorithm;
import technology.tabula.extractors.SpreadsheetExtractionAlgorithm;
import java.util.Collections;
import java.util.List;
+import java.util.Objects;
-@Slf4j
-@Builder
-@Getter
-@Setter
-@Accessors(fluent = true)
-@EqualsAndHashCode
-@ToString
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonDeserialize(builder = PdfFormatConfig.PdfFormatConfigBuilder.class)
@JsonTypeName(PdfFormatPlugin.DEFAULT_NAME)
public class PdfFormatConfig implements FormatPluginConfig {
+ private static final Logger logger = LoggerFactory.getLogger(PdfFormatConfig.class);
+
@JsonProperty
private final List<String> extensions;
@@ -83,6 +74,10 @@ public class PdfFormatConfig implements FormatPluginConfig {
this.password = builder.password;
}
+ public static PdfFormatConfigBuilder builder() {
+ return new PdfFormatConfigBuilder();
+ }
+
@JsonIgnore
public PdfBatchReader.PdfReaderConfig getReaderConfig(PdfFormatPlugin plugin) {
return new PdfBatchReader.PdfReaderConfig(plugin);
@@ -101,10 +96,111 @@ public class PdfFormatConfig implements FormatPluginConfig {
}
}
+ public List<String> extensions() {
+ return this.extensions;
+ }
+
+ public boolean combinePages() {
+ return this.combinePages;
+ }
+
+ public boolean extractHeaders() {
+ return this.extractHeaders;
+ }
+
+ public String extractionAlgorithm() {
+ return this.extractionAlgorithm;
+ }
+
+ public String password() {
+ return this.password;
+ }
+
+ public int defaultTableIndex() {
+ return this.defaultTableIndex;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ PdfFormatConfig that = (PdfFormatConfig) o;
+ return combinePages == that.combinePages
+ && extractHeaders == that.extractHeaders
+ && defaultTableIndex == that.defaultTableIndex
+ && Objects.equals(extensions, that.extensions)
+ && Objects.equals(extractionAlgorithm, that.extractionAlgorithm)
+ && Objects.equals(password, that.password);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(extensions, combinePages, extractHeaders, extractionAlgorithm,
+ password, defaultTableIndex);
+ }
+
+ @Override
+ public String toString() {
+ return new PlanStringBuilder(this)
+ .field("extensions", extensions)
+ .field("combinePages", combinePages)
+ .field("extractHeaders", extractHeaders)
+ .field("extractionAlgorithm", extractionAlgorithm)
+ .field("password", password)
+ .field("defaultTableIndex", defaultTableIndex)
+ .toString();
+ }
+
@JsonPOJOBuilder(withPrefix = "")
public static class PdfFormatConfigBuilder {
+ private List<String> extensions;
+
+ private boolean combinePages;
+
+ private boolean extractHeaders;
+
+ private String extractionAlgorithm;
+
+ private String password;
+
+ private int defaultTableIndex;
+
public PdfFormatConfig build() {
return new PdfFormatConfig(this);
}
+
+ public PdfFormatConfigBuilder extensions(List<String> extensions) {
+ this.extensions = extensions;
+ return this;
+ }
+
+ public PdfFormatConfigBuilder combinePages(boolean combinePages) {
+ this.combinePages = combinePages;
+ return this;
+ }
+
+ public PdfFormatConfigBuilder extractHeaders(boolean extractHeaders) {
+ this.extractHeaders = extractHeaders;
+ return this;
+ }
+
+ public PdfFormatConfigBuilder extractionAlgorithm(String extractionAlgorithm) {
+ this.extractionAlgorithm = extractionAlgorithm;
+ return this;
+ }
+
+ public PdfFormatConfigBuilder password(String password) {
+ this.password = password;
+ return this;
+ }
+
+ public PdfFormatConfigBuilder defaultTableIndex(int defaultTableIndex) {
+ this.defaultTableIndex = defaultTableIndex;
+ return this;
+ }
}
}
diff --git a/contrib/format-sas/src/main/java/org/apache/drill/exec/store/sas/SasFormatConfig.java b/contrib/format-sas/src/main/java/org/apache/drill/exec/store/sas/SasFormatConfig.java
index 9c0a055..0647a2f 100644
--- a/contrib/format-sas/src/main/java/org/apache/drill/exec/store/sas/SasFormatConfig.java
+++ b/contrib/format-sas/src/main/java/org/apache/drill/exec/store/sas/SasFormatConfig.java
@@ -22,17 +22,14 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
-
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
+import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.common.logical.FormatPluginConfig;
import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableList;
import java.util.Collections;
import java.util.List;
+import java.util.Objects;
-@EqualsAndHashCode
-@ToString
@JsonTypeName(SasFormatPlugin.DEFAULT_NAME)
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class SasFormatConfig implements FormatPluginConfig {
@@ -49,4 +46,27 @@ public class SasFormatConfig implements FormatPluginConfig {
return extensions;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ SasFormatConfig that = (SasFormatConfig) o;
+ return Objects.equals(extensions, that.extensions);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(extensions);
+ }
+
+ @Override
+ public String toString() {
+ return new PlanStringBuilder(this)
+ .field("extensions", extensions)
+ .toString();
+ }
}
diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpApiConfig.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpApiConfig.java
index 87298b6..09d6b2f 100644
--- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpApiConfig.java
+++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpApiConfig.java
@@ -22,35 +22,26 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import lombok.AccessLevel;
-import lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-import lombok.extern.slf4j.Slf4j;
import okhttp3.HttpUrl;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.common.exceptions.UserException;
import org.apache.drill.common.logical.security.CredentialsProvider;
import org.apache.drill.exec.store.security.CredentialProviderUtils;
import org.apache.drill.exec.store.security.UsernamePasswordCredentials;
import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
-@Slf4j
-@Builder
-@Getter
-@Accessors(fluent = true)
-@EqualsAndHashCode
-@ToString
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonDeserialize(builder = HttpApiConfig.HttpApiConfigBuilder.class)
public class HttpApiConfig {
+ private static final Logger logger = LoggerFactory.getLogger(HttpApiConfig.class);
protected static final String DEFAULT_INPUT_FORMAT = "json";
protected static final String CSV_INPUT_FORMAT = "csv";
@@ -111,14 +102,134 @@ public class HttpApiConfig {
@JsonInclude
@JsonProperty
private final boolean verifySSLCert;
- @Getter(AccessLevel.NONE)
private final CredentialsProvider credentialsProvider;
@JsonProperty
private final HttpPaginatorConfig paginator;
- @Getter(AccessLevel.NONE)
protected boolean directCredentials;
+ public static HttpApiConfigBuilder builder() {
+ return new HttpApiConfigBuilder();
+ }
+
+ public String url() {
+ return this.url;
+ }
+
+ public boolean requireTail() {
+ return this.requireTail;
+ }
+
+ public String method() {
+ return this.method;
+ }
+
+ public String postBody() {
+ return this.postBody;
+ }
+
+ public Map<String, String> headers() {
+ return this.headers;
+ }
+
+ public List<String> params() {
+ return this.params;
+ }
+
+ public String dataPath() {
+ return this.dataPath;
+ }
+
+ public String authType() {
+ return this.authType;
+ }
+
+ public String inputType() {
+ return this.inputType;
+ }
+
+ public int xmlDataLevel() {
+ return this.xmlDataLevel;
+ }
+
+ public String limitQueryParam() {
+ return this.limitQueryParam;
+ }
+
+ public boolean errorOn400() {
+ return this.errorOn400;
+ }
+
+ public HttpJsonOptions jsonOptions() {
+ return this.jsonOptions;
+ }
+
+ public boolean verifySSLCert() {
+ return this.verifySSLCert;
+ }
+
+ public HttpPaginatorConfig paginator() {
+ return this.paginator;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ HttpApiConfig that = (HttpApiConfig) o;
+ return requireTail == that.requireTail
+ && xmlDataLevel == that.xmlDataLevel
+ && errorOn400 == that.errorOn400
+ && verifySSLCert == that.verifySSLCert
+ && directCredentials == that.directCredentials
+ && Objects.equals(url, that.url)
+ && Objects.equals(method, that.method)
+ && Objects.equals(postBody, that.postBody)
+ && Objects.equals(headers, that.headers)
+ && Objects.equals(params, that.params)
+ && Objects.equals(dataPath, that.dataPath)
+ && Objects.equals(authType, that.authType)
+ && Objects.equals(inputType, that.inputType)
+ && Objects.equals(limitQueryParam, that.limitQueryParam)
+ && Objects.equals(jsonOptions, that.jsonOptions)
+ && Objects.equals(credentialsProvider, that.credentialsProvider)
+ && Objects.equals(paginator, that.paginator);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(url, requireTail, method, postBody, headers, params, dataPath,
+ authType, inputType, xmlDataLevel, limitQueryParam, errorOn400, jsonOptions, verifySSLCert,
+ credentialsProvider, paginator, directCredentials);
+ }
+
+ @Override
+ public String toString() {
+ return new PlanStringBuilder(this)
+ .field("url", url)
+ .field("requireTail", requireTail)
+ .field("method", method)
+ .field("postBody", postBody)
+ .field("headers", headers)
+ .field("params", params)
+ .field("dataPath", dataPath)
+ .field("authType", authType)
+ .field("inputType", inputType)
+ .field("xmlDataLevel", xmlDataLevel)
+ .field("limitQueryParam", limitQueryParam)
+ .field("errorOn400", errorOn400)
+ .field("jsonOptions", jsonOptions)
+ .field("verifySSLCert", verifySSLCert)
+ .field("credentialsProvider", credentialsProvider)
+ .field("paginator", paginator)
+ .field("directCredentials", directCredentials)
+ .toString();
+ }
+
public enum HttpMethod {
/**
* Value for HTTP GET method
@@ -222,28 +333,161 @@ public class HttpApiConfig {
@JsonPOJOBuilder(withPrefix = "")
public static class HttpApiConfigBuilder {
- @Getter
- @Setter
private String userName;
- @Getter
- @Setter
private String password;
- @Getter
- @Setter
private boolean requireTail = true;
- @Getter
- @Setter
private boolean verifySSLCert = true;
- @Getter
- @Setter
private String inputType = DEFAULT_INPUT_FORMAT;
+ private String url;
+
+ private String method;
+
+ private String postBody;
+
+ private Map<String, String> headers;
+
+ private List<String> params;
+
+ private String dataPath;
+
+ private String authType;
+
+ private int xmlDataLevel;
+
+ private String limitQueryParam;
+
+ private boolean errorOn400;
+
+ private HttpJsonOptions jsonOptions;
+
+ private CredentialsProvider credentialsProvider;
+
+ private HttpPaginatorConfig paginator;
+
+ private boolean directCredentials;
+
public HttpApiConfig build() {
return new HttpApiConfig(this);
}
+
+ public String userName() {
+ return this.userName;
+ }
+
+ public String password() {
+ return this.password;
+ }
+
+ public boolean requireTail() {
+ return this.requireTail;
+ }
+
+ public boolean verifySSLCert() {
+ return this.verifySSLCert;
+ }
+
+ public String inputType() {
+ return this.inputType;
+ }
+
+ public HttpApiConfigBuilder userName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public HttpApiConfigBuilder password(String password) {
+ this.password = password;
+ return this;
+ }
+
+ public HttpApiConfigBuilder requireTail(boolean requireTail) {
+ this.requireTail = requireTail;
+ return this;
+ }
+
+ public HttpApiConfigBuilder verifySSLCert(boolean verifySSLCert) {
+ this.verifySSLCert = verifySSLCert;
+ return this;
+ }
+
+ public HttpApiConfigBuilder inputType(String inputType) {
+ this.inputType = inputType;
+ return this;
+ }
+
+ public HttpApiConfigBuilder url(String url) {
+ this.url = url;
+ return this;
+ }
+
+ public HttpApiConfigBuilder method(String method) {
+ this.method = method;
+ return this;
+ }
+
+ public HttpApiConfigBuilder postBody(String postBody) {
+ this.postBody = postBody;
+ return this;
+ }
+
+ public HttpApiConfigBuilder headers(Map<String, String> headers) {
+ this.headers = headers;
+ return this;
+ }
+
+ public HttpApiConfigBuilder params(List<String> params) {
+ this.params = params;
+ return this;
+ }
+
+ public HttpApiConfigBuilder dataPath(String dataPath) {
+ this.dataPath = dataPath;
+ return this;
+ }
+
+ public HttpApiConfigBuilder authType(String authType) {
+ this.authType = authType;
+ return this;
+ }
+
+ public HttpApiConfigBuilder xmlDataLevel(int xmlDataLevel) {
+ this.xmlDataLevel = xmlDataLevel;
+ return this;
+ }
+
+ public HttpApiConfigBuilder limitQueryParam(String limitQueryParam) {
+ this.limitQueryParam = limitQueryParam;
+ return this;
+ }
+
+ public HttpApiConfigBuilder errorOn400(boolean errorOn400) {
+ this.errorOn400 = errorOn400;
+ return this;
+ }
+
+ public HttpApiConfigBuilder jsonOptions(HttpJsonOptions jsonOptions) {
+ this.jsonOptions = jsonOptions;
+ return this;
+ }
+
+ public HttpApiConfigBuilder credentialsProvider(CredentialsProvider credentialsProvider) {
+ this.credentialsProvider = credentialsProvider;
+ return this;
+ }
+
+ public HttpApiConfigBuilder paginator(HttpPaginatorConfig paginator) {
+ this.paginator = paginator;
+ return this;
+ }
+
+ public HttpApiConfigBuilder directCredentials(boolean directCredentials) {
+ this.directCredentials = directCredentials;
+ return this;
+ }
}
}
diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpJsonOptions.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpJsonOptions.java
index 0ca2b76..494852a 100644
--- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpJsonOptions.java
+++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpJsonOptions.java
@@ -20,22 +20,15 @@ package org.apache.drill.exec.store.http;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
-import lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-import lombok.extern.slf4j.Slf4j;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.exec.server.options.OptionSet;
import org.apache.drill.exec.store.easy.json.loader.JsonLoaderOptions;
-@Slf4j
-@Builder
-@Getter
-@Accessors(fluent = true)
-@EqualsAndHashCode
-@ToString
+import java.util.Objects;
+
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
+@JsonDeserialize(builder = HttpJsonOptions.HttpJsonOptionsBuilder.class)
public class HttpJsonOptions {
@JsonInclude
@@ -50,6 +43,17 @@ public class HttpJsonOptions {
@JsonInclude
private final Boolean enableEscapeAnyChar;
+ HttpJsonOptions(HttpJsonOptionsBuilder builder) {
+ this.allowNanInf = builder.allowNanInf;
+ this.allTextMode = builder.allTextMode;
+ this.readNumbersAsDouble = builder.readNumbersAsDouble;
+ this.enableEscapeAnyChar = builder.enableEscapeAnyChar;
+ }
+
+ public static HttpJsonOptionsBuilder builder() {
+ return new HttpJsonOptionsBuilder();
+ }
+
@JsonIgnore
public JsonLoaderOptions getJsonOptions(OptionSet optionSet) {
JsonLoaderOptions options = new JsonLoaderOptions(optionSet);
@@ -67,4 +71,84 @@ public class HttpJsonOptions {
}
return options;
}
+
+ public Boolean allowNanInf() {
+ return this.allowNanInf;
+ }
+
+ public Boolean allTextMode() {
+ return this.allTextMode;
+ }
+
+ public Boolean readNumbersAsDouble() {
+ return this.readNumbersAsDouble;
+ }
+
+ public Boolean enableEscapeAnyChar() {
+ return this.enableEscapeAnyChar;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ HttpJsonOptions that = (HttpJsonOptions) o;
+ return Objects.equals(allowNanInf, that.allowNanInf)
+ && Objects.equals(allTextMode, that.allTextMode)
+ && Objects.equals(readNumbersAsDouble, that.readNumbersAsDouble)
+ && Objects.equals(enableEscapeAnyChar, that.enableEscapeAnyChar);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(allowNanInf, allTextMode, readNumbersAsDouble, enableEscapeAnyChar);
+ }
+
+ @Override
+ public String toString() {
+ return new PlanStringBuilder(this)
+ .field("allowNanInf", allowNanInf)
+ .field("allTextMode", allTextMode)
+ .field("readNumbersAsDouble", readNumbersAsDouble)
+ .field("enableEscapeAnyChar", enableEscapeAnyChar)
+ .toString();
+ }
+
+ public static class HttpJsonOptionsBuilder {
+ private Boolean allowNanInf;
+
+ private Boolean allTextMode;
+
+ private Boolean readNumbersAsDouble;
+
+ private Boolean enableEscapeAnyChar;
+
+ public HttpJsonOptionsBuilder allowNanInf(Boolean allowNanInf) {
+ this.allowNanInf = allowNanInf;
+ return this;
+ }
+
+ public HttpJsonOptionsBuilder allTextMode(Boolean allTextMode) {
+ this.allTextMode = allTextMode;
+ return this;
+ }
+
+ public HttpJsonOptionsBuilder readNumbersAsDouble(Boolean readNumbersAsDouble) {
+ this.readNumbersAsDouble = readNumbersAsDouble;
+ return this;
+ }
+
+ public HttpJsonOptionsBuilder enableEscapeAnyChar(Boolean enableEscapeAnyChar) {
+ this.enableEscapeAnyChar = enableEscapeAnyChar;
+ return this;
+ }
+
+ public HttpJsonOptions build() {
+ return new HttpJsonOptions(this);
+ }
+ }
}
diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpPaginatorConfig.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpPaginatorConfig.java
index cbacff8..9c1a5b9 100644
--- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpPaginatorConfig.java
+++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpPaginatorConfig.java
@@ -23,29 +23,21 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
+import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.common.exceptions.UserException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Objects;
-@Slf4j
-@Builder
-@Getter
-@Accessors(fluent = true)
-@EqualsAndHashCode
-@ToString
-@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
@JsonDeserialize(builder = HttpPaginatorConfig.HttpPaginatorBuilder.class)
public class HttpPaginatorConfig {
+ private static final Logger logger = LoggerFactory.getLogger(HttpPaginatorConfig.class);
+
// For Offset Pagination
@JsonProperty
private final String limitParam;
@@ -69,6 +61,85 @@ public class HttpPaginatorConfig {
@JsonProperty
private final String method;
+ public HttpPaginatorConfig(HttpPaginatorConfigBuilder builder) {
+ this.limitParam = builder.limitParam;
+ this.offsetParam = builder.offsetParam;
+ this.pageParam = builder.pageParam;
+ this.pageSizeParam = builder.pageSizeParam;
+ this.pageSize = builder.pageSize;
+ this.maxRecords = builder.maxRecords;
+ this.method = builder.method;
+ }
+
+ public static HttpPaginatorConfigBuilder builder() {
+ return new HttpPaginatorConfigBuilder();
+ }
+
+ public String limitParam() {
+ return this.limitParam;
+ }
+
+ public String offsetParam() {
+ return this.offsetParam;
+ }
+
+ public String pageParam() {
+ return this.pageParam;
+ }
+
+ public String pageSizeParam() {
+ return this.pageSizeParam;
+ }
+
+ public int pageSize() {
+ return this.pageSize;
+ }
+
+ public int maxRecords() {
+ return this.maxRecords;
+ }
+
+ public String method() {
+ return this.method;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ HttpPaginatorConfig that = (HttpPaginatorConfig) o;
+ return pageSize == that.pageSize
+ && maxRecords == that.maxRecords
+ && Objects.equals(limitParam, that.limitParam)
+ && Objects.equals(offsetParam, that.offsetParam)
+ && Objects.equals(pageParam, that.pageParam)
+ && Objects.equals(pageSizeParam, that.pageSizeParam)
+ && Objects.equals(method, that.method);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(limitParam, offsetParam, pageParam, pageSizeParam,
+ pageSize, maxRecords, method);
+ }
+
+ @Override
+ public String toString() {
+ return new PlanStringBuilder(this)
+ .field("limitParam", limitParam)
+ .field("offsetParam", offsetParam)
+ .field("pageParam", pageParam)
+ .field("pageSizeParam", pageSizeParam)
+ .field("pageSize", pageSize)
+ .field("maxRecords", maxRecords)
+ .field("method", method)
+ .toString();
+ }
+
public enum PaginatorMethod {
OFFSET,
PAGE
@@ -133,36 +204,140 @@ public class HttpPaginatorConfig {
@JsonPOJOBuilder(withPrefix = "")
public static class HttpPaginatorBuilder {
- @Getter
- @Setter
public String limitParam;
- @Getter
- @Setter
public String offsetParam;
- @Getter
- @Setter
public int maxRecords;
- @Getter
- @Setter
public int pageSize;
- @Getter
- @Setter
public String pageParam;
- @Getter
- @Setter
public String pageSizeParam;
- @Getter
- @Setter
public String method;
public HttpPaginatorConfig build() {
return new HttpPaginatorConfig(this);
}
+
+ public String limitParam() {
+ return this.limitParam;
+ }
+
+ public String offsetParam() {
+ return this.offsetParam;
+ }
+
+ public int maxRecords() {
+ return this.maxRecords;
+ }
+
+ public int pageSize() {
+ return this.pageSize;
+ }
+
+ public String pageParam() {
+ return this.pageParam;
+ }
+
+ public String pageSizeParam() {
+ return this.pageSizeParam;
+ }
+
+ public String method() {
+ return this.method;
+ }
+
+ public HttpPaginatorBuilder limitParam(String limitParam) {
+ this.limitParam = limitParam;
+ return this;
+ }
+
+ public HttpPaginatorBuilder offsetParam(String offsetParam) {
+ this.offsetParam = offsetParam;
+ return this;
+ }
+
+ public HttpPaginatorBuilder maxRecords(int maxRecords) {
+ this.maxRecords = maxRecords;
+ return this;
+ }
+
+ public HttpPaginatorBuilder pageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ public HttpPaginatorBuilder pageParam(String pageParam) {
+ this.pageParam = pageParam;
+ return this;
+ }
+
+ public HttpPaginatorBuilder pageSizeParam(String pageSizeParam) {
+ this.pageSizeParam = pageSizeParam;
+ return this;
+ }
+
+ public HttpPaginatorBuilder method(String method) {
+ this.method = method;
+ return this;
+ }
+ }
+
+ public static class HttpPaginatorConfigBuilder {
+ private String limitParam;
+
+ private String offsetParam;
+
+ private String pageParam;
+
+ private String pageSizeParam;
+
+ private int pageSize;
+
+ private int maxRecords;
+
+ private String method;
+
+ public HttpPaginatorConfigBuilder limitParam(String limitParam) {
+ this.limitParam = limitParam;
+ return this;
+ }
+
+ public HttpPaginatorConfigBuilder offsetParam(String offsetParam) {
+ this.offsetParam = offsetParam;
+ return this;
+ }
+
+ public HttpPaginatorConfigBuilder pageParam(String pageParam) {
+ this.pageParam = pageParam;
+ return this;
+ }
+
+ public HttpPaginatorConfigBuilder pageSizeParam(String pageSizeParam) {
+ this.pageSizeParam = pageSizeParam;
+ return this;
+ }
+
+ public HttpPaginatorConfigBuilder pageSize(int pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ public HttpPaginatorConfigBuilder maxRecords(int maxRecords) {
+ this.maxRecords = maxRecords;
+ return this;
+ }
+
+ public HttpPaginatorConfigBuilder method(String method) {
+ this.method = method;
+ return this;
+ }
+
+ public HttpPaginatorConfig build() {
+ return new HttpPaginatorConfig(this);
+ }
}
}
diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpXMLBatchReader.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpXMLBatchReader.java
index 72cb805..8e0aa68 100644
--- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpXMLBatchReader.java
+++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/HttpXMLBatchReader.java
@@ -19,7 +19,6 @@
package org.apache.drill.exec.store.http;
-import lombok.extern.slf4j.Slf4j;
import okhttp3.HttpUrl;
import org.apache.drill.common.AutoCloseables;
import org.apache.drill.common.exceptions.ChildErrorContext;
@@ -33,13 +32,16 @@ import org.apache.drill.exec.store.ImplicitColumnUtils.ImplicitColumns;
import org.apache.drill.exec.store.http.paginator.Paginator;
import org.apache.drill.exec.store.http.util.SimpleHttp;
import org.apache.drill.exec.store.xml.XMLReader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.xml.stream.XMLStreamException;
import java.io.File;
import java.io.InputStream;
-@Slf4j
public class HttpXMLBatchReader extends HttpBatchReader {
+ private static final Logger logger = LoggerFactory.getLogger(HttpXMLBatchReader.class);
+
private final HttpSubScan subScan;
private final int maxRecords;
private final int dataLevel;
diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/oauth/AccessTokenAuthenticator.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/oauth/AccessTokenAuthenticator.java
index 9cca12b..0140313 100644
--- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/oauth/AccessTokenAuthenticator.java
+++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/oauth/AccessTokenAuthenticator.java
@@ -18,14 +18,12 @@
package org.apache.drill.exec.store.http.oauth;
-import lombok.NonNull;
import okhttp3.Authenticator;
import okhttp3.HttpUrl;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.Route;
import org.apache.commons.lang3.StringUtils;
-import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,7 +37,7 @@ public class AccessTokenAuthenticator implements Authenticator {
}
@Override
- public Request authenticate(Route route, @NotNull Response response) {
+ public Request authenticate(Route route, Response response) {
logger.debug("Authenticating {}", response.headers());
final String accessToken = accessTokenRepository.getAccessToken();
if (!isRequestWithAccessToken(response) || accessToken == null) {
@@ -59,13 +57,12 @@ public class AccessTokenAuthenticator implements Authenticator {
}
}
- private boolean isRequestWithAccessToken(@NonNull Response response) {
+ private boolean isRequestWithAccessToken(Response response) {
String header = response.request().header("Authorization");
return header != null && header.startsWith("Bearer");
}
- @NonNull
- private Request newRequestWithAccessToken(@NonNull Request request, @NonNull String accessToken) {
+ private Request newRequestWithAccessToken(Request request, String accessToken) {
logger.debug("Creating a new request with access token.");
String tokenType = accessTokenRepository.getTokenType();
if (StringUtils.isNotEmpty(tokenType)) {
diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/oauth/AccessTokenInterceptor.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/oauth/AccessTokenInterceptor.java
index cf9bb11..e2db176 100644
--- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/oauth/AccessTokenInterceptor.java
+++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/oauth/AccessTokenInterceptor.java
@@ -18,13 +18,11 @@
package org.apache.drill.exec.store.http.oauth;
-import lombok.NonNull;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
import org.apache.commons.lang3.StringUtils;
-import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,7 +43,6 @@ public class AccessTokenInterceptor implements Interceptor {
this.accessTokenRepository = accessTokenRepository;
}
- @NotNull
@Override
public Response intercept(Chain chain) throws IOException {
logger.debug("Intercepting call {}", chain.toString());
@@ -73,8 +70,7 @@ public class AccessTokenInterceptor implements Interceptor {
return response;
}
- @NonNull
- private Request newRequestWithAccessToken(@NonNull Request request, @NonNull String accessToken) {
+ private Request newRequestWithAccessToken(Request request, String accessToken) {
logger.debug("Interceptor making new request with access token: {}", request.url());
String tokenType = accessTokenRepository.getTokenType();
if (StringUtils.isNotEmpty(tokenType)) {
diff --git a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java
index b27a3c5..777f49d 100644
--- a/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java
+++ b/contrib/storage-http/src/main/java/org/apache/drill/exec/store/http/util/SimpleHttp.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.store.http.util;
-import lombok.extern.slf4j.Slf4j;
import okhttp3.Cache;
import okhttp3.Credentials;
import okhttp3.FormBody;
@@ -45,6 +44,8 @@ import org.apache.drill.exec.store.http.oauth.AccessTokenInterceptor;
import org.apache.drill.exec.store.http.oauth.AccessTokenRepository;
import org.apache.drill.exec.store.security.UsernamePasswordCredentials;
import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
@@ -75,8 +76,9 @@ import java.util.regex.Pattern;
* method is the getInputStream() method which accepts a url and opens an
* InputStream with that URL's contents.
*/
-@Slf4j
public class SimpleHttp {
+ private static final Logger logger = LoggerFactory.getLogger(SimpleHttp.class);
+
private static final Pattern URL_PARAM_REGEX = Pattern.compile("\\{(\\w+)(?:=(\\w*))?\\}");
private final OkHttpClient client;
@@ -94,7 +96,6 @@ public class SimpleHttp {
private String responseURL;
- @lombok.Builder
public SimpleHttp(HttpSubScan scanDefn, HttpUrl url, File tempDir,
HttpProxyConfig proxyConfig, CustomErrorContext errorContext, Paginator paginator) {
this.scanDefn = scanDefn;
@@ -108,6 +109,10 @@ public class SimpleHttp {
this.client = setupHttpClient();
}
+ public static SimpleHttpBuilder builder() {
+ return new SimpleHttpBuilder();
+ }
+
/**
* Configures the OkHTTP3 server object with configuration info from the user.
*
@@ -582,4 +587,52 @@ public class SimpleHttp {
return chain.proceed(authenticatedRequest);
}
}
+
+ public static class SimpleHttpBuilder {
+ private HttpSubScan scanDefn;
+
+ private HttpUrl url;
+
+ private File tempDir;
+
+ private HttpProxyConfig proxyConfig;
+
+ private CustomErrorContext errorContext;
+
+ private Paginator paginator;
+
+ public SimpleHttpBuilder scanDefn(HttpSubScan scanDefn) {
+ this.scanDefn = scanDefn;
+ return this;
+ }
+
+ public SimpleHttpBuilder url(HttpUrl url) {
+ this.url = url;
+ return this;
+ }
+
+ public SimpleHttpBuilder tempDir(File tempDir) {
+ this.tempDir = tempDir;
+ return this;
+ }
+
+ public SimpleHttpBuilder proxyConfig(HttpProxyConfig proxyConfig) {
+ this.proxyConfig = proxyConfig;
+ return this;
+ }
+
+ public SimpleHttpBuilder errorContext(CustomErrorContext errorContext) {
+ this.errorContext = errorContext;
+ return this;
+ }
+
+ public SimpleHttpBuilder paginator(Paginator paginator) {
+ this.paginator = paginator;
+ return this;
+ }
+
+ public SimpleHttp build() {
+ return new SimpleHttp(scanDefn, url, tempDir, proxyConfig, errorContext, paginator);
+ }
+ }
}
diff --git a/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcWriterField.java b/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcWriterField.java
index 3a215cd..2a3aba5 100644
--- a/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcWriterField.java
+++ b/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcWriterField.java
@@ -21,11 +21,7 @@ package org.apache.drill.exec.store.jdbc;
import com.fasterxml.jackson.annotation.JsonCreator;
import org.apache.drill.common.types.TypeProtos.DataMode;
import org.apache.drill.common.types.TypeProtos.MinorType;
-import lombok.Getter;
-import lombok.Setter;
-@Getter
-@Setter
public class JdbcWriterField {
private final MinorType dataType;
private final String fieldName;
@@ -37,4 +33,16 @@ public class JdbcWriterField {
this.fieldName = fieldName;
this.mode = mode;
}
+
+ public MinorType getDataType() {
+ return this.dataType;
+ }
+
+ public String getFieldName() {
+ return this.fieldName;
+ }
+
+ public DataMode getMode() {
+ return this.mode;
+ }
}
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/BaseMongoSubScanSpec.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/BaseMongoSubScanSpec.java
index bdf3286..6fff261 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/BaseMongoSubScanSpec.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/BaseMongoSubScanSpec.java
@@ -20,15 +20,9 @@ package org.apache.drill.exec.store.mongo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.SuperBuilder;
import java.util.List;
-@Getter
-@Setter
-@SuperBuilder
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(MongoSubScan.ShardedMongoSubScanSpec.class),
@@ -45,4 +39,46 @@ public class BaseMongoSubScanSpec {
@JsonProperty
private final List<String> hosts;
+ protected BaseMongoSubScanSpec(BaseMongoSubScanSpecBuilder<?> b) {
+ this.dbName = b.dbName;
+ this.collectionName = b.collectionName;
+ this.hosts = b.hosts;
+ }
+
+ public String getDbName() {
+ return this.dbName;
+ }
+
+ public String getCollectionName() {
+ return this.collectionName;
+ }
+
+ public List<String> getHosts() {
+ return this.hosts;
+ }
+
+ public static abstract class BaseMongoSubScanSpecBuilder<B extends BaseMongoSubScanSpecBuilder<B>> {
+ private String dbName;
+
+ private String collectionName;
+
+ private List<String> hosts;
+
+ public B dbName(String dbName) {
+ this.dbName = dbName;
+ return self();
+ }
+
+ public B collectionName(String collectionName) {
+ this.collectionName = collectionName;
+ return self();
+ }
+
+ public B hosts(List<String> hosts) {
+ this.hosts = hosts;
+ return self();
+ }
+
+ protected abstract B self();
+ }
}
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoFilterBuilder.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoFilterBuilder.java
index a463ad5..80fb796 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoFilterBuilder.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoFilterBuilder.java
@@ -17,9 +17,6 @@
*/
package org.apache.drill.exec.store.mongo;
-import java.util.List;
-
-import lombok.extern.slf4j.Slf4j;
import org.apache.drill.common.FunctionNames;
import org.apache.drill.common.expression.BooleanOperator;
import org.apache.drill.common.expression.FunctionCall;
@@ -28,12 +25,17 @@ import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.expression.visitors.AbstractExprVisitor;
import org.apache.drill.exec.store.mongo.common.MongoOp;
import org.bson.Document;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
-@Slf4j
public class MongoFilterBuilder extends
AbstractExprVisitor<Document, Void, RuntimeException> implements
DrillMongoConstants {
+ private static final Logger logger = LoggerFactory.getLogger(MongoFilterBuilder.class);
+
private final LogicalExpression le;
private boolean allExpressionsConverted = true;
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java
index 741d484..dc21f13 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoGroupScan.java
@@ -37,7 +37,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.mongodb.client.MongoClient;
-import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.common.exceptions.DrillRuntimeException;
@@ -73,8 +72,9 @@ import com.mongodb.client.FindIterable;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoCursor;
import com.mongodb.client.MongoDatabase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-@Slf4j
@JsonTypeName("mongo-scan")
public class MongoGroupScan extends AbstractGroupScan implements
DrillMongoConstants {
@@ -85,6 +85,8 @@ public class MongoGroupScan extends AbstractGroupScan implements
private static final Comparator<List<BaseMongoSubScanSpec>> LIST_SIZE_COMPARATOR_REV = Collections.reverseOrder(LIST_SIZE_COMPARATOR);
+ private static final Logger logger = LoggerFactory.getLogger(MongoGroupScan.class);
+
private MongoStoragePlugin storagePlugin;
private MongoStoragePluginConfig storagePluginConfig;
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoScanSpec.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoScanSpec.java
index a8de5c6..2c97785 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoScanSpec.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoScanSpec.java
@@ -19,16 +19,11 @@ package org.apache.drill.exec.store.mongo;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.ToString;
+import org.apache.drill.common.PlanStringBuilder;
import java.util.ArrayList;
import java.util.List;
-@AllArgsConstructor
-@Getter
-@ToString
public class MongoScanSpec {
private final String dbName;
private final String collectionName;
@@ -43,4 +38,37 @@ public class MongoScanSpec {
this.dbName = dbName;
this.collectionName = collectionName;
}
+
+ public MongoScanSpec(String dbName, String collectionName, String filters, List<String> operations) {
+ this.dbName = dbName;
+ this.collectionName = collectionName;
+ this.filters = filters;
+ this.operations = operations;
+ }
+
+ public String getDbName() {
+ return this.dbName;
+ }
+
+ public String getCollectionName() {
+ return this.collectionName;
+ }
+
+ public String getFilters() {
+ return this.filters;
+ }
+
+ public List<String> getOperations() {
+ return this.operations;
+ }
+
+ @Override
+ public String toString() {
+ return new PlanStringBuilder(this)
+ .field("dbName", dbName)
+ .field("collectionName", collectionName)
+ .field("filters", filters)
+ .field("operations", operations)
+ .toString();
+ }
}
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePluginConfig.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePluginConfig.java
index 385ade9..e803512 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePluginConfig.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoStoragePluginConfig.java
@@ -17,23 +17,20 @@
*/
package org.apache.drill.exec.store.mongo;
-import java.util.List;
-
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.mongodb.ConnectionString;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.drill.common.logical.AbstractSecuredStoragePluginConfig;
import org.apache.drill.common.logical.security.CredentialsProvider;
import org.apache.drill.common.logical.security.PlainCredentialsProvider;
+import java.util.List;
+import java.util.Objects;
+
@JsonTypeName(MongoStoragePluginConfig.NAME)
-@EqualsAndHashCode(of = "connection", callSuper = false)
public class MongoStoragePluginConfig extends AbstractSecuredStoragePluginConfig {
public static final String NAME = "mongo";
@@ -89,8 +86,23 @@ public class MongoStoragePluginConfig extends AbstractSecuredStoragePluginConfig
return credentialsProvider != null ? credentialsProvider : PlainCredentialsProvider.EMPTY_CREDENTIALS_PROVIDER;
}
- @Getter
- @Setter
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ MongoStoragePluginConfig that = (MongoStoragePluginConfig) o;
+ return Objects.equals(connection, that.connection);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(connection);
+ }
+
public static class MongoPluginOptimizations {
private boolean supportsProjectPushdown = true;
@@ -104,5 +116,53 @@ public class MongoStoragePluginConfig extends AbstractSecuredStoragePluginConfig
private boolean supportsUnionPushdown = true;
private boolean supportsLimitPushdown = true;
+
+ public boolean isSupportsProjectPushdown() {
+ return this.supportsProjectPushdown;
+ }
+
+ public boolean isSupportsFilterPushdown() {
+ return this.supportsFilterPushdown;
+ }
+
+ public boolean isSupportsAggregatePushdown() {
+ return this.supportsAggregatePushdown;
+ }
+
+ public boolean isSupportsSortPushdown() {
+ return this.supportsSortPushdown;
+ }
+
+ public boolean isSupportsUnionPushdown() {
+ return this.supportsUnionPushdown;
+ }
+
+ public boolean isSupportsLimitPushdown() {
+ return this.supportsLimitPushdown;
+ }
+
+ public void setSupportsProjectPushdown(boolean supportsProjectPushdown) {
+ this.supportsProjectPushdown = supportsProjectPushdown;
+ }
+
+ public void setSupportsFilterPushdown(boolean supportsFilterPushdown) {
+ this.supportsFilterPushdown = supportsFilterPushdown;
+ }
+
+ public void setSupportsAggregatePushdown(boolean supportsAggregatePushdown) {
+ this.supportsAggregatePushdown = supportsAggregatePushdown;
+ }
+
+ public void setSupportsSortPushdown(boolean supportsSortPushdown) {
+ this.supportsSortPushdown = supportsSortPushdown;
+ }
+
+ public void setSupportsUnionPushdown(boolean supportsUnionPushdown) {
+ this.supportsUnionPushdown = supportsUnionPushdown;
+ }
+
+ public void setSupportsLimitPushdown(boolean supportsLimitPushdown) {
+ this.supportsLimitPushdown = supportsLimitPushdown;
+ }
}
}
diff --git a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoSubScan.java b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoSubScan.java
index 25d852a..1bac657 100644
--- a/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoSubScan.java
+++ b/contrib/storage-mongo/src/main/java/org/apache/drill/exec/store/mongo/MongoSubScan.java
@@ -23,10 +23,9 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import lombok.Getter;
-import lombok.ToString;
-import lombok.experimental.SuperBuilder;
-import lombok.extern.jackson.Jacksonized;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
+import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.common.expression.SchemaPath;
import org.apache.drill.common.logical.StoragePluginConfig;
import org.apache.drill.exec.physical.base.AbstractBase;
@@ -116,10 +115,7 @@ public class MongoSubScan extends AbstractBase implements SubScan {
return Collections.emptyIterator();
}
- @Getter
- @ToString
- @Jacksonized
- @SuperBuilder
+ @JsonDeserialize(builder=ShardedMongoSubScanSpec.ShardedMongoSubScanSpecBuilder.class)
public static class ShardedMongoSubScanSpec extends BaseMongoSubScanSpec {
@JsonProperty
@@ -131,17 +127,122 @@ public class MongoSubScan extends AbstractBase implements SubScan {
@JsonProperty
private final String filter;
+ protected ShardedMongoSubScanSpec(ShardedMongoSubScanSpecBuilder b) {
+ super(b);
+ this.minFilters = b.minFilters;
+ this.maxFilters = b.maxFilters;
+ this.filter = b.filter;
+ }
+
+ public static ShardedMongoSubScanSpecBuilder builder() {
+ return new ShardedMongoSubScanSpecBuilder();
+ }
+
+ public Map<String, Object> getMinFilters() {
+ return this.minFilters;
+ }
+
+ public Map<String, Object> getMaxFilters() {
+ return this.maxFilters;
+ }
+
+ public String getFilter() {
+ return this.filter;
+ }
+
+ @Override
+ public String toString() {
+ return new PlanStringBuilder(this)
+ .field("bName", getDbName())
+ .field("collectionName", getCollectionName())
+ .field("hosts", getHosts())
+ .field("minFilters", minFilters)
+ .field("maxFilters", maxFilters)
+ .field("filter", filter)
+ .toString();
+ }
+
+ @JsonPOJOBuilder(withPrefix = "")
+ public static class ShardedMongoSubScanSpecBuilder extends BaseMongoSubScanSpecBuilder<ShardedMongoSubScanSpecBuilder> {
+ private Map<String, Object> minFilters;
+
+ private Map<String, Object> maxFilters;
+
+ private String filter;
+
+ public ShardedMongoSubScanSpecBuilder minFilters(Map<String, Object> minFilters) {
+ this.minFilters = minFilters;
+ return self();
+ }
+
+ public ShardedMongoSubScanSpecBuilder maxFilters(Map<String, Object> maxFilters) {
+ this.maxFilters = maxFilters;
+ return self();
+ }
+
+ public ShardedMongoSubScanSpecBuilder filter(String filter) {
+ this.filter = filter;
+ return self();
+ }
+
+ @Override
+ public ShardedMongoSubScanSpecBuilder self() {
+ return this;
+ }
+
+ public ShardedMongoSubScanSpec build() {
+ return new ShardedMongoSubScanSpec(this);
+ }
+ }
}
- @Getter
- @ToString
- @Jacksonized
- @SuperBuilder
+ @JsonDeserialize(builder=MongoSubScanSpec.MongoSubScanSpecBuilder.class)
public static class MongoSubScanSpec extends BaseMongoSubScanSpec {
@JsonProperty
private final List<String> operations;
+ protected MongoSubScanSpec(MongoSubScanSpecBuilder b) {
+ super(b);
+ this.operations = b.operations;
+ }
+
+ public static MongoSubScanSpecBuilder builder() {
+ return new MongoSubScanSpecBuilder();
+ }
+
+ public List<String> getOperations() {
+ return this.operations;
+ }
+
+ @Override
+ public String toString() {
+ return new PlanStringBuilder(this)
+ .field("bName", getDbName())
+ .field("collectionName", getCollectionName())
+ .field("hosts", getHosts())
+ .field("operations", operations)
+ .toString();
+ }
+
+ @JsonPOJOBuilder(withPrefix = "")
+ public static class MongoSubScanSpecBuilder extends BaseMongoSubScanSpecBuilder<MongoSubScanSpecBuilder> {
+ private List<String> operations;
+
+ public MongoSubScanSpecBuilder operations(List<String> operations) {
+ this.operations = operations;
+ return self();
+ }
+
+ @Override
+ protected MongoSubScanSpecBuilder self() {
+ return this;
+ }
+
+ public MongoSubScanSpec build() {
+ return new MongoSubScanSpec(this);
+ }
+ }
}
}
diff --git a/contrib/storage-phoenix/src/main/java/org/apache/drill/exec/store/phoenix/PhoenixDataSource.java b/contrib/storage-phoenix/src/main/java/org/apache/drill/exec/store/phoenix/PhoenixDataSource.java
index ed8c670..b89a530 100644
--- a/contrib/storage-phoenix/src/main/java/org/apache/drill/exec/store/phoenix/PhoenixDataSource.java
+++ b/contrib/storage-phoenix/src/main/java/org/apache/drill/exec/store/phoenix/PhoenixDataSource.java
@@ -27,9 +27,9 @@ import java.util.logging.Logger;
import javax.sql.DataSource;
-import lombok.extern.slf4j.Slf4j;
import org.apache.drill.common.exceptions.UserException;
import org.apache.drill.shaded.guava.com.google.common.base.Preconditions;
+import org.slf4j.LoggerFactory;
/**
* Phoenix’s Connection objects are different from most other JDBC Connections
@@ -40,8 +40,8 @@ import org.apache.drill.shaded.guava.com.google.common.base.Preconditions;
* is not always left in a healthy state by the previous user. It is better to
* create new Phoenix Connections to ensure that you avoid any potential issues.
*/
-@Slf4j
public class PhoenixDataSource implements DataSource {
+ private static final org.slf4j.Logger logger = LoggerFactory.getLogger(PhoenixDataSource.class);
private static final String DEFAULT_URL_HEADER = "jdbc:phoenix:thin:url=http://";
private static final String DEFAULT_SERIALIZATION = "serialization=PROTOBUF";
diff --git a/contrib/storage-phoenix/src/test/java/org/apache/drill/exec/store/phoenix/secured/SecuredPhoenixBaseTest.java b/contrib/storage-phoenix/src/test/java/org/apache/drill/exec/store/phoenix/secured/SecuredPhoenixBaseTest.java
index bf541a9..a490f44 100644
--- a/contrib/storage-phoenix/src/test/java/org/apache/drill/exec/store/phoenix/secured/SecuredPhoenixBaseTest.java
+++ b/contrib/storage-phoenix/src/test/java/org/apache/drill/exec/store/phoenix/secured/SecuredPhoenixBaseTest.java
@@ -19,7 +19,6 @@ package org.apache.drill.exec.store.phoenix.secured;
import ch.qos.logback.classic.Level;
import com.sun.security.auth.module.Krb5LoginModule;
-import lombok.extern.slf4j.Slf4j;
import org.apache.drill.common.config.DrillProperties;
import org.apache.drill.common.exceptions.UserRemoteException;
import org.apache.drill.exec.ExecConstants;
@@ -27,6 +26,7 @@ import org.apache.drill.exec.rpc.security.ServerAuthenticationHandler;
import org.apache.drill.exec.rpc.security.kerberos.KerberosFactory;
import org.apache.drill.exec.rpc.user.security.testing.UserAuthenticatorTestImpl;
import org.apache.drill.exec.store.StoragePluginRegistry;
+import org.apache.drill.exec.store.phoenix.PhoenixDataSource;
import org.apache.drill.exec.store.phoenix.PhoenixStoragePluginConfig;
import org.apache.drill.exec.util.ImpersonationUtil;
import org.apache.drill.shaded.guava.com.google.common.collect.Lists;
@@ -40,6 +40,8 @@ import org.apache.phoenix.queryserver.server.QueryServer;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.File;
import java.nio.file.Paths;
@@ -60,8 +62,9 @@ import static org.apache.drill.exec.store.phoenix.secured.HttpParamImpersonation
import static org.apache.drill.exec.store.phoenix.secured.HttpParamImpersonationQueryServerIT.grantUsersToPhoenixSystemTables;
import static org.apache.drill.exec.store.phoenix.secured.SecuredPhoenixTestSuite.initPhoenixQueryServer;
-@Slf4j
public abstract class SecuredPhoenixBaseTest extends ClusterTest {
+ private static final Logger logger = LoggerFactory.getLogger(PhoenixDataSource.class);
+
protected static LogFixture logFixture;
private final static Level CURRENT_LOG_LEVEL = Level.INFO;
diff --git a/distribution/src/assemble/component.xml b/distribution/src/assemble/component.xml
index 9aa9c3f..4031c50 100644
--- a/distribution/src/assemble/component.xml
+++ b/distribution/src/assemble/component.xml
@@ -141,7 +141,6 @@
<exclude>org.apache.drill.contrib.storage-hive</exclude>
<exclude>org.apache.drill.memory</exclude>
<exclude>org.apache.drill.metastore</exclude>
- <exclude>org.projectlombok:lombok</exclude>
<exclude>org.junit.jupiter:*:jar</exclude>
<exclude>org.junit.platform:*:jar</exclude>
<exclude>org.junit.vintage:*:jar</exclude>
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/alias/ResolvedAliases.java b/exec/java-exec/src/main/java/org/apache/drill/exec/alias/ResolvedAliases.java
index 549ca5c..35021c1 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/alias/ResolvedAliases.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/alias/ResolvedAliases.java
@@ -17,8 +17,6 @@
*/
package org.apache.drill.exec.alias;
-import lombok.AllArgsConstructor;
-
import java.util.Iterator;
import java.util.Map;
import java.util.function.Supplier;
@@ -27,12 +25,16 @@ import java.util.function.Supplier;
* Aliases table that fallback user aliases calls to public aliases
* if alias not found in user aliases table.
*/
-@AllArgsConstructor
public class ResolvedAliases implements Aliases {
private final Aliases userAliases;
private final Supplier<Aliases> publicAliases;
+ public ResolvedAliases(Aliases userAliases, Supplier<Aliases> publicAliases) {
+ this.userAliases = userAliases;
+ this.publicAliases = publicAliases;
+ }
+
@Override
public String getKey() {
return userAliases.getKey();
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/BaseAliasHandler.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/BaseAliasHandler.java
index a5e6663..8f3d86f 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/BaseAliasHandler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/BaseAliasHandler.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.planner.sql.handlers;
-import lombok.extern.slf4j.Slf4j;
import org.apache.calcite.sql.SqlLiteral;
import org.apache.calcite.sql.SqlNode;
import org.apache.drill.common.exceptions.UserException;
@@ -26,12 +25,15 @@ import org.apache.drill.exec.alias.AliasRegistry;
import org.apache.drill.exec.alias.AliasTarget;
import org.apache.drill.exec.server.options.QueryOptionManager;
import org.apache.drill.exec.util.ImpersonationUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.Optional;
-@Slf4j
public class BaseAliasHandler extends DefaultSqlHandler {
+ private static final Logger logger = LoggerFactory.getLogger(BaseAliasHandler.class);
+
public BaseAliasHandler(SqlHandlerConfig config) {
super(config);
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateAliasHandler.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateAliasHandler.java
index 395ed53..992a4ae 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateAliasHandler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateAliasHandler.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.planner.sql.handlers;
-import lombok.extern.slf4j.Slf4j;
import org.apache.calcite.sql.SqlLiteral;
import org.apache.calcite.sql.SqlNode;
import org.apache.commons.lang3.StringUtils;
@@ -31,6 +30,8 @@ import org.apache.drill.exec.planner.sql.DirectPlan;
import org.apache.drill.exec.planner.sql.SchemaUtilites;
import org.apache.drill.exec.planner.sql.parser.SqlCreateAlias;
import org.apache.drill.exec.work.foreman.ForemanSetupException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.List;
@@ -39,9 +40,10 @@ import java.util.Locale;
/**
* Handler for handling CREATE ALIAS statements.
*/
-@Slf4j
public class CreateAliasHandler extends BaseAliasHandler {
+ private static final Logger logger = LoggerFactory.getLogger(CreateAliasHandler.class);
+
public CreateAliasHandler(SqlHandlerConfig config) {
super(config);
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropAliasHandler.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropAliasHandler.java
index b9873d3..a957b81 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropAliasHandler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropAliasHandler.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.planner.sql.handlers;
-import lombok.extern.slf4j.Slf4j;
import org.apache.calcite.sql.SqlLiteral;
import org.apache.calcite.sql.SqlNode;
import org.apache.commons.lang3.StringUtils;
@@ -29,6 +28,8 @@ import org.apache.drill.exec.physical.PhysicalPlan;
import org.apache.drill.exec.planner.sql.DirectPlan;
import org.apache.drill.exec.planner.sql.parser.SqlDropAlias;
import org.apache.drill.exec.work.foreman.ForemanSetupException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Locale;
@@ -36,9 +37,10 @@ import java.util.Locale;
/**
* Handler for handling DROP ALIAS statements.
*/
-@Slf4j
public class DropAliasHandler extends BaseAliasHandler {
+ private static final Logger logger = LoggerFactory.getLogger(DropAliasHandler.class);
+
public DropAliasHandler(SqlHandlerConfig config) {
super(config);
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropAllAliasesHandler.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropAllAliasesHandler.java
index fafc4f1..901f14a 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropAllAliasesHandler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/DropAllAliasesHandler.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.planner.sql.handlers;
-import lombok.extern.slf4j.Slf4j;
import org.apache.calcite.sql.SqlLiteral;
import org.apache.calcite.sql.SqlNode;
import org.apache.commons.lang3.StringUtils;
@@ -27,6 +26,8 @@ import org.apache.drill.exec.physical.PhysicalPlan;
import org.apache.drill.exec.planner.sql.DirectPlan;
import org.apache.drill.exec.planner.sql.parser.SqlDropAllAliases;
import org.apache.drill.exec.work.foreman.ForemanSetupException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Locale;
@@ -34,9 +35,10 @@ import java.util.Locale;
/**
* Handler for handling DROP ALL ALIASES statements.
*/
-@Slf4j
public class DropAllAliasesHandler extends BaseAliasHandler {
+ private static final Logger logger = LoggerFactory.getLogger(DropAllAliasesHandler.class);
+
public DropAllAliasesHandler(SqlHandlerConfig config) {
super(config);
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateAlias.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateAlias.java
index 6673c3b..1c0ffd7 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateAlias.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlCreateAlias.java
@@ -17,9 +17,6 @@
*/
package org.apache.drill.exec.planner.sql.parser;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.val;
import org.apache.calcite.sql.SqlCall;
import org.apache.calcite.sql.SqlIdentifier;
import org.apache.calcite.sql.SqlKind;
@@ -36,7 +33,6 @@ import org.apache.drill.exec.planner.sql.handlers.SqlHandlerConfig;
import java.util.ArrayList;
import java.util.List;
-@Getter
public class SqlCreateAlias extends DrillSqlCall {
private final SqlIdentifier alias;
@@ -61,16 +57,18 @@ public class SqlCreateAlias extends DrillSqlCall {
}
};
- @Builder
- private SqlCreateAlias(SqlParserPos pos, SqlIdentifier alias, SqlIdentifier source,
- SqlNode replace, SqlNode isPublic, SqlNode aliasKind, SqlNode user) {
- super(pos);
- this.alias = alias;
- this.source = source;
- this.replace = replace;
- this.isPublic = isPublic;
- this.aliasKind = aliasKind;
- this.user = user;
+ private SqlCreateAlias(SqlCreateAliasBuilder builder) {
+ super(builder.pos);
+ this.alias = builder.alias;
+ this.source = builder.source;
+ this.replace = builder.replace;
+ this.isPublic = builder.isPublic;
+ this.aliasKind = builder.aliasKind;
+ this.user = builder.user;
+ }
+
+ public static SqlCreateAliasBuilder builder() {
+ return new SqlCreateAliasBuilder();
}
@Override
@@ -80,7 +78,7 @@ public class SqlCreateAlias extends DrillSqlCall {
@Override
public List<SqlNode> getOperandList() {
- val opList = new ArrayList<SqlNode>();
+ List<SqlNode> opList = new ArrayList<>();
opList.add(alias);
opList.add(source);
opList.add(aliasKind);
@@ -119,4 +117,82 @@ public class SqlCreateAlias extends DrillSqlCall {
return new CreateAliasHandler(config);
}
+ public SqlIdentifier getAlias() {
+ return this.alias;
+ }
+
+ public SqlIdentifier getSource() {
+ return this.source;
+ }
+
+ public SqlNode getAliasKind() {
+ return this.aliasKind;
+ }
+
+ public SqlNode getReplace() {
+ return this.replace;
+ }
+
+ public SqlNode getIsPublic() {
+ return this.isPublic;
+ }
+
+ public SqlNode getUser() {
+ return this.user;
+ }
+
+ public static class SqlCreateAliasBuilder {
+ private SqlParserPos pos;
+
+ private SqlIdentifier alias;
+
+ private SqlIdentifier source;
+
+ private SqlNode replace;
+
+ private SqlNode isPublic;
+
+ private SqlNode aliasKind;
+
+ private SqlNode user;
+
+ public SqlCreateAliasBuilder pos(SqlParserPos pos) {
+ this.pos = pos;
+ return this;
+ }
+
+ public SqlCreateAliasBuilder alias(SqlIdentifier alias) {
+ this.alias = alias;
+ return this;
+ }
+
+ public SqlCreateAliasBuilder source(SqlIdentifier source) {
+ this.source = source;
+ return this;
+ }
+
+ public SqlCreateAliasBuilder replace(SqlNode replace) {
+ this.replace = replace;
+ return this;
+ }
+
+ public SqlCreateAliasBuilder isPublic(SqlNode isPublic) {
+ this.isPublic = isPublic;
+ return this;
+ }
+
+ public SqlCreateAliasBuilder aliasKind(SqlNode aliasKind) {
+ this.aliasKind = aliasKind;
+ return this;
+ }
+
+ public SqlCreateAliasBuilder user(SqlNode user) {
+ this.user = user;
+ return this;
+ }
+
+ public SqlCreateAlias build() {
+ return new SqlCreateAlias(this);
+ }
+ }
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlDropAlias.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlDropAlias.java
index 8694864..b3558b9 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlDropAlias.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlDropAlias.java
@@ -17,9 +17,6 @@
*/
package org.apache.drill.exec.planner.sql.parser;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.val;
import org.apache.calcite.sql.SqlCall;
import org.apache.calcite.sql.SqlIdentifier;
import org.apache.calcite.sql.SqlKind;
@@ -36,7 +33,6 @@ import org.apache.drill.exec.planner.sql.handlers.SqlHandlerConfig;
import java.util.ArrayList;
import java.util.List;
-@Getter
public class SqlDropAlias extends DrillSqlCall {
private final SqlNode isPublic;
@@ -59,15 +55,17 @@ public class SqlDropAlias extends DrillSqlCall {
}
};
- @Builder
- private SqlDropAlias(SqlParserPos pos, SqlIdentifier alias,
- SqlNode ifExists, SqlNode isPublic, SqlNode aliasKind, SqlNode user) {
- super(pos);
- this.alias = alias;
- this.ifExists = ifExists;
- this.isPublic = isPublic;
- this.aliasKind = aliasKind;
- this.user = user;
+ private SqlDropAlias(SqlDropAliasBuilder builder) {
+ super(builder.pos);
+ this.alias = builder.alias;
+ this.ifExists = builder.ifExists;
+ this.isPublic = builder.isPublic;
+ this.aliasKind = builder.aliasKind;
+ this.user = builder.user;
+ }
+
+ public static SqlDropAliasBuilder builder() {
+ return new SqlDropAliasBuilder();
}
@Override
@@ -77,7 +75,7 @@ public class SqlDropAlias extends DrillSqlCall {
@Override
public List<SqlNode> getOperandList() {
- val opList = new ArrayList<SqlNode>();
+ List<SqlNode> opList = new ArrayList<>();
opList.add(alias);
opList.add(aliasKind);
opList.add(ifExists);
@@ -113,4 +111,72 @@ public class SqlDropAlias extends DrillSqlCall {
public AbstractSqlHandler getSqlHandler(SqlHandlerConfig config) {
return new DropAliasHandler(config);
}
+
+ public SqlNode getIsPublic() {
+ return this.isPublic;
+ }
+
+ public SqlNode getIfExists() {
+ return this.ifExists;
+ }
+
+ public SqlIdentifier getAlias() {
+ return this.alias;
+ }
+
+ public SqlNode getAliasKind() {
+ return this.aliasKind;
+ }
+
+ public SqlNode getUser() {
+ return this.user;
+ }
+
+ public static class SqlDropAliasBuilder {
+ private SqlParserPos pos;
+
+ private SqlIdentifier alias;
+
+ private SqlNode ifExists;
+
+ private SqlNode isPublic;
+
+ private SqlNode aliasKind;
+
+ private SqlNode user;
+
+ public SqlDropAliasBuilder pos(SqlParserPos pos) {
+ this.pos = pos;
+ return this;
+ }
+
+ public SqlDropAliasBuilder alias(SqlIdentifier alias) {
+ this.alias = alias;
+ return this;
+ }
+
+ public SqlDropAliasBuilder ifExists(SqlNode ifExists) {
+ this.ifExists = ifExists;
+ return this;
+ }
+
+ public SqlDropAliasBuilder isPublic(SqlNode isPublic) {
+ this.isPublic = isPublic;
+ return this;
+ }
+
+ public SqlDropAliasBuilder aliasKind(SqlNode aliasKind) {
+ this.aliasKind = aliasKind;
+ return this;
+ }
+
+ public SqlDropAliasBuilder user(SqlNode user) {
+ this.user = user;
+ return this;
+ }
+
+ public SqlDropAlias build() {
+ return new SqlDropAlias(this);
+ }
+ }
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlDropAllAliases.java b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlDropAllAliases.java
index 1bff34b..06b0ae7 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlDropAllAliases.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/parser/SqlDropAllAliases.java
@@ -17,9 +17,6 @@
*/
package org.apache.drill.exec.planner.sql.parser;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.val;
import org.apache.calcite.sql.SqlCall;
import org.apache.calcite.sql.SqlKind;
import org.apache.calcite.sql.SqlLiteral;
@@ -35,7 +32,6 @@ import org.apache.drill.exec.planner.sql.handlers.SqlHandlerConfig;
import java.util.ArrayList;
import java.util.List;
-@Getter
public class SqlDropAllAliases extends DrillSqlCall {
private final SqlNode isPublic;
@@ -54,12 +50,15 @@ public class SqlDropAllAliases extends DrillSqlCall {
}
};
- @Builder
- private SqlDropAllAliases(SqlParserPos pos, SqlNode isPublic, SqlNode aliasKind, SqlNode user) {
- super(pos);
- this.isPublic = isPublic;
- this.aliasKind = aliasKind;
- this.user = user;
+ private SqlDropAllAliases(SqlDropAllAliasesBuilder builder) {
+ super(builder.pos);
+ this.isPublic = builder.isPublic;
+ this.aliasKind = builder.aliasKind;
+ this.user = builder.user;
+ }
+
+ public static SqlDropAllAliasesBuilder builder() {
+ return new SqlDropAllAliasesBuilder();
}
@Override
@@ -69,7 +68,7 @@ public class SqlDropAllAliases extends DrillSqlCall {
@Override
public List<SqlNode> getOperandList() {
- val opList = new ArrayList<SqlNode>();
+ List<SqlNode> opList = new ArrayList<>();
opList.add(aliasKind);
opList.add(isPublic);
opList.add(user);
@@ -99,4 +98,50 @@ public class SqlDropAllAliases extends DrillSqlCall {
public AbstractSqlHandler getSqlHandler(SqlHandlerConfig config) {
return new DropAllAliasesHandler(config);
}
+
+ public SqlNode getIsPublic() {
+ return this.isPublic;
+ }
+
+ public SqlNode getAliasKind() {
+ return this.aliasKind;
+ }
+
+ public SqlNode getUser() {
+ return this.user;
+ }
+
+ public static class SqlDropAllAliasesBuilder {
+ private SqlParserPos pos;
+
+ private SqlNode isPublic;
+
+ private SqlNode aliasKind;
+
+ private SqlNode user;
+
+ public SqlDropAllAliasesBuilder pos(SqlParserPos pos) {
+ this.pos = pos;
+ return this;
+ }
+
+ public SqlDropAllAliasesBuilder isPublic(SqlNode isPublic) {
+ this.isPublic = isPublic;
+ return this;
+ }
+
+ public SqlDropAllAliasesBuilder aliasKind(SqlNode aliasKind) {
+ this.aliasKind = aliasKind;
+ return this;
+ }
+
+ public SqlDropAllAliasesBuilder user(SqlNode user) {
+ this.user = user;
+ return this;
+ }
+
+ public SqlDropAllAliases build() {
+ return new SqlDropAllAliases(this);
+ }
+ }
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/VaultUserAuthenticator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/VaultUserAuthenticator.java
index a7e94ef..6343bab 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/VaultUserAuthenticator.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/security/VaultUserAuthenticator.java
@@ -17,28 +17,26 @@
*/
package org.apache.drill.exec.rpc.user.security;
-import com.bettercloud.vault.response.LookupResponse;
import com.bettercloud.vault.Vault;
import com.bettercloud.vault.VaultConfig;
import com.bettercloud.vault.VaultException;
+import com.bettercloud.vault.response.LookupResponse;
import org.apache.drill.common.config.DrillConfig;
import org.apache.drill.exec.exception.DrillbitStartupException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Objects;
-import lombok.EqualsAndHashCode;
-import lombok.extern.slf4j.Slf4j;
-
/**
* Implement {@link org.apache.drill.exec.rpc.user.security.UserAuthenticator}
* based on HashiCorp Vault. Configure the Vault client using the Drill BOOT
* options that appear below.
*/
-@Slf4j
-@EqualsAndHashCode
@UserAuthenticatorTemplate(type = "vault")
public class VaultUserAuthenticator implements UserAuthenticator {
+ private static final Logger logger = LoggerFactory.getLogger(VaultUserAuthenticator.class);
// Drill boot options used to configure Vault auth.
public static final String VAULT_ADDRESS = "drill.exec.security.user.auth.vault.address";
@@ -200,4 +198,23 @@ public class VaultUserAuthenticator implements UserAuthenticator {
this.vault = null;
logger.debug("Has been closed.");
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ VaultUserAuthenticator that = (VaultUserAuthenticator) o;
+ return Objects.equals(vaultConfig, that.vaultConfig)
+ && Objects.equals(vault, that.vault)
+ && authMethod == that.authMethod;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(vaultConfig, vault, authMethod);
+ }
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/enumerable/EnumerableRecordReader.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/enumerable/EnumerableRecordReader.java
index 8a86591..85ea7c4 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/enumerable/EnumerableRecordReader.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/enumerable/EnumerableRecordReader.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.store.enumerable;
-import lombok.extern.slf4j.Slf4j;
import org.apache.calcite.DataContext;
import org.apache.calcite.jdbc.JavaTypeFactoryImpl;
import org.apache.calcite.schema.SchemaPlus;
@@ -38,6 +37,8 @@ import org.apache.drill.exec.record.metadata.TupleMetadata;
import org.apache.drill.exec.record.metadata.TupleSchema;
import org.apache.drill.shaded.guava.com.google.common.base.Throwables;
import org.codehaus.commons.compiler.CompileException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Collections;
@@ -51,9 +52,10 @@ import java.util.stream.StreamSupport;
* {@link ManagedReader} implementation that compiles and executes specified code,
* calls the method on it for obtaining the values, and reads the results using column converters.
*/
-@Slf4j
public class EnumerableRecordReader implements ManagedReader<SchemaNegotiator> {
+ private static final Logger logger = LoggerFactory.getLogger(EnumerableRecordReader.class);
+
private static final String CLASS_NAME = "Baz";
private final List<SchemaPath> columns;
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatConfig.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatConfig.java
index 4367dc7..5dc1e0b 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatConfig.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFormatConfig.java
@@ -20,17 +20,12 @@ package org.apache.drill.exec.store.parquet;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
-
-import lombok.Builder;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-
+import com.fasterxml.jackson.annotation.JsonTypeName;
import org.apache.drill.common.PlanStringBuilder;
import org.apache.drill.common.logical.FormatPluginConfig;
-import com.fasterxml.jackson.annotation.JsonTypeName;
+import java.util.Objects;
-@EqualsAndHashCode
@JsonTypeName("parquet") @JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class ParquetFormatConfig implements FormatPluginConfig {
@@ -47,7 +42,7 @@ public class ParquetFormatConfig implements FormatPluginConfig {
* old format and automatically shift the corrupted values into corrected
* ones automatically.
*/
- @Getter private final boolean autoCorrectCorruptDates;
+ private final boolean autoCorrectCorruptDates;
/**
* Parquet statistics for UTF-8 data in files created prior to 1.9.1 parquet
@@ -57,28 +52,28 @@ public class ParquetFormatConfig implements FormatPluginConfig {
*
* {@link org.apache.drill.exec.ExecConstants#PARQUET_READER_STRINGS_SIGNED_MIN_MAX}
*/
- @Getter private final boolean enableStringsSignedMinMax;
+ private final boolean enableStringsSignedMinMax;
// {@link org.apache.drill.exec.ExecConstants#PARQUET_BLOCK_SIZE}
- @Getter private final Integer blockSize;
+ private final Integer blockSize;
// {@link org.apache.drill.exec.ExecConstants#PARQUET_PAGE_SIZE}
- @Getter private final Integer pageSize;
+ private final Integer pageSize;
// {@link org.apache.drill.exec.ExecConstants#PARQUET_WRITER_USE_SINGLE_FS_BLOCK}
- @Getter private final Boolean useSingleFSBlock;
+ private final Boolean useSingleFSBlock;
// {@link org.apache.drill.exec.ExecConstants#PARQUET_WRITER_COMPRESSION_TYPE}
- @Getter private final String writerCompressionType;
+ private final String writerCompressionType;
// {@link org.apache.drill.exec.ExecConstants#PARQUET_WRITER_LOGICAL_TYPE_FOR_DECIMALS}
- @Getter private final String writerLogicalTypeForDecimals;
+ private final String writerLogicalTypeForDecimals;
// {@link org.apache.drill.exec.ExecConstants#PARQUET_WRITER_USE_PRIMITIVE_TYPES_FOR_DECIMALS}
- @Getter private final Boolean writerUsePrimitivesForDecimals;
+ private final Boolean writerUsePrimitivesForDecimals;
// {@link org.apache.drill.exec.ExecConstants#PARQUET_WRITER_FORMAT_VERSION}
- @Getter private final String writerFormatVersion;
+ private final String writerFormatVersion;
public ParquetFormatConfig() {
// config opts which are also system opts must default to null so as not
@@ -87,7 +82,6 @@ public class ParquetFormatConfig implements FormatPluginConfig {
}
@JsonCreator
- @Builder
public ParquetFormatConfig(
@JsonProperty("autoCorrectCorruptDates") Boolean autoCorrectCorruptDates,
@JsonProperty("enableStringsSignedMinMax") boolean enableStringsSignedMinMax,
@@ -110,6 +104,10 @@ public class ParquetFormatConfig implements FormatPluginConfig {
this.writerFormatVersion = writerFormatVersion;
}
+ public static ParquetFormatConfigBuilder builder() {
+ return new ParquetFormatConfigBuilder();
+ }
+
@Override
public String toString() {
return new PlanStringBuilder(this)
@@ -124,4 +122,136 @@ public class ParquetFormatConfig implements FormatPluginConfig {
.field("writerFormatVersion", writerFormatVersion)
.toString();
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ParquetFormatConfig that = (ParquetFormatConfig) o;
+ return autoCorrectCorruptDates == that.autoCorrectCorruptDates
+ && enableStringsSignedMinMax == that.enableStringsSignedMinMax
+ && Objects.equals(blockSize, that.blockSize)
+ && Objects.equals(pageSize, that.pageSize)
+ && Objects.equals(useSingleFSBlock, that.useSingleFSBlock)
+ && Objects.equals(writerCompressionType, that.writerCompressionType)
+ && Objects.equals(writerLogicalTypeForDecimals, that.writerLogicalTypeForDecimals)
+ && Objects.equals(writerUsePrimitivesForDecimals, that.writerUsePrimitivesForDecimals)
+ && Objects.equals(writerFormatVersion, that.writerFormatVersion);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(autoCorrectCorruptDates, enableStringsSignedMinMax, blockSize, pageSize,
+ useSingleFSBlock, writerCompressionType, writerLogicalTypeForDecimals,
+ writerUsePrimitivesForDecimals, writerFormatVersion);
+ }
+
+ public boolean isAutoCorrectCorruptDates() {
+ return this.autoCorrectCorruptDates;
+ }
+
+ public boolean isEnableStringsSignedMinMax() {
+ return this.enableStringsSignedMinMax;
+ }
+
+ public Integer getBlockSize() {
+ return this.blockSize;
+ }
+
+ public Integer getPageSize() {
+ return this.pageSize;
+ }
+
+ public Boolean getUseSingleFSBlock() {
+ return this.useSingleFSBlock;
+ }
+
+ public String getWriterCompressionType() {
+ return this.writerCompressionType;
+ }
+
+ public String getWriterLogicalTypeForDecimals() {
+ return this.writerLogicalTypeForDecimals;
+ }
+
+ public Boolean getWriterUsePrimitivesForDecimals() {
+ return this.writerUsePrimitivesForDecimals;
+ }
+
+ public String getWriterFormatVersion() {
+ return this.writerFormatVersion;
+ }
+
+ public static class ParquetFormatConfigBuilder {
+ private Boolean autoCorrectCorruptDates;
+
+ private boolean enableStringsSignedMinMax;
+
+ private Integer blockSize;
+
+ private Integer pageSize;
+
+ private Boolean useSingleFSBlock;
+
+ private String writerCompressionType;
+
+ private String writerLogicalTypeForDecimals;
+
+ private Boolean writerUsePrimitivesForDecimals;
+
+ private String writerFormatVersion;
+
+ public ParquetFormatConfigBuilder autoCorrectCorruptDates(Boolean autoCorrectCorruptDates) {
+ this.autoCorrectCorruptDates = autoCorrectCorruptDates;
+ return this;
+ }
+
+ public ParquetFormatConfigBuilder enableStringsSignedMinMax(boolean enableStringsSignedMinMax) {
+ this.enableStringsSignedMinMax = enableStringsSignedMinMax;
+ return this;
+ }
+
+ public ParquetFormatConfigBuilder blockSize(Integer blockSize) {
+ this.blockSize = blockSize;
+ return this;
+ }
+
+ public ParquetFormatConfigBuilder pageSize(Integer pageSize) {
+ this.pageSize = pageSize;
+ return this;
+ }
+
+ public ParquetFormatConfigBuilder useSingleFSBlock(Boolean useSingleFSBlock) {
+ this.useSingleFSBlock = useSingleFSBlock;
+ return this;
+ }
+
+ public ParquetFormatConfigBuilder writerCompressionType(String writerCompressionType) {
+ this.writerCompressionType = writerCompressionType;
+ return this;
+ }
+
+ public ParquetFormatConfigBuilder writerLogicalTypeForDecimals(String writerLogicalTypeForDecimals) {
+ this.writerLogicalTypeForDecimals = writerLogicalTypeForDecimals;
+ return this;
+ }
+
+ public ParquetFormatConfigBuilder writerUsePrimitivesForDecimals(Boolean writerUsePrimitivesForDecimals) {
+ this.writerUsePrimitivesForDecimals = writerUsePrimitivesForDecimals;
+ return this;
+ }
+
+ public ParquetFormatConfigBuilder writerFormatVersion(String writerFormatVersion) {
+ this.writerFormatVersion = writerFormatVersion;
+ return this;
+ }
+
+ public ParquetFormatConfig build() {
+ return new ParquetFormatConfig(autoCorrectCorruptDates, enableStringsSignedMinMax, blockSize, pageSize, useSingleFSBlock, writerCompressionType, writerLogicalTypeForDecimals, writerUsePrimitivesForDecimals, writerFormatVersion);
+ }
+ }
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/plan/rule/PluginConverterRule.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/plan/rule/PluginConverterRule.java
index 3af11be..377eba3 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/plan/rule/PluginConverterRule.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/plan/rule/PluginConverterRule.java
@@ -17,7 +17,6 @@
*/
package org.apache.drill.exec.store.plan.rule;
-import lombok.Getter;
import org.apache.calcite.plan.Convention;
import org.apache.calcite.plan.RelOptRuleCall;
import org.apache.calcite.plan.RelTrait;
@@ -40,7 +39,6 @@ import java.util.function.Predicate;
*/
public abstract class PluginConverterRule extends ConverterRule {
- @Getter
private final PluginImplementor pluginImplementor;
protected PluginConverterRule(Class<? extends RelNode> clazz,
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/testing/Injection.java b/exec/java-exec/src/main/java/org/apache/drill/exec/testing/Injection.java
index 3414f24..06f4804 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/testing/Injection.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/testing/Injection.java
@@ -17,19 +17,20 @@
*/
package org.apache.drill.exec.testing;
-import lombok.ToString;
-import lombok.extern.slf4j.Slf4j;
import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.util.StringJoiner;
import java.util.concurrent.atomic.AtomicInteger;
/**
* The base class for all types of injections (currently, pause and exception).
*/
-@Slf4j
-@ToString
public abstract class Injection {
+ private static final Logger logger = LoggerFactory.getLogger(Injection.class);
+
protected final String address; // the address of the drillbit on which to inject
protected final int port; // user port of the drillbit; useful when there are multiple drillbits on same machine
protected final Class<?> siteClass; // the class where the injection should happen
@@ -94,4 +95,17 @@ public abstract class Injection {
public long getMsPause() {
return msPause;
}
+
+ @Override
+ public String toString() {
+ return new StringJoiner(", ", Injection.class.getSimpleName() + "[", "]")
+ .add("address='" + address + "'")
+ .add("port=" + port)
+ .add("siteClass=" + siteClass)
+ .add("desc='" + desc + "'")
+ .add("nSkip=" + nSkip)
+ .add("nFire=" + nFire)
+ .add("msPause=" + msPause)
+ .toString();
+ }
}
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/PStoreTestUtil.java b/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/PStoreTestUtil.java
index 853a022..d814551 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/PStoreTestUtil.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/PStoreTestUtil.java
@@ -27,22 +27,19 @@ import java.util.Map;
import java.util.Map.Entry;
import com.fasterxml.jackson.databind.ObjectMapper;
-import lombok.val;
public class PStoreTestUtil {
- static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PStoreTestUtil.class);
public static void test(PersistentStoreProvider provider) throws Exception {
- val store = provider.getOrCreateStore(
+ PersistentStore<String> store = provider.getOrCreateStore(
PersistentStoreConfig.newJacksonBuilder(new ObjectMapper(), String.class)
.name("sys.test")
.build()
);
try {
- val expectedMap = new HashMap<String, String>() {{
- put("first", "value1");
- put("second", "value2");
- }}; // todo: rewrite with Java11
+ Map<String, String> expectedMap = new HashMap<>();
+ expectedMap.put("first", "value1");
+ expectedMap.put("second", "value2");
expectedMap.forEach(store::put);
waitForNumProps(store, expectedMap.size());
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestPStoreProviders.java b/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestPStoreProviders.java
index db95c02..913928b 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestPStoreProviders.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/sys/TestPStoreProviders.java
@@ -18,7 +18,6 @@
package org.apache.drill.exec.store.sys;
import com.fasterxml.jackson.databind.ObjectMapper;
-import lombok.val;
import org.apache.curator.framework.CuratorFramework;
import org.apache.drill.categories.FlakyTest;
import org.apache.drill.categories.SlowTest;
@@ -63,7 +62,7 @@ public class TestPStoreProviders extends TestWithZookeeper {
public void verifyZkStore() throws Exception {
try(CuratorFramework curator = createCurator()) {
curator.start();
- val provider = new ZookeeperPersistentStoreProvider(zkHelper.getConfig(), curator);
+ PersistentStoreProvider provider = new ZookeeperPersistentStoreProvider(zkHelper.getConfig(), curator);
PStoreTestUtil.test(provider);
}
}
diff --git a/lombok.config b/lombok.config
deleted file mode 100644
index e4f7e5c..0000000
--- a/lombok.config
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-lombok.log.fieldName = logger
diff --git a/pom.xml b/pom.xml
index 641517d..71f0510 100644
--- a/pom.xml
+++ b/pom.xml
@@ -135,7 +135,6 @@
<commons.beanutils.version>1.9.4</commons.beanutils.version>
<httpdlog-parser.version>5.7</httpdlog-parser.version>
<yauaa.version>5.20</yauaa.version>
- <lombok.version>1.18.20</lombok.version>
<brotli-codec.version>0.1.1</brotli-codec.version>
<aircompressor.version>0.20</aircompressor.version>
<iceberg.version>0.12.1</iceberg.version>
@@ -1122,13 +1121,6 @@
<artifactId>commons-collections4</artifactId>
</dependency>
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <version>${lombok.version}</version>
- <scope>provided</scope>
- </dependency>
-
<!-- Test Dependencies -->
<dependency>
<!-- JMockit needs to be on class path before JUnit. -->