Hi José, The Deferred class is indeed pretty difficult to come to grips with, which is why we don't really recommend the async API for most use cases. I've personally found the Deferred <https://github.com/OpenTSDB/async/blob/master/src/Deferred.java> class docs to be pretty useful when getting up to speed with it. Using the AsyncKuduSession is particularly tricky because it doesn't expose backpressure in an intuitive way, and it becomes very easy to accidentally have a huge number of writes buffered in the client heap (the sync client solves this by simply blocking so more rows can't be produced).
kudu-ts <https://github.com/danburkert/kudu-ts/blob/master/core/src/main/java/org/kududb/ts/core/KuduTS.java> has a little bit of code that uses the async client to open and scan tables, so it may be helpful to look over that. It doesn't use the async session, I think because it was easier just to use the sync client for writing. - Dan On Mon, Apr 9, 2018 at 3:10 AM, José Ribeiro <[email protected]> wrote: > Hello, I'm having difficulties in the AsyncKudu API. Since there isn't any > valuable examples with asynchronous kudu client, can you please help me in > this example? > > > I want to use AsyncKudu to write in the kudu database. The steps i want to > use are: > > 1. verify that the table exists; > 2. if exists, open table; > 3. write on the table; > > > Can someone explain me how to do this with AsyncKudu? I'm having trouble > in understanding the Deferred class that is always returned in every > asyncKudu method. Thank you. >
