drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [3/4] drill git commit: DRILL-1512: Refactor AvroFormatPlugin
Date Wed, 15 Apr 2015 20:34:24 GMT
DRILL-1512: Refactor AvroFormatPlugin

Extend EasyFormatPlugin and remove AvroGroupScan and AvroSubScan


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/bf3db318
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/bf3db318
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/bf3db318

Branch: refs/heads/master
Commit: bf3db3186ce633ac4a494bad888ae54542175ca4
Parents: 55a9a59
Author: Steven Phillips <smp@apache.org>
Authored: Wed Apr 15 03:26:04 2015 -0700
Committer: Steven Phillips <smp@apache.org>
Committed: Wed Apr 15 12:39:46 2015 -0700

----------------------------------------------------------------------
 .../drill/exec/store/avro/AvroFormatPlugin.java |  92 ++------
 .../drill/exec/store/avro/AvroGroupScan.java    | 208 -------------------
 .../drill/exec/store/avro/AvroRecordReader.java |   4 +-
 .../exec/store/avro/AvroScanBatchCreator.java   |  52 -----
 .../drill/exec/store/avro/AvroSubScan.java      | 142 -------------
 5 files changed, 24 insertions(+), 474 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/bf3db318/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroFormatPlugin.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroFormatPlugin.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroFormatPlugin.java
index 4fe1f71..2f487d6 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroFormatPlugin.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroFormatPlugin.java
@@ -18,111 +18,61 @@
 package org.apache.drill.exec.store.avro;
 
 import com.google.common.collect.Lists;
-import com.google.common.collect.ImmutableSet;
 
+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.AbstractGroupScan;
-import org.apache.drill.exec.physical.base.AbstractWriter;
-import org.apache.drill.exec.physical.base.PhysicalOperator;
+import org.apache.drill.exec.ops.FragmentContext;
+import org.apache.drill.exec.proto.UserBitShared.CoreOperatorType;
 import org.apache.drill.exec.server.DrillbitContext;
-import org.apache.drill.exec.store.StoragePluginOptimizerRule;
-import org.apache.drill.exec.store.dfs.BasicFormatMatcher;
-import org.apache.drill.exec.store.dfs.FileSelection;
-import org.apache.drill.exec.store.dfs.FormatMatcher;
-import org.apache.drill.exec.store.dfs.FormatPlugin;
-import org.apache.drill.exec.store.dfs.shim.DrillFileSystem;
+import org.apache.drill.exec.store.RecordReader;
+import org.apache.drill.exec.store.RecordWriter;
+import org.apache.drill.exec.store.dfs.DrillFileSystem;
+import org.apache.drill.exec.store.dfs.easy.EasyFormatPlugin;
+import org.apache.drill.exec.store.dfs.easy.EasyWriter;
+import org.apache.drill.exec.store.dfs.easy.FileWork;
 
 import java.io.IOException;
 import java.util.List;
-import java.util.Set;
 
 /**
  * Format plugin for Avro data files.
  */
-public class AvroFormatPlugin implements FormatPlugin {
-
-  private final String name;
-  private final DrillbitContext context;
-  private final DrillFileSystem fs;
-  private final StoragePluginConfig storagePluginConfig;
-  private final AvroFormatConfig formatConfig;
-  private final BasicFormatMatcher matcher;
+public class AvroFormatPlugin extends EasyFormatPlugin<AvroFormatConfig> {
 
   public AvroFormatPlugin(String name, DrillbitContext context, DrillFileSystem fs,
                           StoragePluginConfig storagePluginConfig) {
     this(name, context, fs, storagePluginConfig, new AvroFormatConfig());
   }
 
-  public AvroFormatPlugin(String name, DrillbitContext context, DrillFileSystem fs,
-                          StoragePluginConfig storagePluginConfig, AvroFormatConfig formatConfig)
{
-    this.name = name;
-    this.context = context;
-    this.fs = fs;
-    this.storagePluginConfig = storagePluginConfig;
-    this.formatConfig = formatConfig;
-
-    // XXX - What does 'compressible' mean in this context?
-    this.matcher = new BasicFormatMatcher(this, fs, Lists.newArrayList("avro"), false);
+  public AvroFormatPlugin(String name, DrillbitContext context, DrillFileSystem fs, StoragePluginConfig
config, AvroFormatConfig formatPluginConfig) {
+    super(name, context, fs, config, formatPluginConfig, true, false, false, false, Lists.newArrayList("avro"),
"avro");
   }
 
   @Override
-  public boolean supportsRead() {
+  public boolean supportsPushDown() {
     return true;
   }
 
   @Override
-  public boolean supportsWrite() {
-    return false;
-  }
-
-  @Override
-  public FormatMatcher getMatcher() {
-    return matcher;
-  }
-
-  @Override
-  public AbstractWriter getWriter(final PhysicalOperator child, final String location) throws
IOException {
-    throw new UnsupportedOperationException("Unimplemented");
-  }
-
-  @Override
-  public AbstractGroupScan getGroupScan(final FileSelection selection) throws IOException
{
-    return new AvroGroupScan(selection.getFileStatusList(fs), this, selection.selectionRoot,
null);
-  }
-
-  @Override
-  public AbstractGroupScan getGroupScan(final FileSelection selection, final List<SchemaPath>
columns) throws IOException {
-    return new AvroGroupScan(selection.getFileStatusList(fs), this, selection.selectionRoot,
columns);
+  public RecordReader getRecordReader(FragmentContext context, DrillFileSystem dfs, FileWork
fileWork, List<SchemaPath> columns) throws ExecutionSetupException {
+    return new AvroRecordReader(context, fileWork.getPath(), dfs, columns);
   }
 
   @Override
-  public Set<StoragePluginOptimizerRule> getOptimizerRules() {
-    return ImmutableSet.of();
+  public RecordWriter getRecordWriter(FragmentContext context, EasyWriter writer) throws
IOException {
+    throw new UnsupportedOperationException("unimplemented");
   }
 
   @Override
-  public AvroFormatConfig getConfig() {
-    return formatConfig;
+  public int getReaderOperatorType() {
+    return CoreOperatorType.AVRO_SUB_SCAN_VALUE;
   }
 
   @Override
-  public StoragePluginConfig getStorageConfig() {
-    return storagePluginConfig;
+  public int getWriterOperatorType() {
+    throw new UnsupportedOperationException("unimplemented");
   }
 
-  @Override
-  public DrillFileSystem getFileSystem() {
-    return fs;
-  }
 
-  @Override
-  public DrillbitContext getContext() {
-    return context;
-  }
-
-  @Override
-  public String getName() {
-    return name;
-  }
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/bf3db318/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroGroupScan.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroGroupScan.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroGroupScan.java
deleted file mode 100644
index fcc1f94..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroGroupScan.java
+++ /dev/null
@@ -1,208 +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.
- */
-package org.apache.drill.exec.store.avro;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JacksonInject;
-import com.fasterxml.jackson.annotation.JsonCreator;
-
-import org.apache.drill.common.exceptions.ExecutionSetupException;
-import org.apache.drill.common.exceptions.PhysicalOperatorSetupException;
-import org.apache.drill.common.expression.SchemaPath;
-import org.apache.drill.common.logical.FormatPluginConfig;
-import org.apache.drill.common.logical.StoragePluginConfig;
-import org.apache.drill.exec.physical.EndpointAffinity;
-import org.apache.drill.exec.physical.base.GroupScan;
-import org.apache.drill.exec.physical.base.AbstractGroupScan;
-import org.apache.drill.exec.physical.base.ScanStats;
-import org.apache.drill.exec.physical.base.PhysicalOperator;
-import org.apache.drill.exec.proto.CoordinationProtos;
-import org.apache.drill.exec.store.StoragePluginRegistry;
-import org.apache.drill.exec.store.dfs.ReadEntryWithPath;
-//import org.apache.drill.exec.store.avro.AvroSubScan.AvroSubScanSpec;
-
-import org.apache.hadoop.fs.FileStatus;
-import org.apache.hadoop.fs.FileSystem;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-
-/**
- * Group scan implementation for Avro data files.
- */
-@JsonTypeName("avro-scan")
-public class AvroGroupScan extends AbstractGroupScan {
-
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AvroGroupScan.class);
-
-  private final AvroFormatPlugin formatPlugin;
-  private final AvroFormatConfig formatConfig;
-  private final List<SchemaPath> columns;
-  private final FileSystem fs;
-  private final List<ReadEntryWithPath> entries;
-  private final String selectionRoot;
-
-  //private Map<Integer, List<AvroSubScanSpec>> endpointMappings;
-
-  private List<EndpointAffinity> endpointAffinities;
-
-  @JsonCreator
-  public AvroGroupScan(@JsonProperty("entries") final List<ReadEntryWithPath> entries,
-                       @JsonProperty("storage") final StoragePluginConfig storageConfig,
-                       @JsonProperty("format") final FormatPluginConfig formatConfig,
-                       @JacksonInject final StoragePluginRegistry engineRegistry,
-                       @JsonProperty("columns") final List<SchemaPath> columns,
-                       @JsonProperty("selectionRoot") final String selectionRoot) throws
ExecutionSetupException {
-
-    this.columns = columns;
-    final AvroFormatConfig afc;
-    if (formatConfig == null) {
-      afc = new AvroFormatConfig();
-    } else {
-      afc = (AvroFormatConfig) formatConfig;
-    }
-    Preconditions.checkNotNull(storageConfig);
-    Preconditions.checkNotNull(afc);
-    this.formatPlugin = (AvroFormatPlugin) engineRegistry.getFormatPlugin(storageConfig,
afc);
-    Preconditions.checkNotNull(this.formatPlugin);
-    this.fs = formatPlugin.getFileSystem().getUnderlying();
-    this.formatConfig = formatPlugin.getConfig();
-    this.entries = entries;
-    this.selectionRoot = selectionRoot;
-  }
-
-  public AvroGroupScan(final List<FileStatus> files, final AvroFormatPlugin formatPlugin,
-                       final String selectionRoot, final List<SchemaPath> columns)
throws IOException {
-
-    this.formatPlugin = formatPlugin;
-    this.columns = columns;
-    this.formatConfig = formatPlugin.getConfig();
-    this.fs = formatPlugin.getFileSystem().getUnderlying();
-    this.selectionRoot = selectionRoot;
-
-    this.entries = Lists.newArrayList();
-    for (final FileStatus fs : files) {
-      entries.add(new ReadEntryWithPath(fs.getPath().toString()));
-    }
-  }
-
-  @JsonProperty("format")
-  public AvroFormatConfig getFormatConfig() {
-    return this.formatConfig;
-  }
-
-  @JsonProperty("storage")
-  public StoragePluginConfig getEngineConfig() {
-    return this.formatPlugin.getStorageConfig();
-  }
-
-  private AvroGroupScan(final AvroGroupScan that, final List<SchemaPath> columns) {
-    this.columns = (columns == null) ? that.columns : columns;
-    this.entries = that.entries;
-    this.formatConfig = that.formatConfig;
-    this.formatPlugin = that.formatPlugin;
-    this.fs = that.fs;
-    this.selectionRoot = that.selectionRoot;
-
-    // XXX - DON'T FORGET TO ADD THESE AFTER WE'VE IMPLEMENTED AFFINITY
-    //this.endpointAffinities = that.endpointAffinities;
-    //this.mappings = that.mappings;
-    //this.rowCount = that.rowCount;
-    //this.rowGroupInfos = that.rowGroupInfos;
-    //this.columnValueCounts = that.columnValueCounts;
-  }
-
-  @Override
-  public void applyAssignments(final List<CoordinationProtos.DrillbitEndpoint> endpoints)
throws PhysicalOperatorSetupException {
-    // XXX - Unimplemented
-    logger.warn("AvroGroupScan.applyAssignments() is not implemented");
-  }
-
-  @Override
-  public AvroSubScan getSpecificScan(final int minorFragmentId) throws ExecutionSetupException
{
-
-    final AvroSubScan sub = new AvroSubScan(formatPlugin, columns, selectionRoot);
-
-    // XXX - This is a temporary hack just to get something working. Need to revisit sub-scan
specs
-    //       once we work out affinity and endpoints.
-    sub.setEntry(entries.get(0));
-    sub.setFileSystem(fs);
-
-    return sub;
-  }
-
-  @Override
-  public int getMaxParallelizationWidth() {
-    // XXX - Finish
-    return 1;
-  }
-
-  @Override
-  public ScanStats getScanStats() {
-    // XXX - Is 0 the correct value for second arg? What if I don't know the row count a
priori?
-    return new ScanStats(ScanStats.GroupScanProperty.NO_EXACT_ROW_COUNT, 0, 1, 1);
-  }
-
-  @Override
-  public List<EndpointAffinity> getOperatorAffinity() {
-    // XXX - Unimplemented
-    if (endpointAffinities != null) {
-      return endpointAffinities;
-    }
-    return Collections.emptyList();
-  }
-
-  @Override
-  @JsonIgnore
-  public PhysicalOperator getNewWithChildren(final List<PhysicalOperator> children)
throws ExecutionSetupException {
-    Preconditions.checkArgument(children.isEmpty());
-    return new AvroGroupScan(this, null);
-  }
-
-  @Override
-  public String getDigest() {
-    return toString();
-  }
-
-  @Override
-  public String toString() {
-    return "AvroGroupScan [entries=" + entries +
-            ", selectionRoot=" + selectionRoot +
-            ", columns=" + columns + "]";
-  }
-
-  @Override
-  public GroupScan clone(final List<SchemaPath> columns) {
-    return new AvroGroupScan(this, columns);
-  }
-
-  @JsonIgnore
-  public boolean canPushdownProjects(final List<SchemaPath> columns) {
-    return true;
-  }
-
-  public List<ReadEntryWithPath> getEntries() {
-    return entries;
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/bf3db318/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroRecordReader.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroRecordReader.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroRecordReader.java
index 3b7697d..489a989 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroRecordReader.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroRecordReader.java
@@ -73,6 +73,7 @@ public class AvroRecordReader extends AbstractRecordReader {
 
   private DataFileReader<GenericContainer> reader = null;
   private OperatorContext operatorContext;
+  private FileSystem fs;
 
   private static final int DEFAULT_BATCH_SIZE = 1000;
 
@@ -91,6 +92,7 @@ public class AvroRecordReader extends AbstractRecordReader {
 
     hadoop = new Path(inputPath);
     buffer = fragmentContext.getManagedBuffer();
+    this.fs = fileSystem;
 
     setColumns(projectedColumns);
   }
@@ -101,7 +103,7 @@ public class AvroRecordReader extends AbstractRecordReader {
     writer = new VectorContainerWriter(output);
 
     try {
-      reader = new DataFileReader<>(new FsInput(hadoop, new Configuration()), new GenericDatumReader<GenericContainer>());
+      reader = new DataFileReader<>(new FsInput(hadoop, fs.getConf()), new GenericDatumReader<GenericContainer>());
     } catch (IOException e) {
       throw new ExecutionSetupException(e);
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/bf3db318/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroScanBatchCreator.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroScanBatchCreator.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroScanBatchCreator.java
deleted file mode 100644
index 42c8e99..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroScanBatchCreator.java
+++ /dev/null
@@ -1,52 +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.
- */
-package org.apache.drill.exec.store.avro;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-
-import org.apache.drill.common.exceptions.ExecutionSetupException;
-import org.apache.drill.common.expression.SchemaPath;
-import org.apache.drill.exec.ops.FragmentContext;
-import org.apache.drill.exec.physical.impl.BatchCreator;
-import org.apache.drill.exec.physical.impl.ScanBatch;
-import org.apache.drill.exec.record.RecordBatch;
-import org.apache.drill.exec.store.RecordReader;
-
-import java.util.List;
-
-/**
- * Batch creator for Avro scans.
- */
-public class AvroScanBatchCreator implements BatchCreator<AvroSubScan> {
-
-
-  @Override
-  public RecordBatch getBatch(final FragmentContext context, final AvroSubScan subScan,
-                              final List<RecordBatch> children) throws ExecutionSetupException
{
-
-    Preconditions.checkArgument(children.isEmpty());
-    List<SchemaPath> columns = subScan.getColumns();
-    List<RecordReader> readers = Lists.newArrayList();
-
-    readers.add(new AvroRecordReader(context, subScan.getEntry().getPath(), subScan.getFileSystem(),
columns));
-
-    return new ScanBatch(subScan, context, readers.iterator());
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/bf3db318/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroSubScan.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroSubScan.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroSubScan.java
deleted file mode 100644
index 0a579aa..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroSubScan.java
+++ /dev/null
@@ -1,142 +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.
- */
-package org.apache.drill.exec.store.avro;
-
-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.FormatPluginConfig;
-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.proto.UserBitShared;
-import org.apache.drill.exec.store.StoragePluginRegistry;
-
-import com.google.common.collect.Iterators;
-import com.google.common.base.Preconditions;
-import org.apache.drill.exec.store.dfs.ReadEntryWithPath;
-import org.apache.hadoop.fs.FileSystem;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Contains information for reading a single Avro row group from HDFS.
- */
-@JsonTypeName("avro-sub-scan")
-public class AvroSubScan extends AbstractBase implements SubScan {
-
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AvroSubScan.class);
-
-  private final AvroFormatPlugin formatPlugin;
-  private final AvroFormatConfig formatConfig;
-  private final List<SchemaPath> columns;
-  private final String selectionRoot;
-
-  private ReadEntryWithPath entry;
-  private FileSystem fs;
-
-  @JsonCreator
-  public AvroSubScan(@JacksonInject final StoragePluginRegistry registry,
-                     @JsonProperty("storage") final StoragePluginConfig storageConfig,
-                     @JsonProperty("format") final FormatPluginConfig formatConfig,
-                     @JsonProperty("columns") final List<SchemaPath> columns,
-                     @JsonProperty("selectionRoot") final String selectionRoot) throws ExecutionSetupException
{
-    this((AvroFormatPlugin) registry.getFormatPlugin(Preconditions.checkNotNull(storageConfig),
-            formatConfig == null ? new AvroFormatConfig() : formatConfig), columns, selectionRoot);
-  }
-
-  public AvroSubScan(final AvroFormatPlugin formatPlugin, final List<SchemaPath> columns,
-                     final String selectionRoot) {
-    this.formatPlugin = Preconditions.checkNotNull(formatPlugin);
-    this.formatConfig = formatPlugin.getConfig();
-    this.columns = columns;
-    this.selectionRoot = selectionRoot;
-  }
-
-  @JsonProperty("storage")
-  public StoragePluginConfig getEngineConfig() {
-    return formatPlugin.getStorageConfig();
-  }
-
-  @JsonProperty("format")
-  public AvroFormatConfig getFormatConfig() {
-    return formatConfig;
-  }
-
-  @Override
-  public <T, X, E extends Throwable> T accept(final PhysicalVisitor<T, X, E>
physicalVisitor, final X value) throws E {
-    return physicalVisitor.visitSubScan(this, value);
-  }
-
-  @Override
-  public PhysicalOperator getNewWithChildren(final List<PhysicalOperator> children)
throws ExecutionSetupException {
-    Preconditions.checkArgument(children.isEmpty());
-    return new AvroSubScan(formatPlugin, columns, selectionRoot);
-  }
-
-  @Override
-  public int getOperatorType() {
-    return UserBitShared.CoreOperatorType.AVRO_ROW_GROUP_SCAN_VALUE;
-  }
-
-  @Override
-  public Iterator<PhysicalOperator> iterator() {
-    return Iterators.emptyIterator();
-  }
-
-  @JsonIgnore
-  public List<SchemaPath> getColumns() {
-    return columns;
-  }
-
-  /*
-  public static class AvroSubScanSpec {
-
-  }
-  */
-
-  /** XXX - temp hacks **/
-
-  @JsonIgnore
-  public void setEntry(ReadEntryWithPath entry) {
-    this.entry = entry;
-  }
-
-  @JsonIgnore
-  public ReadEntryWithPath getEntry() {
-    return entry;
-  }
-
-  @JsonIgnore
-  public void setFileSystem(FileSystem fs) {
-    this.fs = fs;
-  }
-
-  @JsonIgnore
-  public FileSystem getFileSystem() {
-    return fs;
-  }
-}


Mime
View raw message