embulk-parser-msgpack 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02d42733c20beaa314ee728fca703acd275da949
4
- data.tar.gz: 50f8a86fd2c6b0c9ca3d32bdab8c41af09b01f77
3
+ metadata.gz: 7852f340a79e6fa5ee4e84b60f0e70f2a1e634d0
4
+ data.tar.gz: ab593bc630bee5d34bb52c492dda9df450ea58c7
5
5
  SHA512:
6
- metadata.gz: 89e4fb93b4e76029c963a0698dd3c5d3c251f5a9dc0f3b20310e2547ed1579b896514d68636919efe6cfa74ecb8532ee3b1f6bfbc4b97089d2742ca3ace7d6f8
7
- data.tar.gz: 25935710a08fdeed77bc37fb2f6a4b1ddf30fc4884d897d48bef7f0114aec72df2d1459629956456078e193e19129903c7ae49188cb849c2002d71a8fbf3de21
6
+ metadata.gz: 210f1798c5be558170b1c56de7cff0b6ed7d33a3c0c6cddbff89ca8bcdc5486fff1702bcaa9a2a8868df779b896987181b4f1d837c7b7601617a5c7f1fb9386d
7
+ data.tar.gz: fa32cf2e37796712e68a57ad113dda7a154675c2714883c666d8d02360b8aa298f21e017739c0690244a15a5cbb55b92016dfb8260787ec1ff39f8eadd68147c
data/ChangeLog CHANGED
@@ -1,7 +1,10 @@
1
- Release 0.1.2 - 2016-01-05
1
+ Release 0.1.3 - 2016-01-05
2
2
 
3
- * Fixed memory leak of input buffers
4
3
  * Upgraded msgpack version to v0.8 which supports external buffer pools
4
+ * Fixed memory leak of input buffers
5
+ * Upgraded embulk version to v0.7.10
6
+
7
+ Release 0.1.2 - 2016-01-05
5
8
 
6
9
  Release 0.1.1 - 2015-08-18
7
10
 
data/build.gradle CHANGED
@@ -13,12 +13,12 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.1.2"
16
+ version = "0.1.3"
17
17
 
18
18
  dependencies {
19
- compile "org.embulk:embulk-core:0.6.22"
20
- provided "org.embulk:embulk-core:0.6.22"
21
- compile "org.msgpack:msgpack-core:0.7.0-M6"
19
+ compile "org.embulk:embulk-core:0.7.10"
20
+ provided "org.embulk:embulk-core:0.7.10"
21
+ compile "org.msgpack:msgpack-core:0.8.0"
22
22
  testCompile "junit:junit:4.+"
23
23
  }
24
24
 
Binary file
@@ -10,8 +10,10 @@ import com.google.common.base.Optional;
10
10
  import com.google.common.collect.ImmutableMap;
11
11
  import com.fasterxml.jackson.annotation.JsonCreator;
12
12
  import com.fasterxml.jackson.annotation.JsonValue;
13
+ import org.msgpack.core.MessagePack;
13
14
  import org.msgpack.core.MessageFormat;
14
15
  import org.msgpack.core.MessageUnpacker;
16
+ import org.msgpack.core.MessageInsufficientBufferException;
15
17
  import org.msgpack.core.buffer.MessageBuffer;
16
18
  import org.msgpack.core.buffer.MessageBufferInput;
17
19
  import org.msgpack.value.ValueType;
@@ -153,6 +155,7 @@ public class MsgpackParserPlugin
153
155
  implements MessageBufferInput
154
156
  {
155
157
  private final FileInput input;
158
+ private Buffer lastBuffer = null;
156
159
 
157
160
  public FileInputMessageBufferInput(FileInput input)
158
161
  {
@@ -163,28 +166,28 @@ public class MsgpackParserPlugin
163
166
  public MessageBuffer next()
164
167
  {
165
168
  Buffer b = input.poll();
169
+ if (lastBuffer != null) {
170
+ lastBuffer.release();
171
+ }
172
+ lastBuffer = b;
166
173
  if (b == null) {
167
- throw new EndOfBufferException();
174
+ return null;
175
+ }
176
+ else {
177
+ return MessageBuffer.wrap(b.array()).slice(b.offset(), b.limit());
168
178
  }
169
- return MessageBuffer.wrap(b.array()).slice(b.offset(), b.limit());
170
179
  }
171
180
 
172
181
  @Override
173
182
  public void close()
174
183
  {
184
+ if (lastBuffer != null) {
185
+ lastBuffer.release();
186
+ }
175
187
  input.close();
176
188
  }
177
189
  }
178
190
 
179
- private static class EndOfBufferException
180
- extends RuntimeException
181
- {
182
- public EndOfBufferException()
183
- {
184
- super("End of buffer");
185
- }
186
- }
187
-
188
191
  @Override
189
192
  public void transaction(ConfigSource config, ParserPlugin.Control control)
190
193
  {
@@ -202,7 +205,7 @@ public class MsgpackParserPlugin
202
205
  RowEncoding rowEncoding = task.getRowEncoding();
203
206
  FileEncoding fileEncoding = task.getFileEncoding();
204
207
 
205
- try (MessageUnpacker unpacker = new MessageUnpacker(new FileInputMessageBufferInput(input));
208
+ try (MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(new FileInputMessageBufferInput(input));
206
209
  PageBuilder pageBuilder = new PageBuilder(task.getBufferAllocator(), schema, output)) {
207
210
 
208
211
  TimestampParser[] timestampParsers = Timestamps.newTimestampColumnParsers(task, task.getSchemaConfig());
@@ -365,7 +368,7 @@ public class MsgpackParserPlugin
365
368
  int n;
366
369
  try {
367
370
  n = unpacker.unpackArrayHeader();
368
- } catch (EndOfBufferException ex) {
371
+ } catch (MessageInsufficientBufferException ex) {
369
372
  // TODO EOFException?
370
373
  return false;
371
374
  }
@@ -398,7 +401,7 @@ public class MsgpackParserPlugin
398
401
  int n;
399
402
  try {
400
403
  n = unpacker.unpackMapHeader();
401
- } catch (EndOfBufferException ex) {
404
+ } catch (MessageInsufficientBufferException ex) {
402
405
  // TODO EOFException?
403
406
  return false;
404
407
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-parser-msgpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-05 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -58,8 +58,8 @@ files:
58
58
  - lib/embulk/parser/msgpack.rb
59
59
  - src/main/java/org/embulk/parser/msgpack/MsgpackParserPlugin.java
60
60
  - src/test/java/org/embulk/parser/TestMsgpackParserPlugin.java
61
- - classpath/embulk-parser-msgpack-0.1.2.jar
62
- - classpath/msgpack-core-0.7.0-M6.jar
61
+ - classpath/embulk-parser-msgpack-0.1.3.jar
62
+ - classpath/msgpack-core-0.8.0.jar
63
63
  homepage: https://github.com/frsyuki/embulk-parser-msgpack
64
64
  licenses:
65
65
  - Apache 2.0
Binary file