embulk-filter-speedometer 0.2.2 → 0.2.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25a84966e8bb8be6e69b29e014ee10b6569c645d
|
4
|
+
data.tar.gz: 6e0073adb00e1fa9076898177602155c4382e67e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6b580ef514a8cca77bed243f05ebf02f41887cf5b33d602959fcdfa9171395f3329f063ff7b6333c4dff932ffcbd70c7e06a595642971693d3e1e305d84bb59
|
7
|
+
data.tar.gz: 43a7d51da77945c8245c9276da9f9d04694e5a87d2ac76ac5d875a7350c18f00d349c452b57c692ef027d2e72aa42c5509e0014ecc5fc32d058f733629c9682c
|
data/build.gradle
CHANGED
@@ -82,47 +82,46 @@ public class SpeedometerFilterPlugin
|
|
82
82
|
private final Schema schema;
|
83
83
|
private final ImmutableMap<Column, TimestampFormatter> timestampMap;
|
84
84
|
private final PageOutput pageOutput;
|
85
|
-
private final PageOutput addOnlyPageOutput;
|
86
85
|
private final PageReader pageReader;
|
87
86
|
private final BufferAllocator allocator;
|
88
87
|
private final int delimiterLength;
|
89
88
|
private final int recordPaddingSize;
|
89
|
+
private final PageBuilder pageBuilder;
|
90
90
|
|
91
91
|
SpeedControlPageOutput(PluginTask task, Schema schema, PageOutput pageOutput) {
|
92
92
|
this.controller = new SpeedometerSpeedController(task, SpeedometerSpeedAggregator.getInstance());
|
93
93
|
this.schema = schema;
|
94
94
|
this.pageOutput = pageOutput;
|
95
|
-
this.addOnlyPageOutput = new AddOnlyPageOutput(pageOutput);
|
96
95
|
this.allocator = task.getBufferAllocator();
|
97
96
|
this.delimiterLength = task.getDelimiter().length();
|
98
97
|
this.recordPaddingSize = task.getRecordPaddingSize();
|
99
|
-
pageReader = new PageReader(schema);
|
100
|
-
timestampMap = buildTimestampFormatterMap(task, schema);
|
98
|
+
this.pageReader = new PageReader(schema);
|
99
|
+
this.timestampMap = buildTimestampFormatterMap(task, schema);
|
100
|
+
this.pageBuilder = new PageBuilder(allocator, schema, pageOutput);
|
101
101
|
}
|
102
102
|
|
103
103
|
@Override
|
104
104
|
public void add(Page page) {
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
pageBuilder.addRecord();
|
113
|
-
}
|
114
|
-
pageBuilder.finish();
|
105
|
+
ColumnVisitorImpl visitor = new ColumnVisitorImpl(pageBuilder);
|
106
|
+
pageReader.setPage(page);
|
107
|
+
while (pageReader.nextRecord()) {
|
108
|
+
visitor.speedMonitorStartRecord();
|
109
|
+
schema.visitColumns(visitor);
|
110
|
+
visitor.speedMonitorEndRecord();
|
111
|
+
pageBuilder.addRecord();
|
115
112
|
}
|
116
113
|
}
|
117
114
|
|
118
115
|
@Override
|
119
116
|
public void finish() {
|
117
|
+
pageBuilder.finish();
|
120
118
|
pageOutput.finish();
|
121
119
|
}
|
122
120
|
|
123
121
|
@Override
|
124
122
|
public void close() {
|
125
123
|
controller.stop();
|
124
|
+
pageBuilder.close();
|
126
125
|
pageReader.close();
|
127
126
|
pageOutput.close();
|
128
127
|
}
|
@@ -157,25 +156,6 @@ public class SpeedometerFilterPlugin
|
|
157
156
|
return builder.build();
|
158
157
|
}
|
159
158
|
|
160
|
-
// Ignore finish and close to avoid closing upper output stream.
|
161
|
-
static class AddOnlyPageOutput implements PageOutput {
|
162
|
-
protected final PageOutput output;
|
163
|
-
|
164
|
-
public AddOnlyPageOutput(PageOutput outptut) {
|
165
|
-
this.output = outptut;
|
166
|
-
}
|
167
|
-
|
168
|
-
@Override
|
169
|
-
public void add(Page page) {
|
170
|
-
output.add(page);
|
171
|
-
}
|
172
|
-
|
173
|
-
@Override
|
174
|
-
public void finish() { }
|
175
|
-
|
176
|
-
@Override
|
177
|
-
public void close() { }
|
178
|
-
}
|
179
159
|
|
180
160
|
class ColumnVisitorImpl implements ColumnVisitor {
|
181
161
|
private final PageBuilder pageBuilder;
|
@@ -69,8 +69,8 @@ public class TestSpeedometerFilterPlugin
|
|
69
69
|
|
70
70
|
new Verifications() {{
|
71
71
|
taskSource.loadTask(PluginTask.class); times = 1;
|
72
|
-
builder.finish(); times = 1;
|
73
72
|
builder.addRecord(); times = 1;
|
73
|
+
builder.finish(); times = 0;
|
74
74
|
reader.nextRecord(); times = 2;
|
75
75
|
reader.setPage(page); times = 1;
|
76
76
|
schema.visitColumns(withInstanceOf(ColumnVisitor.class)); times = 2;
|
@@ -90,6 +90,7 @@ public class TestSpeedometerFilterPlugin
|
|
90
90
|
|
91
91
|
new Verifications() {{
|
92
92
|
taskSource.loadTask(PluginTask.class); times = 1;
|
93
|
+
builder.finish(); times = 1;
|
93
94
|
inPageOutput.finish(); times = 1;
|
94
95
|
}};
|
95
96
|
}
|
@@ -107,6 +108,7 @@ public class TestSpeedometerFilterPlugin
|
|
107
108
|
|
108
109
|
new Verifications() {{
|
109
110
|
taskSource.loadTask(PluginTask.class); times = 1;
|
111
|
+
builder.close(); times = 1;
|
110
112
|
reader.close(); times = 1;
|
111
113
|
inPageOutput.close(); times = 1;
|
112
114
|
}};
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-speedometer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
14
|
requirement: !ruby/object:Gem::Requirement
|
21
15
|
requirements:
|
22
16
|
- - ~>
|
23
17
|
- !ruby/object:Gem::Version
|
24
18
|
version: '1.0'
|
19
|
+
name: bundler
|
25
20
|
prerelease: false
|
26
21
|
type: :development
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
|
-
- -
|
24
|
+
- - ~>
|
32
25
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
35
29
|
requirements:
|
36
30
|
- - '>='
|
37
31
|
- !ruby/object:Gem::Version
|
38
32
|
version: '10.0'
|
33
|
+
name: rake
|
39
34
|
prerelease: false
|
40
35
|
type: :development
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
41
|
description: Write log message of processed bytes and throughput periodically.
|
42
42
|
email:
|
43
43
|
- hiroki.ata@gmail.com
|
@@ -62,7 +62,7 @@ files:
|
|
62
62
|
- src/test/java/org/embulk/filter/TestSpeedometerSpeedAggregator.java
|
63
63
|
- src/test/java/org/embulk/filter/TestSpeedometerSpeedController.java
|
64
64
|
- src/test/java/org/embulk/filter/TestSpeedometerUtil.java
|
65
|
-
- classpath/embulk-filter-speedometer-0.2.
|
65
|
+
- classpath/embulk-filter-speedometer-0.2.3.jar
|
66
66
|
homepage: https://github.com/hata/embulk-filter-speedometer
|
67
67
|
licenses:
|
68
68
|
- MIT
|