You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by pa...@apache.org on 2015/06/17 22:30:39 UTC

[09/10] drill git commit: DRILL-3262: Rename DrillDatabaseMetaData -> DrillDatabaseMetaDataImpl.

DRILL-3262: Rename DrillDatabaseMetaData -> DrillDatabaseMetaDataImpl.

Renamed org.apache.drill.jdbc.impl.DrillDatabaseMetaData to
        org.apache.drill.jdbc.impl.DrillDatabaseMetaDataImpl (re creating
        org.apache.drill.jdbc.DrillDatabaseMetaDataImpl for DRILL-3198).

[DrillDatabaseMetaData -> DrillDatabaseMetaDataImpl, DrillJdbc41Factory]


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

Branch: refs/heads/master
Commit: f2231a850647f54d18d8e2a1de69e34290f0a037
Parents: c668a10
Author: dbarclay <db...@maprtech.com>
Authored: Mon Jun 8 14:11:41 2015 -0700
Committer: Parth Chandra <pa...@apache.org>
Committed: Wed Jun 17 11:46:09 2015 -0700

----------------------------------------------------------------------
 .../drill/jdbc/impl/DrillDatabaseMetaData.java  | 118 -------------------
 .../jdbc/impl/DrillDatabaseMetaDataImpl.java    | 118 +++++++++++++++++++
 .../drill/jdbc/impl/DrillJdbc41Factory.java     |   4 +-
 3 files changed, 120 insertions(+), 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/f2231a85/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaData.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaData.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaData.java
deleted file mode 100644
index c975f73..0000000
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaData.java
+++ /dev/null
@@ -1,118 +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.jdbc.impl;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.apache.drill.jdbc.AlreadyClosedSqlException;
-
-import net.hydromatic.avatica.AvaticaConnection;
-import net.hydromatic.avatica.AvaticaDatabaseMetaData;
-
-
-/**
- * Drill's implementation of {@link DatabaseMetaData}.
- */
-class DrillDatabaseMetaData extends AvaticaDatabaseMetaData {
-
-  protected DrillDatabaseMetaData( AvaticaConnection connection ) {
-    super( connection );
-  }
-
-  /**
-   * Throws AlreadyClosedSqlException if the associated Connection is closed.
-   *
-   * @throws AlreadyClosedSqlException if Connection is closed
-   * @throws SQLException if error in calling {@link Connection#isClosed()}
-   */
-  private void checkNotClosed() throws AlreadyClosedSqlException,
-                                       SQLException {
-    if ( getConnection().isClosed() ) {
-      throw new AlreadyClosedSqlException(
-          "DatabaseMetaData's Connection is already closed." );
-    }
-  }
-
-
-  // For omitted NULLS FIRST/NULLS HIGH, Drill sort NULL sorts as highest value:
-
-  @Override
-  public boolean nullsAreSortedHigh() throws SQLException {
-    checkNotClosed();
-    return true;
-  }
-
-  @Override
-  public boolean nullsAreSortedLow() throws SQLException {
-    checkNotClosed();
-    return false;
-  }
-
-  @Override
-  public boolean nullsAreSortedAtStart() throws SQLException {
-    checkNotClosed();
-    return false;
-  }
-
-  @Override
-  public boolean nullsAreSortedAtEnd() throws SQLException {
-    checkNotClosed();
-    return false;
-  }
-
-
-  // For now, check whether connection is closed for most important methods
-  // (DRILL-2565 (partial fix for DRILL-2489)):
-
-
-  @Override
-  public ResultSet getCatalogs() throws SQLException {
-    checkNotClosed();
-    return super.getCatalogs();
-  }
-
-  @Override
-  public ResultSet getSchemas() throws SQLException {
-    checkNotClosed();
-    return super.getSchemas();
-  }
-
-  @Override
-  public ResultSet getSchemas( String catalog, String schemaPattern ) throws SQLException {
-    checkNotClosed();
-    return super.getSchemas( catalog, schemaPattern );
-  }
-
-  @Override
-  public ResultSet getTables( String catalog,
-                              String schemaPattern,
-                              String tableNamePattern,
-                              String[] types ) throws SQLException {
-    checkNotClosed();
-    return super.getTables( catalog, schemaPattern,tableNamePattern, types );
-  }
-
-  @Override
-  public ResultSet getColumns( String catalog, String schema, String table,
-                               String columnNamePattern ) throws SQLException {
-    checkNotClosed();
-    return super.getColumns( catalog, schema, table, columnNamePattern );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/f2231a85/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java
new file mode 100644
index 0000000..71c38b9
--- /dev/null
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillDatabaseMetaDataImpl.java
@@ -0,0 +1,118 @@
+/**
+ * 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.jdbc.impl;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.apache.drill.jdbc.AlreadyClosedSqlException;
+
+import net.hydromatic.avatica.AvaticaConnection;
+import net.hydromatic.avatica.AvaticaDatabaseMetaData;
+
+
+/**
+ * Drill's implementation of {@link DatabaseMetaData}.
+ */
+class DrillDatabaseMetaDataImpl extends AvaticaDatabaseMetaData {
+
+  protected DrillDatabaseMetaDataImpl( AvaticaConnection connection ) {
+    super( connection );
+  }
+
+  /**
+   * Throws AlreadyClosedSqlException if the associated Connection is closed.
+   *
+   * @throws AlreadyClosedSqlException if Connection is closed
+   * @throws SQLException if error in calling {@link Connection#isClosed()}
+   */
+  private void checkNotClosed() throws AlreadyClosedSqlException,
+                                       SQLException {
+    if ( getConnection().isClosed() ) {
+      throw new AlreadyClosedSqlException(
+          "DatabaseMetaData's Connection is already closed." );
+    }
+  }
+
+
+  // For omitted NULLS FIRST/NULLS HIGH, Drill sort NULL sorts as highest value:
+
+  @Override
+  public boolean nullsAreSortedHigh() throws SQLException {
+    checkNotClosed();
+    return true;
+  }
+
+  @Override
+  public boolean nullsAreSortedLow() throws SQLException {
+    checkNotClosed();
+    return false;
+  }
+
+  @Override
+  public boolean nullsAreSortedAtStart() throws SQLException {
+    checkNotClosed();
+    return false;
+  }
+
+  @Override
+  public boolean nullsAreSortedAtEnd() throws SQLException {
+    checkNotClosed();
+    return false;
+  }
+
+
+  // For now, check whether connection is closed for most important methods
+  // (DRILL-2565 (partial fix for DRILL-2489)):
+
+
+  @Override
+  public ResultSet getCatalogs() throws SQLException {
+    checkNotClosed();
+    return super.getCatalogs();
+  }
+
+  @Override
+  public ResultSet getSchemas() throws SQLException {
+    checkNotClosed();
+    return super.getSchemas();
+  }
+
+  @Override
+  public ResultSet getSchemas( String catalog, String schemaPattern ) throws SQLException {
+    checkNotClosed();
+    return super.getSchemas( catalog, schemaPattern );
+  }
+
+  @Override
+  public ResultSet getTables( String catalog,
+                              String schemaPattern,
+                              String tableNamePattern,
+                              String[] types ) throws SQLException {
+    checkNotClosed();
+    return super.getTables( catalog, schemaPattern,tableNamePattern, types );
+  }
+
+  @Override
+  public ResultSet getColumns( String catalog, String schema, String table,
+                               String columnNamePattern ) throws SQLException {
+    checkNotClosed();
+    return super.getColumns( catalog, schema, table, columnNamePattern );
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/drill/blob/f2231a85/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillJdbc41Factory.java
----------------------------------------------------------------------
diff --git a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillJdbc41Factory.java b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillJdbc41Factory.java
index 3d02fac..11191ae 100644
--- a/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillJdbc41Factory.java
+++ b/exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillJdbc41Factory.java
@@ -67,8 +67,8 @@ public class DrillJdbc41Factory extends DrillFactory {
   }
 
   @Override
-  public DrillDatabaseMetaData newDatabaseMetaData(AvaticaConnection connection) {
-    return new DrillDatabaseMetaData((DrillConnectionImpl) connection);
+  public DrillDatabaseMetaDataImpl newDatabaseMetaData(AvaticaConnection connection) {
+    return new DrillDatabaseMetaDataImpl((DrillConnectionImpl) connection);
   }