influxdata / influxdata/influxdb-java

Batching Enhancements

Ouverte
#289 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
kind/enhancement
Langage dominant
Java
Étoiles
1.2k
Forks
469
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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`?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Examinez d’abord l’API BatchProcessor existante ainsi que le flux de InfluxDB.disableBatch et InfluxDB.enableBatch. Déterminez si le flush sans remplacer l’exécuteur, les callbacks d’erreur asynchrones, la cohérence configurable et les écritures thread-safe doivent relever de l’implémentation actuelle ou d’une nouvelle interface InfluxDBAsync. Le travail est terminé lorsque la conception retenue répond aux exigences de batching listées sans laisser les échecs de livraison silencieux.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
databases
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.