drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [drill] paul-rogers commented on a change in pull request #1888: DRILL-5956: Add Storage Plugin for Apache Druid
Date Sat, 14 Mar 2020 07:09:21 GMT
paul-rogers commented on a change in pull request #1888: DRILL-5956: Add Storage Plugin for
Apache Druid
URL: https://github.com/apache/drill/pull/1888#discussion_r352263398
 
 

 ##########
 File path: contrib/storage-druid/src/main/java/org/apache/drill/exec/store/druid/DruidSubScan.java
 ##########
 @@ -0,0 +1,145 @@
+/*
+ * 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.
+ */
+package org.apache.drill.exec.store.druid;
+
+import com.fasterxml.jackson.annotation.JacksonInject;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.apache.drill.common.exceptions.ExecutionSetupException;
+import org.apache.drill.common.expression.SchemaPath;
+import org.apache.drill.common.logical.StoragePluginConfig;
+import org.apache.drill.exec.physical.base.AbstractBase;
+import org.apache.drill.exec.physical.base.PhysicalOperator;
+import org.apache.drill.exec.physical.base.PhysicalVisitor;
+import org.apache.drill.exec.physical.base.SubScan;
+import org.apache.drill.exec.store.StoragePluginRegistry;
+import org.apache.drill.shaded.guava.com.google.common.base.Preconditions;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import static java.util.Collections.emptyIterator;
+
+/**
+ * A Class containing information to read a single druid data source.
+ */
+@JsonTypeName("druid-datasource-scan")
+public class DruidSubScan extends AbstractBase implements SubScan {
+
+    static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DruidSubScan.class);
+
+    @JsonProperty
+    public final DruidStoragePluginConfig druidStoragePluginConfig;
+
+    @JsonIgnore
+    private final DruidStoragePlugin druidStoragePlugin;
+
+    private final List<DruidSubScanSpec> dataSourceScanSpecList;
+    private final List<SchemaPath> columns;
+
+    @JsonCreator
+    public DruidSubScan(@JacksonInject StoragePluginRegistry registry,
+                       @JsonProperty("druidStoragePluginConfig") StoragePluginConfig druidStoragePluginConfig,
+                       @JsonProperty("datasourceScanSpecList") LinkedList<DruidSubScanSpec>
datasourceScanSpecList,
+                       @JsonProperty("columns") List<SchemaPath> columns) throws ExecutionSetupException
{
+        super("someuser");
+        druidStoragePlugin = (DruidStoragePlugin) registry.getPlugin(druidStoragePluginConfig);
+        this.dataSourceScanSpecList = datasourceScanSpecList;
+        this.druidStoragePluginConfig = (DruidStoragePluginConfig) druidStoragePluginConfig;
+        this.columns = columns;
+    }
+
+    public DruidSubScan(DruidStoragePlugin plugin, DruidStoragePluginConfig config,
+                       List<DruidSubScanSpec> dataSourceInfoList, List<SchemaPath>
columns) {
+        super("someuser");
+        druidStoragePlugin = plugin;
+        druidStoragePluginConfig = config;
+        this.dataSourceScanSpecList = dataSourceInfoList;
+        this.columns = columns;
+    }
+
+    @Override
+    public <T, X, E extends Throwable> T accept(PhysicalVisitor<T, X, E> physicalVisitor,
X value) throws E {
+        return physicalVisitor.visitSubScan(this, value);
+    }
+
+    public List<DruidSubScanSpec> getDataSourceScanSpecList() {
+        return dataSourceScanSpecList;
+    }
+
+    @JsonIgnore
+    public DruidStoragePluginConfig getStorageConfig() {
+        return druidStoragePluginConfig;
+    }
+
+    public List<SchemaPath> getColumns() {
+        return columns;
+    }
+
+    @Override
 
 Review comment:
   `@JsonIgnore` to prevent Jackson from serializing since this looks like a Java Bean property.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message