You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ja...@apache.org on 2016/01/11 08:53:50 UTC

[02/12] drill git commit: DRILL-4241: Fixing the build, make RAT and checkstyle happy.

DRILL-4241: Fixing the build, make RAT and checkstyle happy.


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

Branch: refs/heads/master
Commit: 805e0416106139e6686672aed2d2cd600bc4e36d
Parents: 5dfb451
Author: Jason Altekruse <al...@gmail.com>
Authored: Sun Jan 10 22:50:05 2016 -0800
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Sun Jan 10 22:53:06 2016 -0800

----------------------------------------------------------------------
 .../src/main/resources/checkstyle-config.xml    | 42 ++++++++++++
 .../main/resources/checkstyle-suppressions.xml  | 19 ++++++
 .../drill/store/kudu/TestKuduConnect.java       | 17 +++++
 .../apache/drill/store/kudu/TestKuduPlugin.java | 17 +++++
 .../drill/store/kudu/TestKuduTableProvider.java | 72 +-------------------
 5 files changed, 97 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/805e0416/contrib/storage-kudu/src/main/resources/checkstyle-config.xml
----------------------------------------------------------------------
diff --git a/contrib/storage-kudu/src/main/resources/checkstyle-config.xml b/contrib/storage-kudu/src/main/resources/checkstyle-config.xml
new file mode 100644
index 0000000..74cc856
--- /dev/null
+++ b/contrib/storage-kudu/src/main/resources/checkstyle-config.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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^M
+  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. -->
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<!--  Checkstyle configuration for Apache Drill -->
+
+<module name="Checker">
+
+  <module name="TreeWalker">
+
+    <module name="IllegalImport">
+      <!-- For "org.apache.commons.lang.*" classes use the corresponding class from "org.apache.commons.lang3.*" -->
+      <property name="illegalPkgs" value="com.google.hive12,com.beust.jcommander.internal,jersey.repackaged,org.apache.commons.lang"/>
+    </module>
+
+    <module name="AvoidStarImport">
+      <property name="allowStaticMemberImports" value="true"/>
+    </module>
+
+    <module name="NeedBraces"/>
+
+  </module>
+
+  <module name="FileTabCharacter"/>
+
+  <module name="RegexpSingleline">
+    <property name="format" value="\s+$"/>
+    <property name="message" value="A line of code cannot contain any trailing whitespace"/>
+  </module>
+
+</module>

http://git-wip-us.apache.org/repos/asf/drill/blob/805e0416/contrib/storage-kudu/src/main/resources/checkstyle-suppressions.xml
----------------------------------------------------------------------
diff --git a/contrib/storage-kudu/src/main/resources/checkstyle-suppressions.xml b/contrib/storage-kudu/src/main/resources/checkstyle-suppressions.xml
new file mode 100644
index 0000000..9d4682b
--- /dev/null
+++ b/contrib/storage-kudu/src/main/resources/checkstyle-suppressions.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 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. -->
+<!DOCTYPE suppressions PUBLIC
+    "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+    "suppressions_1_1.dtd">
+
+<!--  Checkstyle Suppressions for Apache Drill -->
+<suppressions>
+  <suppress files="[\\/]generated-sources[\\/]" checks="AvoidStarImport,NeedBraces"/>
+</suppressions>

http://git-wip-us.apache.org/repos/asf/drill/blob/805e0416/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduConnect.java
----------------------------------------------------------------------
diff --git a/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduConnect.java b/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduConnect.java
index a6fc69c..d5c6c51 100644
--- a/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduConnect.java
+++ b/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduConnect.java
@@ -1,3 +1,20 @@
+/**
+ * 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.store.kudu;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/drill/blob/805e0416/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduPlugin.java
----------------------------------------------------------------------
diff --git a/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduPlugin.java b/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduPlugin.java
index 1a6211f..97b2212 100644
--- a/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduPlugin.java
+++ b/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduPlugin.java
@@ -1,3 +1,20 @@
+/**
+ * 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.store.kudu;
 
 import org.apache.drill.BaseTestQuery;

http://git-wip-us.apache.org/repos/asf/drill/blob/805e0416/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduTableProvider.java
----------------------------------------------------------------------
diff --git a/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduTableProvider.java b/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduTableProvider.java
index ca8f9e1..f5b3ead 100644
--- a/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduTableProvider.java
+++ b/contrib/storage-kudu/src/test/java/org/apache/drill/store/kudu/TestKuduTableProvider.java
@@ -17,75 +17,7 @@
  */
 package org.apache.drill.store.kudu;
 
-import static org.junit.Assert.assertEquals;
+import org.apache.drill.BaseTestQuery;
+public class TestKuduTableProvider extends BaseTestQuery {
 
-import java.io.IOException;
-import java.util.Map.Entry;
-
-import org.apache.drill.common.config.LogicalPlanPersistence;
-import org.apache.drill.exec.planner.PhysicalPlanReaderTestFactory;
-import org.apache.drill.exec.store.kudu.config.KuduPStoreProvider;
-import org.apache.drill.exec.store.sys.PStore;
-import org.apache.drill.exec.store.sys.PStoreConfig;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class TestKuduTableProvider extends BaseKuduTest {
-
-  private static KuduPStoreProvider provider;
-
-  @BeforeClass // mask Kudu cluster start function
-  public static void setUpBeforeTestKuduTableProvider() throws Exception {
-    provider = new KuduPStoreProvider(storagePluginConfig.getKuduConf(), "drill_store");
-    provider.start();
-  }
-
-  @Test
-  public void testTableProvider() throws IOException {
-    LogicalPlanPersistence lp = PhysicalPlanReaderTestFactory.defaultLogicalPlanPersistence(config);
-    PStore<String> kuduStore = provider.getStore(PStoreConfig.newJacksonBuilder(lp.getMapper(), String.class).name("kudu").build());
-    kuduStore.put("", "v0");
-    kuduStore.put("k1", "v1");
-    kuduStore.put("k2", "v2");
-    kuduStore.put("k3", "v3");
-    kuduStore.put("k4", "v4");
-    kuduStore.put("k5", "v5");
-    kuduStore.put(".test", "testValue");
-
-    assertEquals("v0", kuduStore.get(""));
-    assertEquals("testValue", kuduStore.get(".test"));
-
-    int rowCount = 0;
-    for (Entry<String, String> entry : kuduStore) {
-      rowCount++;
-      System.out.println(entry.getKey() + "=" + entry.getValue());
-    }
-    assertEquals(7, rowCount);
-
-    PStore<String> kuduTestStore = provider.getStore(PStoreConfig.newJacksonBuilder(lp.getMapper(), String.class).name("kudu.test").build());
-    kuduTestStore.put("", "v0");
-    kuduTestStore.put("k1", "v1");
-    kuduTestStore.put("k2", "v2");
-    kuduTestStore.put("k3", "v3");
-    kuduTestStore.put("k4", "v4");
-    kuduTestStore.put(".test", "testValue");
-
-    assertEquals("v0", kuduStore.get(""));
-    assertEquals("testValue", kuduStore.get(".test"));
-
-    rowCount = 0;
-    for (Entry<String, String> entry : kuduTestStore) {
-      rowCount++;
-      System.out.println(entry.getKey() + "=" + entry.getValue());
-    }
-    assertEquals(6, rowCount);
-  }
-
-  @AfterClass
-  public static void tearDownTestKuduTableProvider() {
-    if (provider != null) {
-      provider.close();
-    }
-  }
 }