influxdata / influxdata/influxdb-java

Batching Enhancements

オープン
#289 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
kind/enhancement
主要言語
Java
スター
1.2k
フォーク
469
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm building an InfluxDB producer that I'd like to guarantee at-least-once delivery for. My throughput requirements are high enough that batching is required. I was happy when I found BatchProcessor but then realized a couple of shortcomings that are preventing me from using it. I'd rather improve this library than create my own batch producer. Here's where the current batch implementation is falling short. Are any of these being worked on currently?

1. There's no way to request the batch buffer to be flushed and not destroy the backing thread pool. The only option I see possible today without resorting to reflection is calling `InfluxDB.disableBatch` followed by `InfluxDB.enableBatch` to force a flush but that creates a new executor every time.
1. ~~`BatchProcessor.write()` is not thread safe and may be called concurrently from `BatchProcessor.flush()` on the current thread and the scheduled timer on the thread from the pool. This results in duplicate records being sent during `flush()`.~~
1. Batching records can silently fail. I'd like to provide a callback with each asynchronous write request that would be invoked once the point is sent or if an error was encountered while attempting to send it.
1. The consistency level for all BatchPoints produced by the BatchProcessor is `ConsistencyLevel.ONE`. Direct control over the consistently level would be nice but ONE is a show stopper.

Some of the above are fairly substantial deviations in behavior from the current version. Would it be worthwhile for this to be a separate batch implementation rather than migrating the current version? Perhaps create a new asynchronous interface named `InfluxDBAsync`?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、既存の BatchProcessor API と InfluxDB.disableBatch および InfluxDB.enableBatch のフローを確認します。executor を置き換えずに flush すること、非同期のエラーコールバック、設定可能な consistency、スレッドセーフな書き込みを現在の実装に含めるのか、それとも新しい InfluxDBAsync インターフェースに含めるのかを定義します。完了条件は、選択した設計が一覧の batching 要件に対応し、delivery failure が黙って無視されないことです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
databases
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。