Skip to content

Commit

Permalink
Add comments.
Browse files Browse the repository at this point in the history
Signed-off-by: AndreyKoltsov1997 <[email protected]>
  • Loading branch information
AndreyKoltsov1997 committed Jun 22, 2021
1 parent 1fb9528 commit 7c6af63
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public PravegaBenchmarkTransactionProducer(String streamName, EventStreamClientF
public CompletableFuture<Void> sendAsync(Optional<String> key, byte[] payload) {
try {
if (this.probeRequested(key)) {
// write txn
this.probeTransaction(key, payload, this.eventsPerTransaction);
}
if (transaction == null) {
Expand Down Expand Up @@ -127,12 +126,12 @@ private final boolean probeRequested(Optional<String> key) {
/**
* Implements writer probe in case of transaction via populating it with ...
* ... the expected amount of events.
\ */
*/
public CompletableFuture<Void> probeTransaction(Optional<String> key, byte[] payload, final int eventsPerTxn) {
transaction = transactionWriter.beginTxn();
try {
// Populate transaction for the probeness
for (int i = 0; i< eventsPerTxn; i++) {
// Populate transaction with the sufficient amount of events
for (int i = 0; i < eventsPerTxn; i++) {
transaction.writeEvent(key.get(), ByteBuffer.wrap(payload));
}
transaction.commit();
Expand Down

0 comments on commit 7c6af63

Please sign in to comment.