Skip to content

Instantly share code, notes, and snippets.

View civitaspo's full-sized avatar
❄️

Takahiro Nakayama civitaspo

❄️
View GitHub Profile
@civitaspo
civitaspo / output.txt
Created February 3, 2016 12:08
s3 から file にデータを格納するときに遭遇したエラー(これでは落ちない)
embulk -J-Dio.netty.leakDetectionLevel=advanced run config.yml -b embulk-bundle
...
2016-02-02 23:25:14.309 +0900 [ERROR] (task-0311): LEAK: ByteBuf.release() was not called before it's garbage-collected.
Recent access records: 0
Created at:
io.netty.util.ResourceLeakDetector.open(ResourceLeakDetector.java:163)
io.netty.buffer.AbstractByteBufAllocator.toLeakAwareBuffer(AbstractByteBufAllocator.java:42)
io.netty.buffer.PooledByteBufAllocator.newHeapBuffer(PooledByteBufAllocator.java:228)
io.netty.buffer.AbstractByteBufAllocator.heapBuffer(AbstractByteBufAllocator.java:136)
io.netty.buffer.AbstractByteBufAllocator.heapBuffer(AbstractByteBufAllocator.java:127)
@civitaspo
civitaspo / how_to_write_embulk_plugin_test.md
Last active November 1, 2015 09:40
Qiita投稿用draft: Embulk Plugin の Task の書き方

はじめに

これまでEmbulkのPluginをいくつか書かせてもらってきましたが、初期の頃はテスト用のAPIが整備されていなくて後回しにしてきました。 この記事は、そろそろ書かねばという気持ちになり、奮闘した時のメモです。良かったら参考にしてくだい。

おことわり

  • Pluginの単体テストに焦点を絞ってます。クラスやメソッドの単体テストは普通に書けると思うので省略します。
  • 現存するPluginのテストやEmbulkのコードを参考にして書いてますが、これよりいい方法があるかもなので知っている方がいたら教えて下さい。
  • Encoder/Decoderでも同じ方法でテストできるのか試してません。(-> ためす)
  • Javaを書き始めて、まだ日が浅いので作法などで問題有りましたら、連絡いただけると嬉しいです。
@civitaspo
civitaspo / default.css
Last active August 29, 2015 14:12 — forked from leiming/default.css
.ace_editor{position:relative;overflow:hidden;font-family:'Microsoft Yahei','Menlo','Ubuntu Mono','Consolas','source-code-pro',monospace;font-size:12px;line-height:normal;color:black;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none}
.ace_scroller{position:absolute;overflow:hidden;top:0;bottom:0;background-color:inherit}
.ace_content{position:absolute;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:text}
.ace_dragging,.ace_dragging *{cursor:move !important}
.ace_dragging .ace_scroller:before{position:absolute;top:0;left:0;right:0;bottom:0;content:'';background:rgba(250,250,250,0.01);z-index:1000}
.ace_dragging.ace_dark .ace_scroller:before{background:rgba(0,0,0,0.01)}
.ace_selecting,.ace_selecting *{cursor:text !important}
.ace_gutter{position:absolute;overflow:hidden;width:auto;top:0;bottom:0;left:0;cursor:default;z-index:4}
.ace_gutter-active-line{position:absolute;left:0;right:0}
.ace_scroller.ace_scroll-left{box-shadow:17px 0 16px -1
@civitaspo
civitaspo / Study_OOP.md
Last active December 23, 2015 01:09
Study_OOP

継承による拡張性の追加

関数を直接継承するのではなく、クラス変数、そして関数のパラメータ となる関数を継承する・させることで、設計思想や、インターフェースを残しながら、 大きく拡張することが可能になる。

以下に自身のvalueを出力する3つの例を示す。

  • 直に継承してオーバーライドする場合(拡張性小)
  • 直接、to_valuesがオーバーライドされる