embulk-output-mysql 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/classpath/embulk-output-jdbc-0.2.0.jar +0 -0
- data/classpath/embulk-output-mysql-0.2.0.jar +0 -0
- data/src/main/java/org/embulk/output/MySQLOutputPlugin.java +35 -6
- metadata +4 -4
- data/classpath/embulk-output-jdbc-0.1.2.jar +0 -0
- data/classpath/embulk-output-mysql-0.1.2.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94635a7b141b413cc4e583e31036be36278321bd
|
4
|
+
data.tar.gz: cd69087a64a2f6182ba24b787defcbff9b95941d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d50235ae89dfa0208e54c920728306745ba1f82d9ac5513fe56d925cd985f715b6811711bc442c81c91f4050c7df7ac0782db53f91f7e1525e66261fbea259fa
|
7
|
+
data.tar.gz: c54ef01b29c2472511676dc6cf185af0cf960396e0ee93e8556e687892a249d78e53c64e866eac62acd2efcc60d24fc549360994859fdd7d0cf65da2d7cba51f
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ MySQL output plugins for Embulk loads records to MySQL.
|
|
17
17
|
- **user**: database login user name (string, required)
|
18
18
|
- **password**: database login password (string, default: "")
|
19
19
|
- **database**: destination database name (string, required)
|
20
|
-
- **table**: destination name (string, required)
|
20
|
+
- **table**: destination table name (string, required)
|
21
21
|
- **mode**: "replace" or "insert" (string, required)
|
22
22
|
- **batch_size**: size of a single batch insert (integer, default: 16777216)
|
23
23
|
- **options**: extra connection properties (hash, default: {})
|
Binary file
|
Binary file
|
@@ -5,6 +5,8 @@ import java.io.IOException;
|
|
5
5
|
import java.sql.SQLException;
|
6
6
|
import java.sql.Connection;
|
7
7
|
import org.embulk.spi.Exec;
|
8
|
+
import org.embulk.config.Config;
|
9
|
+
import org.embulk.config.ConfigDefault;
|
8
10
|
import org.embulk.output.jdbc.AbstractJdbcOutputPlugin;
|
9
11
|
import org.embulk.output.jdbc.JdbcOutputConnection;
|
10
12
|
import org.embulk.output.jdbc.BatchInsert;
|
@@ -15,17 +17,44 @@ import org.embulk.output.mysql.MySQLBatchInsert;
|
|
15
17
|
public class MySQLOutputPlugin
|
16
18
|
extends AbstractJdbcOutputPlugin
|
17
19
|
{
|
18
|
-
|
20
|
+
public interface MySQLPluginTask
|
21
|
+
extends PluginTask
|
22
|
+
{
|
23
|
+
@Config("host")
|
24
|
+
public String getHost();
|
25
|
+
|
26
|
+
@Config("port")
|
27
|
+
@ConfigDefault("3306")
|
28
|
+
public int getPort();
|
29
|
+
|
30
|
+
@Config("user")
|
31
|
+
public String getUser();
|
32
|
+
|
33
|
+
@Config("password")
|
34
|
+
@ConfigDefault("\"\"")
|
35
|
+
public String getPassword();
|
36
|
+
|
37
|
+
@Config("database")
|
38
|
+
public String getDatabase();
|
39
|
+
}
|
40
|
+
|
41
|
+
@Override
|
42
|
+
protected Class<? extends PluginTask> getTaskClass()
|
43
|
+
{
|
44
|
+
return MySQLPluginTask.class;
|
45
|
+
}
|
19
46
|
|
20
47
|
@Override
|
21
48
|
protected MySQLOutputConnector getConnector(PluginTask task, boolean retryableMetadataOperation)
|
22
49
|
{
|
50
|
+
MySQLPluginTask t = (MySQLPluginTask) task;
|
51
|
+
|
23
52
|
String url = String.format("jdbc:mysql://%s:%d/%s",
|
24
|
-
|
53
|
+
t.getHost(), t.getPort(), t.getDatabase());
|
25
54
|
|
26
55
|
Properties props = new Properties();
|
27
|
-
props.setProperty("user",
|
28
|
-
props.setProperty("password",
|
56
|
+
props.setProperty("user", t.getUser());
|
57
|
+
props.setProperty("password", t.getPassword());
|
29
58
|
|
30
59
|
props.setProperty("rewriteBatchedStatements", "true");
|
31
60
|
props.setProperty("useCompression", "true");
|
@@ -38,7 +67,7 @@ public class MySQLOutputPlugin
|
|
38
67
|
props.setProperty("tcpKeepAlive", "true");
|
39
68
|
|
40
69
|
// TODO
|
41
|
-
//switch
|
70
|
+
//switch t.getSssl() {
|
42
71
|
//when "disable":
|
43
72
|
// break;
|
44
73
|
//when "enable":
|
@@ -59,7 +88,7 @@ public class MySQLOutputPlugin
|
|
59
88
|
props.setProperty("socketTimeout", "2700000"); // milliseconds
|
60
89
|
}
|
61
90
|
|
62
|
-
props.putAll(
|
91
|
+
props.putAll(t.getOptions());
|
63
92
|
|
64
93
|
return new MySQLOutputConnector(url, props);
|
65
94
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-mysql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Inserts or updates records to a table.
|
14
14
|
email:
|
@@ -24,8 +24,8 @@ files:
|
|
24
24
|
- src/main/java/org/embulk/output/mysql/MySQLBatchInsert.java
|
25
25
|
- src/main/java/org/embulk/output/mysql/MySQLOutputConnection.java
|
26
26
|
- src/main/java/org/embulk/output/mysql/MySQLOutputConnector.java
|
27
|
-
- classpath/embulk-output-jdbc-0.
|
28
|
-
- classpath/embulk-output-mysql-0.
|
27
|
+
- classpath/embulk-output-jdbc-0.2.0.jar
|
28
|
+
- classpath/embulk-output-mysql-0.2.0.jar
|
29
29
|
- classpath/mysql-connector-java-5.1.34.jar
|
30
30
|
homepage: https://github.com/embulk/embulk-output-jdbc
|
31
31
|
licenses:
|
Binary file
|
Binary file
|