sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-2540: Sqoop2: Add RepositoryProvider for MySQL
Date Sat, 29 Aug 2015 11:53:39 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 adc4367d9 -> 46c9f01fc


SQOOP-2540: Sqoop2: Add RepositoryProvider for MySQL

(Dian Fu via Jarek Jarcec Cecho)


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

Branch: refs/heads/sqoop2
Commit: 46c9f01fc8430bdb4c50fb5d6985e4330ea0935b
Parents: adc4367
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Sat Aug 29 13:53:07 2015 +0200
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Sat Aug 29 13:53:07 2015 +0200

----------------------------------------------------------------------
 .../repository/DerbyRepositoryProvider.java     |  2 +-
 .../repository/MysqlRepositoryProvider.java     | 60 ++++++++++++++++++++
 2 files changed, 61 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/46c9f01f/common-test/src/main/java/org/apache/sqoop/common/test/repository/DerbyRepositoryProvider.java
----------------------------------------------------------------------
diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/repository/DerbyRepositoryProvider.java
b/common-test/src/main/java/org/apache/sqoop/common/test/repository/DerbyRepositoryProvider.java
index 760f74e..6c75786 100644
--- a/common-test/src/main/java/org/apache/sqoop/common/test/repository/DerbyRepositoryProvider.java
+++ b/common-test/src/main/java/org/apache/sqoop/common/test/repository/DerbyRepositoryProvider.java
@@ -35,7 +35,7 @@ public class DerbyRepositoryProvider extends RepositoryProviderBase {
     properties.put("org.apache.sqoop.repository.jdbc.handler", "org.apache.sqoop.repository.derby.DerbyRepositoryHandler");
     properties.put("org.apache.sqoop.repository.jdbc.transaction.isolation", "READ_COMMITTED");
     properties.put("org.apache.sqoop.repository.jdbc.maximum.connections", "10");
-    properties.put("org.apache.sqoop.repository.jdbc.url=jdbc:derby:memory:myDB;create",
"true");
+    properties.put("org.apache.sqoop.repository.jdbc.url", "jdbc:derby:memory:myDB;create=true");
     properties.put("org.apache.sqoop.repository.jdbc.driver", "org.apache.derby.jdbc.EmbeddedDriver");
     properties.put("org.apache.sqoop.repository.jdbc.user", "sa");
     properties.put("org.apache.sqoop.repository.jdbc.password", "");

http://git-wip-us.apache.org/repos/asf/sqoop/blob/46c9f01f/common-test/src/main/java/org/apache/sqoop/common/test/repository/MysqlRepositoryProvider.java
----------------------------------------------------------------------
diff --git a/common-test/src/main/java/org/apache/sqoop/common/test/repository/MysqlRepositoryProvider.java
b/common-test/src/main/java/org/apache/sqoop/common/test/repository/MysqlRepositoryProvider.java
new file mode 100644
index 0000000..229b339
--- /dev/null
+++ b/common-test/src/main/java/org/apache/sqoop/common/test/repository/MysqlRepositoryProvider.java
@@ -0,0 +1,60 @@
+/**
+ * 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.common.test.repository;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class MysqlRepositoryProvider extends RepositoryProviderBase {
+
+  private static final String DRIVER = "com.mysql.jdbc.Driver";
+
+  private static final String CONNECTION = System.getProperties().getProperty(
+      "sqoop.repository.mysql.jdbc.url",
+      "jdbc:mysql://localhost/test"
+  );
+
+  private static final String USERNAME = System.getProperties().getProperty(
+      "sqoop.repository.mysql.username",
+      "sqoop"
+  );
+
+  private static final String PASSWORD = System.getProperties().getProperty(
+      "sqoop.repository.mysql.password",
+      "sqoop"
+  );
+
+  @Override
+  public Map<String, String> getPropertiesMap() {
+    Map<String, String> properties = new HashMap<String, String>();
+
+    properties.put("org.apache.sqoop.repository.provider", "org.apache.sqoop.repository.JdbcRepositoryProvider");
+    properties.put("org.apache.sqoop.repository.schema.immutable", "false");
+    properties.put("org.apache.sqoop.repository.jdbc.handler", "org.apache.sqoop.repository.mysql.MySqlRepositoryHandler");
+    properties.put("org.apache.sqoop.repository.jdbc.transaction.isolation", "READ_COMMITTED");
+    properties.put("org.apache.sqoop.repository.jdbc.maximum.connections", "10");
+    properties.put("org.apache.sqoop.repository.jdbc.url", CONNECTION);
+    properties.put("org.apache.sqoop.repository.jdbc.driver", DRIVER);
+    properties.put("org.apache.sqoop.repository.jdbc.user", USERNAME);
+    properties.put("org.apache.sqoop.repository.jdbc.password", PASSWORD);
+
+    return properties;
+  }
+
+}


Mime
View raw message