[ 
https://issues.apache.org/jira/browse/DRILL-7385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16948659#comment-16948659
 ] 

ASF GitHub Bot commented on DRILL-7385:
---------------------------------------

cgivre commented on pull request #1862: DRILL-7385: Convert PCAP Format Plugin 
to EVF
URL: https://github.com/apache/drill/pull/1862#discussion_r333560465
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/store/pcap/TestPcapEVFReader.java
 ##########
 @@ -0,0 +1,111 @@
+/*
+ * 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.pcap;
+
+import org.apache.drill.categories.RowSetTests;
+import org.apache.drill.common.exceptions.ExecutionSetupException;
+import org.apache.drill.exec.server.Drillbit;
+import org.apache.drill.exec.store.StoragePluginRegistry;
+import org.apache.drill.exec.store.dfs.FileSystemConfig;
+import org.apache.drill.exec.store.dfs.FileSystemPlugin;
+import org.apache.drill.test.BaseDirTestWatcher;
+import org.apache.drill.test.ClusterFixture;
+import org.apache.drill.test.ClusterTest;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.time.LocalDateTime;
+import java.time.Month;
+
+
+@Category(RowSetTests.class)
+public class TestPcapEVFReader extends ClusterTest {
+
+  @ClassRule
+  public static final BaseDirTestWatcher dirTestWatcher = new 
BaseDirTestWatcher();
+
+  @BeforeClass
+  public static void setup() throws Exception {
+    ClusterTest.startCluster(ClusterFixture.builder(dirTestWatcher));
+    definePlugin();
+  }
+
+  private static void definePlugin() throws ExecutionSetupException {
+    PcapFormatConfig sampleConfig = new PcapFormatConfig();
+
+    // Define a temporary plugin for the "cp" storage plugin.
+    Drillbit drillbit = cluster.drillbit();
+    final StoragePluginRegistry pluginRegistry = 
drillbit.getContext().getStorage();
+    final FileSystemPlugin plugin = (FileSystemPlugin) 
pluginRegistry.getPlugin("cp");
+    final FileSystemConfig pluginConfig = (FileSystemConfig) 
plugin.getConfig();
+    pluginConfig.getFormats().put("sample", sampleConfig);
+    pluginRegistry.createOrUpdate("cp", pluginConfig, false);
+  }
+
+  @Test
+  public void testStarQuery() throws Exception {
+    String sql = "SELECT * FROM cp.`store/pcap/synscan.pcap` LIMIT 1";
+
+    testBuilder()
+      .sqlQuery(sql)
+      .unOrdered()
+      .baselineColumns("type", "packet_timestamp", "timestamp_micro", 
"network", "src_mac_address", "dst_mac_address", "dst_ip", "src_ip", 
"src_port", "dst_port", "packet_length",
+        "tcp_session", "tcp_sequence", "tcp_ack", "tcp_flags", 
"tcp_parsed_flags", "tcp_flags_ns", "tcp_flags_cwr", "tcp_flags_ece", 
"tcp_flags_ece_ecn_capable", "tcp_flags_ece_congestion_experienced", 
"tcp_flags_urg", "tcp_flags_ack", "tcp_flags_psh", "tcp_flags_rst", 
"tcp_flags_syn", "tcp_flags_fin", "data", "is_corrupt")
+      .baselineValues("TCP", LocalDateTime.of(2010, Month.JULY, 4, 20, 24, 16, 
274000000), 1278275056274870L, 1, "00:25:B3:BF:91:EE", "00:26:0B:31:07:33",
+        "64.13.134.52", "172.16.0.8", 36050, 443, 58,
+        317740574511239903L, -581795048, false, 2,"SYN", false, false, false, 
false, false, false, false, false, false, true, false,  "[]", false)
+      .build()
 
 Review comment:
   Done.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


> Convert PCAP Format Plugin to EVF
> ---------------------------------
>
>                 Key: DRILL-7385
>                 URL: https://issues.apache.org/jira/browse/DRILL-7385
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.16.0
>            Reporter: Charles Givre
>            Assignee: Charles Givre
>            Priority: Major
>             Fix For: 1.17.0
>
>
> The PCAP format plugin has the possibility of extracting considerably more 
> data out of PCAP files.  To facilitate this, this PR updates the plugin to 
> use the new Enhanced Vector Framework.  No changes in functionality should 
> occur.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to