embulk-input-td 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ package org.embulk.input.td.writer;
2
+
3
+ import org.embulk.spi.Column;
4
+ import org.embulk.spi.PageBuilder;
5
+ import org.msgpack.value.Value;
6
+
7
+ public abstract class AbstractValueWriter
8
+ implements ValueWriter
9
+ {
10
+ protected final Column column;
11
+ protected final int index;
12
+
13
+ protected AbstractValueWriter(Column column)
14
+ {
15
+ this.column = column;
16
+ this.index = column.getIndex();
17
+ }
18
+
19
+ @Override
20
+ public void write(Value v, PageBuilder to)
21
+ {
22
+ if (v.isNilValue()) {
23
+ to.setNull(index);
24
+ }
25
+ else {
26
+ writeNotNull(v, to);
27
+ }
28
+ }
29
+
30
+ protected abstract void writeNotNull(Value v, PageBuilder to);
31
+ }
@@ -0,0 +1,20 @@
1
+ package org.embulk.input.td.writer;
2
+
3
+ import org.embulk.spi.Column;
4
+ import org.embulk.spi.PageBuilder;
5
+ import org.msgpack.value.Value;
6
+
7
+ public class BooleanValueWriter
8
+ extends AbstractValueWriter
9
+ {
10
+ public BooleanValueWriter(Column column)
11
+ {
12
+ super(column);
13
+ }
14
+
15
+ @Override
16
+ public void writeNotNull(Value v, PageBuilder to)
17
+ {
18
+ to.setBoolean(index, v.asBooleanValue().getBoolean());
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ package org.embulk.input.td.writer;
2
+
3
+ import org.embulk.spi.Column;
4
+ import org.embulk.spi.PageBuilder;
5
+ import org.msgpack.value.Value;
6
+
7
+ public class DoubleValueWriter
8
+ extends AbstractValueWriter
9
+ {
10
+ public DoubleValueWriter(Column column)
11
+ {
12
+ super(column);
13
+ }
14
+
15
+ @Override
16
+ public void writeNotNull(Value v, PageBuilder to)
17
+ {
18
+ to.setDouble(index, v.asFloatValue().toDouble());
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ package org.embulk.input.td.writer;
2
+
3
+ import org.embulk.spi.Column;
4
+ import org.embulk.spi.PageBuilder;
5
+ import org.msgpack.value.Value;
6
+
7
+ public class JsonValueWriter
8
+ extends AbstractValueWriter
9
+ {
10
+ public JsonValueWriter(Column column)
11
+ {
12
+ super(column);
13
+ }
14
+
15
+ @Override
16
+ public void writeNotNull(Value v, PageBuilder to)
17
+ {
18
+ to.setJson(index, v);
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ package org.embulk.input.td.writer;
2
+
3
+ import org.embulk.spi.Column;
4
+ import org.embulk.spi.PageBuilder;
5
+ import org.msgpack.value.Value;
6
+
7
+ public class LongValueWriter
8
+ extends AbstractValueWriter
9
+ {
10
+ public LongValueWriter(Column column)
11
+ {
12
+ super(column);
13
+ }
14
+
15
+ @Override
16
+ public void writeNotNull(Value v, PageBuilder to)
17
+ {
18
+ to.setLong(index, v.asIntegerValue().toLong());
19
+ }
20
+ }
@@ -0,0 +1,20 @@
1
+ package org.embulk.input.td.writer;
2
+
3
+ import org.embulk.spi.Column;
4
+ import org.embulk.spi.PageBuilder;
5
+ import org.msgpack.value.Value;
6
+
7
+ public class StringValueWriter
8
+ extends AbstractValueWriter
9
+ {
10
+ public StringValueWriter(Column column)
11
+ {
12
+ super(column);
13
+ }
14
+
15
+ @Override
16
+ public void writeNotNull(Value v, PageBuilder to)
17
+ {
18
+ to.setString(index, v.asStringValue().asString());
19
+ }
20
+ }
@@ -0,0 +1,9 @@
1
+ package org.embulk.input.td.writer;
2
+
3
+ import org.embulk.spi.PageBuilder;
4
+ import org.msgpack.value.Value;
5
+
6
+ public interface ValueWriter
7
+ {
8
+ void write(Value v, PageBuilder to);
9
+ }
@@ -0,0 +1,5 @@
1
+ package org.embulk.input.td;
2
+
3
+ public class TestTdInputPlugin
4
+ {
5
+ }
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: embulk-input-td
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Muga Nishizawa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ~>
17
+ - !ruby/object:Gem::Version
18
+ version: '1.0'
19
+ name: bundler
20
+ prerelease: false
21
+ type: :development
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '10.0'
33
+ name: rake
34
+ prerelease: false
35
+ type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Loads records from Td.
42
+ email:
43
+ - muga.nishizawa@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - CHANGELOG.md
50
+ - README.md
51
+ - build.gradle
52
+ - config/checkstyle/checkstyle.xml
53
+ - config/checkstyle/default.xml
54
+ - gradle/wrapper/gradle-wrapper.jar
55
+ - gradle/wrapper/gradle-wrapper.properties
56
+ - gradlew
57
+ - gradlew.bat
58
+ - lib/embulk/input/td.rb
59
+ - src/main/java/org/embulk/input/td/TdInputPlugin.java
60
+ - src/main/java/org/embulk/input/td/writer/AbstractValueWriter.java
61
+ - src/main/java/org/embulk/input/td/writer/BooleanValueWriter.java
62
+ - src/main/java/org/embulk/input/td/writer/DoubleValueWriter.java
63
+ - src/main/java/org/embulk/input/td/writer/JsonValueWriter.java
64
+ - src/main/java/org/embulk/input/td/writer/LongValueWriter.java
65
+ - src/main/java/org/embulk/input/td/writer/StringValueWriter.java
66
+ - src/main/java/org/embulk/input/td/writer/ValueWriter.java
67
+ - src/test/java/org/embulk/input/td/TestTdInputPlugin.java
68
+ - classpath/embulk-input-td-0.1.0.jar
69
+ - classpath/hamcrest-core-1.1.jar
70
+ - classpath/jackson-annotations-2.6.7.jar
71
+ - classpath/jackson-core-2.6.7.jar
72
+ - classpath/jackson-databind-2.6.7.jar
73
+ - classpath/jackson-datatype-guava-2.6.7.jar
74
+ - classpath/jackson-datatype-json-org-2.6.7.jar
75
+ - classpath/jetty-client-9.2.2.v20140723.jar
76
+ - classpath/jetty-http-9.2.2.v20140723.jar
77
+ - classpath/jetty-io-9.2.2.v20140723.jar
78
+ - classpath/jetty-util-9.2.2.v20140723.jar
79
+ - classpath/json-20090211_1.jar
80
+ - classpath/json-simple-1.1.1.jar
81
+ - classpath/junit-4.10.jar
82
+ - classpath/td-client-0.7.24.jar
83
+ homepage: https://github.com/muga/embulk-input-td
84
+ licenses:
85
+ - Apache 2.0
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 2.1.9
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: Td input plugin for Embulk
107
+ test_files: []