sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject svn commit: r1370203 - in /sqoop/branches/sqoop2: connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/ connector/connector-mysql-jdbc/src/main/java/org/apache/sqoop/connector/mysqljdbc/ spi/src/main/java/org/apache/sqoop/conn...
Date Tue, 07 Aug 2012 12:24:56 GMT
Author: jarcec
Date: Tue Aug  7 12:24:55 2012
New Revision: 1370203

URL: http://svn.apache.org/viewvc?rev=1370203&view=rev
Log:
SQOOP-531. Define connector execution lifecycle.

(Bilung Lee via Jarek Jarcec Cecho)

Added:
    sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportDestroyer.java
    sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java
    sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportLoader.java
    sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportDestroyer.java
    sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java
    sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
    sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportPartitioner.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Destroyer.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Exporter.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Extractor.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Importer.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Initializer.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Loader.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Partitioner.java
Modified:
    sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnector.java
    sqoop/branches/sqoop2/connector/connector-mysql-jdbc/src/main/java/org/apache/sqoop/connector/mysqljdbc/MySqlJdbcConnector.java
    sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/connector/spi/SqoopConnector.java

Modified: sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnector.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnector.java?rev=1370203&r1=1370202&r2=1370203&view=diff
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnector.java
(original)
+++ sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnector.java
Tue Aug  7 12:24:55 2012
@@ -22,6 +22,8 @@ import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
 
+import org.apache.sqoop.job.etl.Exporter;
+import org.apache.sqoop.job.etl.Importer;
 import org.apache.sqoop.model.MForm;
 import org.apache.sqoop.model.MInput;
 import org.apache.sqoop.model.MMapInput;
@@ -33,6 +35,17 @@ public class GenericJdbcConnector implem
   private static final List<MForm> CONNECTION_FORMS = new ArrayList<MForm>();
   private static final List<MForm> JOB_FORMS = new ArrayList<MForm>();
 
+  private Importer IMPORTER = new Importer(
+      GenericJdbcImportInitializer.class,
+      GenericJdbcImportPartitioner.class,
+      GenericJdbcImportExtractor.class,
+      GenericJdbcImportDestroyer.class);
+
+  private Exporter EXPORTER = new Exporter(
+      GenericJdbcExportInitializer.class,
+      GenericJdbcExportLoader.class,
+      GenericJdbcExportDestroyer.class);
+
   static {
     // Build the connection form
     List<MInput<?>> connFormInputs = new ArrayList<MInput<?>>();
@@ -81,4 +94,14 @@ public class GenericJdbcConnector implem
     return JOB_FORMS;
   }
 
+  @Override
+  public Importer getImporter() {
+    return IMPORTER;
+  }
+
+  @Override
+  public Exporter getExporter() {
+    return EXPORTER;
+  }
+
 }

Added: sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportDestroyer.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportDestroyer.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportDestroyer.java
(added)
+++ sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportDestroyer.java
Tue Aug  7 12:24:55 2012
@@ -0,0 +1,24 @@
+/**
+ * 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.sqoop.connector.jdbc;
+
+import org.apache.sqoop.job.etl.Destroyer;
+
+public class GenericJdbcExportDestroyer extends Destroyer {
+
+}

Added: sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java
(added)
+++ sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportInitializer.java
Tue Aug  7 12:24:55 2012
@@ -0,0 +1,24 @@
+/**
+ * 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.sqoop.connector.jdbc;
+
+import org.apache.sqoop.job.etl.Initializer;
+
+public class GenericJdbcExportInitializer extends Initializer {
+
+}

Added: sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportLoader.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportLoader.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportLoader.java
(added)
+++ sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcExportLoader.java
Tue Aug  7 12:24:55 2012
@@ -0,0 +1,24 @@
+/**
+ * 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.sqoop.connector.jdbc;
+
+import org.apache.sqoop.job.etl.Loader;
+
+public class GenericJdbcExportLoader extends Loader {
+
+}

Added: sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportDestroyer.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportDestroyer.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportDestroyer.java
(added)
+++ sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportDestroyer.java
Tue Aug  7 12:24:55 2012
@@ -0,0 +1,24 @@
+/**
+ * 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.sqoop.connector.jdbc;
+
+import org.apache.sqoop.job.etl.Destroyer;
+
+public class GenericJdbcImportDestroyer extends Destroyer {
+
+}

Added: sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java
(added)
+++ sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java
Tue Aug  7 12:24:55 2012
@@ -0,0 +1,24 @@
+/**
+ * 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.sqoop.connector.jdbc;
+
+import org.apache.sqoop.job.etl.Extractor;
+
+public class GenericJdbcImportExtractor extends Extractor {
+
+}

Added: sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
(added)
+++ sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportInitializer.java
Tue Aug  7 12:24:55 2012
@@ -0,0 +1,24 @@
+/**
+ * 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.sqoop.connector.jdbc;
+
+import org.apache.sqoop.job.etl.Initializer;
+
+public class GenericJdbcImportInitializer extends Initializer {
+
+}

Added: sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportPartitioner.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportPartitioner.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportPartitioner.java
(added)
+++ sqoop/branches/sqoop2/connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportPartitioner.java
Tue Aug  7 12:24:55 2012
@@ -0,0 +1,24 @@
+/**
+ * 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.sqoop.connector.jdbc;
+
+import org.apache.sqoop.job.etl.Partitioner;
+
+public class GenericJdbcImportPartitioner extends Partitioner {
+
+}

Modified: sqoop/branches/sqoop2/connector/connector-mysql-jdbc/src/main/java/org/apache/sqoop/connector/mysqljdbc/MySqlJdbcConnector.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/connector/connector-mysql-jdbc/src/main/java/org/apache/sqoop/connector/mysqljdbc/MySqlJdbcConnector.java?rev=1370203&r1=1370202&r2=1370203&view=diff
==============================================================================
--- sqoop/branches/sqoop2/connector/connector-mysql-jdbc/src/main/java/org/apache/sqoop/connector/mysqljdbc/MySqlJdbcConnector.java
(original)
+++ sqoop/branches/sqoop2/connector/connector-mysql-jdbc/src/main/java/org/apache/sqoop/connector/mysqljdbc/MySqlJdbcConnector.java
Tue Aug  7 12:24:55 2012
@@ -22,6 +22,8 @@ import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
 
+import org.apache.sqoop.job.etl.Exporter;
+import org.apache.sqoop.job.etl.Importer;
 import org.apache.sqoop.model.MForm;
 import org.apache.sqoop.connector.spi.SqoopConnector;
 
@@ -46,4 +48,16 @@ public class MySqlJdbcConnector implemen
     // TODO Auto-generated method stub
     return JOB_FORMS;
   }
+
+  @Override
+  public Importer getImporter() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public Exporter getExporter() {
+    // TODO Auto-generated method stub
+    return null;
+  }
 }

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=1370203&r1=1370202&r2=1370203&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  7 12:24:55 2012
@@ -21,6 +21,8 @@ import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
 
+import org.apache.sqoop.job.etl.Exporter;
+import org.apache.sqoop.job.etl.Importer;
 import org.apache.sqoop.model.MForm;
 
 /**
@@ -46,4 +48,15 @@ public interface SqoopConnector {
    * by Sqoop to create a job object using this connector.
    */
   public List<MForm> getJobForms();
+
+  /**
+   * @return an <tt>Importer</tt> that provides classes for performing import.
+   */
+  public Importer getImporter();
+
+  /**
+   * @return an <tt>Exporter</tt> that provides classes for performing export.
+   */
+  public Exporter getExporter();
+
 }

Added: sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Destroyer.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Destroyer.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Destroyer.java (added)
+++ sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Destroyer.java Tue Aug
 7 12:24:55 2012
@@ -0,0 +1,26 @@
+/**
+ * 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.sqoop.job.etl;
+
+/**
+ * This allows connector to define work to complete execution, for example,
+ * resource cleaning.
+ */
+public abstract class Destroyer {
+
+}

Added: sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Exporter.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Exporter.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Exporter.java (added)
+++ sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Exporter.java Tue Aug
 7 12:24:55 2012
@@ -0,0 +1,56 @@
+/**
+ * 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.sqoop.job.etl;
+
+/**
+ * This specifies classes that perform connector-defined steps
+ * within export execution:
+ * Initializer
+ * -> (framework-defined steps)
+ * -> Loader
+ * -> Destroyer
+ */
+public class Exporter {
+
+  private Class<? extends Initializer> initializer;
+  private Class<? extends Loader> loader;
+  private Class<? extends Destroyer> destroyer;
+
+  public Exporter(
+      Class<? extends Initializer> initializer,
+      Class<? extends Loader> loader,
+      Class<? extends Destroyer> destroyer
+      ) {
+    this.initializer = initializer;
+    this.loader = loader;
+    this.destroyer = destroyer;
+  }
+
+  public Class<? extends Initializer> getInitializer() {
+    return initializer;
+  }
+
+  public Class<? extends Loader> getLoader() {
+    return loader;
+  }
+
+  public Class<? extends Destroyer> getDestroyer() {
+    return destroyer;
+  }
+
+}

Added: sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Extractor.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Extractor.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Extractor.java (added)
+++ sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Extractor.java Tue Aug
 7 12:24:55 2012
@@ -0,0 +1,26 @@
+/**
+ * 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.sqoop.job.etl;
+
+/**
+ * This allows connector to extract data from a source system
+ * based on each partition.
+ */
+public abstract class Extractor {
+
+}

Added: sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Importer.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Importer.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Importer.java (added)
+++ sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Importer.java Tue Aug
 7 12:24:55 2012
@@ -0,0 +1,62 @@
+/**
+ * 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.sqoop.job.etl;
+
+/**
+ * This specifies classes that perform connector-defined steps
+ * within import execution:
+ * Initializer
+ * -> Partitioner
+ * -> Extractor
+ * -> (framework-defined steps)
+ * -> Destroyer
+ */
+public class Importer {
+
+  private Class<? extends Initializer> initializer;
+  private Class<? extends Partitioner> partitioner;
+  private Class<? extends Extractor> extractor;
+  private Class<? extends Destroyer> destroyer;
+
+  public Importer(Class<? extends Initializer> initializer,
+      Class<? extends Partitioner> partitioner,
+      Class<? extends Extractor> extractor,
+      Class<? extends Destroyer> destroyer) {
+    this.initializer = initializer;
+    this.partitioner = partitioner;
+    this.extractor = extractor;
+    this.destroyer = destroyer;
+  }
+
+  public Class<? extends Initializer> getInitializer() {
+    return initializer;
+  }
+
+  public Class<? extends Partitioner> getPartitioner() {
+    return partitioner;
+  }
+
+  public Class<? extends Extractor> getExtractor() {
+    return extractor;
+  }
+
+  public Class<? extends Destroyer> getDestroyer() {
+    return destroyer;
+  }
+
+}

Added: sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Initializer.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Initializer.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Initializer.java (added)
+++ sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Initializer.java Tue
Aug  7 12:24:55 2012
@@ -0,0 +1,26 @@
+/**
+ * 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.sqoop.job.etl;
+
+/**
+ * This allows connector to define initialization work for execution,
+ * for example, context configuration.
+ */
+public abstract class Initializer {
+
+}

Added: sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Loader.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Loader.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Loader.java (added)
+++ sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Loader.java Tue Aug 
7 12:24:55 2012
@@ -0,0 +1,25 @@
+/**
+ * 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.sqoop.job.etl;
+
+/**
+ * This allows connector to load data into a target system.
+ */
+public abstract class Loader {
+
+}

Added: sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Partitioner.java
URL: http://svn.apache.org/viewvc/sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Partitioner.java?rev=1370203&view=auto
==============================================================================
--- sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Partitioner.java (added)
+++ sqoop/branches/sqoop2/spi/src/main/java/org/apache/sqoop/job/etl/Partitioner.java Tue
Aug  7 12:24:55 2012
@@ -0,0 +1,26 @@
+/**
+ * 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.sqoop.job.etl;
+
+/**
+ * This allows connector to define how input data to be partitioned.
+ * The number of data partitions also determines the degree of parallelism.
+ */
+public abstract class Partitioner {
+
+}



Mime
View raw message