APIs used in this operation
The first 6 APIs are defined in the header file
hb_put_create(): Creates a structure for the put operation and returns its handle.
hb_mutation_set_table(): Sets the name of the table for the put operation.
hb_mutation_set_bufferable(): Sets whether or not the RPC call for the put operation can be buffered on the client side.
hb_put_add_cell(): Adds a cell to the put structure. The row key of the cell must be the same as the row key of the put structure.
hb_mutation_send(): Queues the put operation for sending to the server. Mutations are not performed atomically and can be batched in a non-deterministic way on either the client side or the server side. Any buffer attached to a mutation object (put or delete) must not be altered until the callback has been received.
The last API is defined in the header file
hb_client_flush(): Flushes any buffered client-side write operations to the server. The callback is invoked after everything that was buffered at the time of the call is flushed. Invocation of the callback is a guarantee that all outstanding RPC calls are complete.
Sequence of steps in this code extract
- Create a row object named row_data.
- Create a put object.
- Specify the name of the table.
- Set whether or not the RPC call for the put operation can be buffered on the client side.
- Create cell data.
- Create a cell.
- Add the cell to the row.
- Queue the put.
- After following the steps above 10 times, flush the puts to the server.
- Wait for the RPC calls to complete.