sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1375822 - in /sqoop/branches/sqoop2: repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/ spi/src/main/java/org/apache/sqoop/connector/spi/
Date Tue, 21 Aug 2012 22:13:19 GMT
Author: blee
Date: Tue Aug 21 22:13:19 2012
New Revision: 1375822

URL: http://svn.apache.org/viewvc?rev=1375822&view=rev
Log:
SQOOP-577: Design storage in derby repository for connect and job metadata

Modified:
    sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
    sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java
    sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/connector/spi/SqoopConnector.java

Modified: sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java?rev=1375822&r1=1375821&r2=1375822&view=diff
==============================================================================
--- sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
(original)
+++ sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbyRepositoryHandler.java
Tue Aug 21 22:13:19 2012
@@ -212,6 +212,10 @@ public class DerbyRepositoryHandler impl
     runQuery(QUERY_CREATE_TABLE_SQ_CONNECTOR);
     runQuery(QUERY_CREATE_TABLE_SQ_FORM);
     runQuery(QUERY_CREATE_TABLE_SQ_INPUT);
+    runQuery(QUERY_CREATE_TABLE_SQ_CONNECTION);
+    runQuery(QUERY_CREATE_TABLE_SQ_JOB);
+    runQuery(QUERY_CREATE_TABLE_SQ_CONNECTION_INPUT);
+    runQuery(QUERY_CREATE_TABLE_SQ_JOB_INPUT);
   }
 
   /**

Modified: sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java?rev=1375822&r1=1375821&r2=1375822&view=diff
==============================================================================
--- sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java
(original)
+++ sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaConstants.java
Tue Aug 21 22:13:19 2012
@@ -23,6 +23,8 @@ public final class DerbySchemaConstants 
 
   private static final String SCHEMA_PREFIX = SCHEMA_SQOOP + ".";
 
+  // SQ_CONNECTOR
+
   public static final String TABLE_SQ_CONNECTOR_NAME = "SQ_CONNECTOR";
 
   public static final String TABLE_SQ_CONNECTOR = SCHEMA_PREFIX
@@ -34,12 +36,14 @@ public final class DerbySchemaConstants 
 
   public static final String COLUMN_SQC_CLASS = "SQC_CLASS";
 
+  // SQ_FORM
+
   public static final String TABLE_SQ_FORM_NAME = "SQ_FORM";
 
   public static final String TABLE_SQ_FORM = SCHEMA_PREFIX
       + TABLE_SQ_FORM_NAME;
 
-  public static final String  COLUMN_SQF_ID = "SQF_ID";
+  public static final String COLUMN_SQF_ID = "SQF_ID";
 
   public static final String COLUMN_SQF_CONNECTOR = "SQF_CONNECTOR";
 
@@ -51,6 +55,7 @@ public final class DerbySchemaConstants 
 
   public static final String COLUMN_SQF_INDEX = "SQF_INDEX";
 
+  // SQ_INPUT
 
   public static final String TABLE_SQ_INPUT_NAME = "SQ_INPUT";
 
@@ -71,17 +76,59 @@ public final class DerbySchemaConstants 
 
   public static final String COLUMN_SQI_STRLENGTH = "SQI_STRLENGTH";
 
+  // SQ_CONNECTION
+
+  public static final String TABLE_SQ_CONNECTION_NAME = "SQ_CONNECTION";
+
+  public static final String TABLE_SQ_CONNECTION = SCHEMA_PREFIX
+      + TABLE_SQ_CONNECTION_NAME;
+
+  public static final String COLUMN_SQN_ID = "SQN_ID";
+
+  public static final String COLUMN_SQN_NAME = "SQN_NAME";
+
+  public static final String COLUMN_SQN_CONNECTOR = "SQN_CONNECTOR";
+
+  // SQ_JOB
+
+  public static final String TABLE_SQ_JOB_NAME = "SQ_JOB";
+
+  public static final String TABLE_SQ_JOB = SCHEMA_PREFIX
+      + TABLE_SQ_JOB_NAME;
+
+  public static final String COLUMN_SQB_ID = "SQB_ID";
+
+  public static final String COLUMN_SQB_NAME = "SQB_NAME";
+
+  public static final String COLUMN_SQB_CONNECTION = "SQB_CONNECTION";
+
+  // SQ_CONNECTION_INPUT
+
+  public static final String TABLE_SQ_CONNECTION_INPUT_NAME =
+      "SQ_CONNECTION_INPUT";
+
+  public static final String TABLE_SQ_CONNECTION_INPUT = SCHEMA_PREFIX
+      + TABLE_SQ_CONNECTION_INPUT_NAME;
+
+  public static final String COLUMN_SQNI_CONNECTION = "SQNI_CONNECTION";
+
+  public static final String COLUMN_SQNI_INPUT = "SQNI_INPUT";
+
+  public static final String COLUMN_SQNI_VALUE = "SQNI_VALUE";
+
+  // SQ_JOB_INPUT
 
-  public static final String TABLE_SQ_STRING_NAME = "SQ_STRING";
-  public static final String TABLE_SQ_STRING = SCHEMA_PREFIX
-      + TABLE_SQ_STRING_NAME;
+  public static final String TABLE_SQ_JOB_INPUT_NAME =
+      "SQ_JOB_INPUT";
 
-  public static final String COLUMN_SQS_ID = "SQS_ID";
+  public static final String TABLE_SQ_JOB_INPUT = SCHEMA_PREFIX
+      + TABLE_SQ_JOB_INPUT_NAME;
 
-  public static final String COLUMN_SQS_MASK = "SQS_MASK";
+  public static final String COLUMN_SQBI_JOB = "SQBI_JOB";
 
-  public static final String COLUMN_SQS_LENGTH = "SQS_LENGTH";
+  public static final String COLUMN_SQBI_INPUT = "SQBI_INPUT";
 
+  public static final String COLUMN_SQBI_VALUE = "SQBI_VALUE";
 
   private DerbySchemaConstants() {
     // Disable explicit object creation

Modified: sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java?rev=1375822&r1=1375821&r2=1375822&view=diff
==============================================================================
--- sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
(original)
+++ sqoop/branches/sqoop2/repository/repository-derby/src/main/java/org/apache/sqoop/repository/derby/DerbySchemaQuery.java
Tue Aug 21 22:13:19 2012
@@ -66,6 +66,54 @@ import static org.apache.sqoop.repositor
  *    +----------------------------+
  * </pre>
  * </p>
+ * <p>
+ * <strong>SQ_CONNECTION</strong>: Stored connections
+ * <pre>
+ *    +----------------------------+
+ *    | SQ_CONNECTION              |
+ *    +----------------------------+
+ *    | SQN_ID: BIGINT PK AUTO-GEN |
+ *    | SQN_NAME: VARCHAR(64)      |
+ *    | SQN_CONNECTOR: BIGINT      | FK SQ_CONNECTOR(SQC_ID)
+ *    +----------------------------+
+ * </pre>
+ * </p>
+ * <p>
+ * <strong>SQ_JOB</strong>: Stored jobs
+ * <pre>
+ *    +----------------------------+
+ *    | SQ_JOB                     |
+ *    +----------------------------+
+ *    | SQB_ID: BIGINT PK AUTO-GEN |
+ *    | SQB_NAME: VARCHAR(64)      |
+ *    | SQB_CONNECTION: BIGINT     | FK SQ_CONNECTION(SQN_ID)
+ *    +----------------------------+
+ * </pre>
+ * </p>
+ * <p>
+ * <strong>SQ_CONNECTION_INPUT</strong>: N:M relationship connection and input
+ * <pre>
+ *    +----------------------------+
+ *    | SQ_CONNECTION_INPUT        |
+ *    +----------------------------+
+ *    | SQNI_CONNECTION: BIGINT PK | FK SQ_CONNECTION(SQN_ID)
+ *    | SQNI_INPUT: BIGINT PK      | FK SQ_INPUT(SQI_ID)
+ *    | SQNI_VALUE: LONG VARCHAR   |
+ *    +----------------------------+
+ * </pre>
+ * </p>
+ * <p>
+ * <strong>SQ_JOB_INPUT</strong>: N:M relationship job and input
+ * <pre>
+ *    +----------------------------+
+ *    | SQ_JOB_INPUT               |
+ *    +----------------------------+
+ *    | SQBI_JOB: BIGINT PK        | FK SQ_JOB(SQB_ID)
+ *    | SQBI_INPUT: BIGINT PK      | FK SQ_INPUT(SQI_ID)
+ *    | SQBI_VALUE: LONG VARCHAR   |
+ *    +----------------------------+
+ * </pre>
+ * </p>
  */
 public final class DerbySchemaQuery {
 
@@ -91,7 +139,6 @@ public final class DerbySchemaQuery {
       + COLUMN_SQF_CONNECTOR+ ") REFERENCES " + TABLE_SQ_CONNECTOR + " ("
       + COLUMN_SQC_ID + "))";
 
-
   // DDL: Create table SQ_INPUT
   public static final String QUERY_CREATE_TABLE_SQ_INPUT =
       "CREATE TABLE " + TABLE_SQ_INPUT + " (" + COLUMN_SQI_ID
@@ -102,6 +149,42 @@ public final class DerbySchemaQuery {
       + COLUMN_SQI_STRLENGTH + " SMALLINT, FOREIGN KEY (" + COLUMN_SQI_FORM
       + ") REFERENCES " + TABLE_SQ_FORM + " (" + COLUMN_SQF_ID + "))";
 
+  // DDL: Create table SQ_CONNECTION
+  public static final String QUERY_CREATE_TABLE_SQ_CONNECTION =
+      "CREATE TABLE " + TABLE_SQ_CONNECTION + " (" + COLUMN_SQN_ID
+      + " BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) "
+      + "PRIMARY KEY, " + COLUMN_SQN_CONNECTOR + " BIGINT, " + COLUMN_SQN_NAME
+      + " VARCHAR(32), FOREIGN KEY(" + COLUMN_SQN_CONNECTOR + ") REFERENCES "
+      + TABLE_SQ_CONNECTOR + " (" + COLUMN_SQC_ID + "))";
+
+  // DDL: Create table SQ_JOB
+  public static final String QUERY_CREATE_TABLE_SQ_JOB =
+      "CREATE TABLE " + TABLE_SQ_JOB + " (" + COLUMN_SQB_ID
+      + " BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) "
+      + "PRIMARY KEY, " + COLUMN_SQB_CONNECTION + " BIGINT, " + COLUMN_SQB_NAME
+      + " VARCHAR(32), FOREIGN KEY(" + COLUMN_SQB_CONNECTION + ") REFERENCES "
+      + TABLE_SQ_CONNECTION + " (" + COLUMN_SQN_ID + "))";
+
+  // DDL: Create table SQ_CONNECTION_INPUT
+  public static final String QUERY_CREATE_TABLE_SQ_CONNECTION_INPUT =
+      "CREATE TABLE " + TABLE_SQ_CONNECTION_INPUT + " ("
+      + COLUMN_SQNI_CONNECTION + " BIGINT, " + COLUMN_SQNI_INPUT + " BIGINT, "
+      + COLUMN_SQNI_VALUE + " LONG VARCHAR, PRIMARY KEY ("
+      + COLUMN_SQNI_CONNECTION + ", " + COLUMN_SQNI_INPUT + "), FOREIGN KEY ("
+      + COLUMN_SQNI_CONNECTION + ") REFERENCES " + TABLE_SQ_CONNECTION + " ("
+      + COLUMN_SQN_ID + "), FOREIGN KEY (" + COLUMN_SQNI_INPUT + ") REFERENCES "
+      + TABLE_SQ_INPUT + " (" + COLUMN_SQI_ID + "))";
+
+  // DDL: Create table SQ_JOB_INPUT
+  public static final String QUERY_CREATE_TABLE_SQ_JOB_INPUT =
+      "CREATE TABLE " + TABLE_SQ_JOB_INPUT + " ("
+      + COLUMN_SQBI_JOB + " BIGINT, " + COLUMN_SQBI_INPUT + " BIGINT, "
+      + COLUMN_SQBI_VALUE + " LONG VARCHAR, PRIMARY KEY ("
+      + COLUMN_SQBI_JOB + ", " + COLUMN_SQBI_INPUT + "), FOREIGN KEY ("
+      + COLUMN_SQBI_JOB + ") REFERENCES " + TABLE_SQ_JOB + " ("
+      + COLUMN_SQB_ID + "), FOREIGN KEY (" + COLUMN_SQBI_INPUT + ") REFERENCES "
+      + TABLE_SQ_INPUT + " (" + COLUMN_SQI_ID + "))";
+
   // DML: Fetch connector Given Name
   public static final String STMT_FETCH_BASE_CONNECTOR =
       "SELECT " + COLUMN_SQC_ID + ", " + COLUMN_SQC_NAME + ", "

Modified: sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/connector/spi/SqoopConnector.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/connector/spi/SqoopConnector.java?rev=1375822&r1=1375821&r2=1375822&view=diff
==============================================================================
--- sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/connector/spi/SqoopConnector.java
(original)
+++ sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/connector/spi/SqoopConnector.java
Tue Aug 21 22:13:19 2012
@@ -19,7 +19,6 @@ package org.apache.sqoop.connector.spi;
 
 import java.util.List;
 import java.util.Locale;
-import java.util.Map;
 import java.util.ResourceBundle;
 
 import org.apache.sqoop.job.etl.Exporter;



Mime
View raw message