embulk-output-trafodion 0.1.0 → 0.1.1
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 +15 -7
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/output/trafodion/.TrafodionOutputPlugin.java.swp +0 -0
- data/src/main/java/org/embulk/output/trafodion/TrafodionOutputConnection.java +4 -3
- data/src/main/java/org/embulk/output/trafodion/TrafodionOutputPlugin.java +30 -45
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c49cb0daa08f83ab3813d5a3b847e9d5de68264
|
4
|
+
data.tar.gz: 52a25fa330e1cc9f01680ae743683c379b4b8f79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f106ecbf3b75c54784c6c6ed8972f17e59b73cc67806f02694e615717fd0feea589c60db829212f128be71b30710ce0e0a3d82564d619f8fa3c77e753f1c51d5
|
7
|
+
data.tar.gz: 4b240d590fbe19afacfb5b902bf8cc31a51226fbaa1a4c3c62b34b6c3037e0f9f327fa6cc3bd46e365da553092ccc54bf69c806946d939c55794f092d5a45cb9
|
data/README.md
CHANGED
@@ -11,22 +11,30 @@ TODO: Write short description here and build.gradle file.
|
|
11
11
|
|
12
12
|
## Configuration
|
13
13
|
|
14
|
-
- **
|
15
|
-
- **
|
16
|
-
- **
|
14
|
+
- **host**: database host name (string, required)
|
15
|
+
- **port**: database port number (integer, default: 3306)
|
16
|
+
- **user**: database login user name (string, required)
|
17
|
+
- **password**: database login password (string, default: "")
|
18
|
+
- **database**: destination database name (string, required)
|
19
|
+
- **table**: destination table name (string, required)
|
17
20
|
|
18
21
|
## Example
|
19
22
|
|
20
23
|
```yaml
|
21
24
|
out:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
+
type: trafodion
|
26
|
+
host: localhost
|
27
|
+
user: my_user
|
28
|
+
password: my_passwd
|
29
|
+
database: my_database
|
30
|
+
schema: schema_name
|
31
|
+
table: table_name
|
32
|
+
mode: insert
|
25
33
|
```
|
26
34
|
|
27
35
|
|
28
36
|
## Build
|
29
37
|
|
30
38
|
```
|
31
|
-
$ ./gradlew gem
|
39
|
+
$ ./gradlew gem
|
32
40
|
```
|
data/build.gradle
CHANGED
@@ -17,7 +17,8 @@ public class TrafodionOutputConnection
|
|
17
17
|
throws SQLException
|
18
18
|
{
|
19
19
|
super(connection,null);
|
20
|
-
|
20
|
+
System.out.println("connection------------------------------------:"+connection);
|
21
|
+
//setSearchPath(schema);
|
21
22
|
connection.setAutoCommit(autoCommit);
|
22
23
|
}
|
23
24
|
/*@Override
|
@@ -27,7 +28,7 @@ public class TrafodionOutputConnection
|
|
27
28
|
createTable(tableName, schema);
|
28
29
|
}
|
29
30
|
}*/
|
30
|
-
|
31
|
+
/*@Override
|
31
32
|
protected void setSearchPath(String schema) throws SQLException {
|
32
33
|
Statement stmt = connection.createStatement();
|
33
34
|
try {
|
@@ -37,7 +38,7 @@ public class TrafodionOutputConnection
|
|
37
38
|
} finally {
|
38
39
|
stmt.close();
|
39
40
|
}
|
40
|
-
}
|
41
|
+
}*/
|
41
42
|
@Override
|
42
43
|
protected String buildPreparedInsertSql(String toTable, JdbcSchema toTableSchema) throws SQLException
|
43
44
|
{
|
@@ -20,12 +20,18 @@ public class TrafodionOutputPlugin
|
|
20
20
|
public interface TrafodionPluginTask
|
21
21
|
extends PluginTask
|
22
22
|
{
|
23
|
-
|
23
|
+
/*@Config("host")
|
24
|
+
@ConfigDefault("null")
|
24
25
|
public String getHost();
|
25
26
|
|
26
27
|
@Config("port")
|
27
28
|
@ConfigDefault("23400")
|
28
|
-
public int getPort()
|
29
|
+
public int getPort();*/
|
30
|
+
|
31
|
+
@Config("url")
|
32
|
+
@ConfigDefault("null")
|
33
|
+
public Optional<String> getUrl();
|
34
|
+
|
29
35
|
|
30
36
|
@Config("user")
|
31
37
|
public String getUser();
|
@@ -34,12 +40,12 @@ public class TrafodionOutputPlugin
|
|
34
40
|
@ConfigDefault("\"\"")
|
35
41
|
public String getPassword();
|
36
42
|
|
37
|
-
|
38
|
-
|
39
|
-
public String getDatabase();
|
43
|
+
//@Config("database")
|
44
|
+
//@ConfigDefault("trafodion")
|
45
|
+
//public String getDatabase();
|
40
46
|
|
41
|
-
|
42
|
-
|
47
|
+
//@Config("schema")
|
48
|
+
//public String getSchema();
|
43
49
|
|
44
50
|
}
|
45
51
|
|
@@ -62,51 +68,30 @@ public class TrafodionOutputPlugin
|
|
62
68
|
{
|
63
69
|
TrafodionPluginTask trafodionTask = (TrafodionPluginTask) task;
|
64
70
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
String url=new String();
|
72
|
+
if (trafodionTask.getUrl().isPresent()) {
|
73
|
+
url = trafodionTask.getUrl().get();
|
74
|
+
} else {
|
75
|
+
// url = String.format("jdbc:t4jdbc://%s:%d/:",
|
76
|
+
// trafodionTask.getHost(), trafodionTask.getPort());
|
77
|
+
}
|
78
|
+
System.out.println("-----------------------------------"+ url);
|
79
|
+
Properties props = new Properties();
|
70
80
|
props.setProperty("rewriteBatchedStatements", "true");
|
71
81
|
props.setProperty("useCompression", "true");
|
72
|
-
|
73
|
-
props.setProperty("
|
74
|
-
|
75
|
-
|
76
|
-
// Enable keepalive based on tcp_keepalive_time, tcp_keepalive_intvl and tcp_keepalive_probes kernel parameters.
|
77
|
-
// Socket options TCP_KEEPCNT, TCP_KEEPIDLE, and TCP_KEEPINTVL are not configurable.
|
78
|
-
props.setProperty("tcpKeepAlive", "true");
|
79
|
-
//props.setProperty("schema", trafodionTask.getSchema());
|
80
|
-
// TODO
|
81
|
-
//switch t.getSssl() {
|
82
|
-
//when "disable":
|
83
|
-
// break;
|
84
|
-
//when "enable":
|
85
|
-
// props.setProperty("useSSL", "true");
|
86
|
-
// props.setProperty("requireSSL", "false");
|
87
|
-
// props.setProperty("verifyServerCertificate", "false");
|
88
|
-
// break;
|
89
|
-
//when "verify":
|
90
|
-
// props.setProperty("useSSL", "true");
|
91
|
-
// props.setProperty("requireSSL", "true");
|
92
|
-
// props.setProperty("verifyServerCertificate", "true");
|
93
|
-
// break;
|
94
|
-
//}
|
95
|
-
|
96
|
-
if (!retryableMetadataOperation) {
|
82
|
+
props.setProperty("connectTimeout", "300000"); // milliseconds
|
83
|
+
props.setProperty("socketTimeout", "1800000");
|
84
|
+
props.setProperty("tcpKeepAlive", "true");
|
85
|
+
if (!retryableMetadataOperation) {
|
97
86
|
// non-retryable batch operation uses longer timeout
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
props.putAll(trafodionTask.getOptions());
|
103
|
-
|
104
|
-
// TODO validate task.getMergeKeys is null
|
87
|
+
props.setProperty("connectTimeout", "300000"); // milliseconds
|
88
|
+
props.setProperty("socketTimeout", "2700000"); // milliseconds
|
89
|
+
}
|
90
|
+
props.putAll(trafodionTask.getOptions());
|
105
91
|
|
106
92
|
props.setProperty("user", trafodionTask.getUser());
|
107
93
|
logger.info("Connecting to {} options {}", url, props);
|
108
94
|
props.setProperty("password", trafodionTask.getPassword());
|
109
|
-
logger.info("url--------:"+url+"props-------:"+props);
|
110
95
|
return new TrafodionOutputConnector(url, props);
|
111
96
|
}
|
112
97
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-trafodion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Peng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,14 +56,15 @@ files:
|
|
56
56
|
- gradlew
|
57
57
|
- gradlew.bat
|
58
58
|
- lib/embulk/output/trafodion.rb
|
59
|
+
- src/main/java/org/embulk/output/trafodion/.TrafodionOutputPlugin.java.swp
|
59
60
|
- src/main/java/org/embulk/output/trafodion/TrafodionBatchInsert.java
|
60
61
|
- src/main/java/org/embulk/output/trafodion/TrafodionOutputConnection.java
|
61
62
|
- src/main/java/org/embulk/output/trafodion/TrafodionOutputConnector.java
|
62
63
|
- src/main/java/org/embulk/output/trafodion/TrafodionOutputPlugin.java
|
63
64
|
- src/test/java/org/embulk/output/trafodion/TestTrafodionOutputPlugin.java
|
64
|
-
- classpath/embulk-output-trafodion-0.1.0.jar
|
65
65
|
- classpath/embulk-output-jdbc-0.6.3.jar
|
66
66
|
- classpath/jdbcT4-2.2.0.jar
|
67
|
+
- classpath/embulk-output-trafodion-0.1.1.jar
|
67
68
|
homepage: https://github.com/AlexPeng19/embulk-output-trafodion
|
68
69
|
licenses:
|
69
70
|
- MIT
|