Skip to content

Commit

Permalink
Revert "Fixing bug for addUserRecord"
Browse files Browse the repository at this point in the history
This reverts commit cad162c.
  • Loading branch information
aakkem committed Mar 6, 2024
1 parent 3de7373 commit 47d2c7d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,9 @@ public ListenableFuture<UserRecordResult> addUserRecord(String stream, String pa
* (inclusive).
* @param data
* Binary data of the record. Maximum size 1MiB.
* @return A future for the result of the put.
* @param streamARN
* ARN of the stream, e.g., arn:aws:kinesis:us-east-2:123456789012:stream/mystream
* @return A future for the result of the put.
* @throws IllegalArgumentException
* if input does not meet stated constraints
* @throws DaemonException
Expand Down Expand Up @@ -720,8 +720,6 @@ public ListenableFuture<UserRecordResult> addUserRecord(String stream, String pa
* with value between 0 and <code>2^128 - 1</code> (inclusive).
* @param data
* Binary data of the record. Maximum size 1MiB.
* @param schema
* Defines structure and format of a data record.
* @return A future for the result of the put.
* @throws IllegalArgumentException
* if input does not meet stated constraints
Expand All @@ -736,74 +734,6 @@ public ListenableFuture<UserRecordResult> addUserRecord(String stream, String pa
public ListenableFuture<UserRecordResult> addUserRecord(String stream, String partitionKey, String explicitHashKey, ByteBuffer data, Schema schema) {
return addUserRecord(stream, partitionKey, explicitHashKey, data, null, schema);
}

/**
* Put a record asynchronously. A {@link ListenableFuture} is returned that
* can be used to retrieve the result, either by polling or by registering a
* callback.
*
* <p>
* The return value can be disregarded if you do not wish to process the
* result. Under the covers, the KPL will automatically reattempt puts in
* case of transient errors (including throttling). A failed result is
* generally returned only if an irrecoverable error is detected (e.g.
* trying to put to a stream that doesn't exist), or if the record expires.
*
* <p>
* <b>Thread safe.</b>
*
* <p>
* To add a listener to the future:
* <p>
* <code>
* ListenableFuture&lt;PutRecordResult&gt; f = myKinesisProducer.addUserRecord(...);
* com.google.common.util.concurrent.Futures.addCallback(f, callback, executor);
* </code>
* <p>
* where <code>callback</code> is an instance of
* {@link com.google.common.util.concurrent.FutureCallback} and
* <code>executor</code> is an instance of
* {@link java.util.concurrent.Executor}.
* <p>
* <b>Important:</b>
* <p>
* If long-running tasks are performed in the callbacks, it is recommended
* that a custom executor be provided when registering callbacks to ensure
* that there are enough threads to achieve the desired level of
* parallelism. By default, the KPL will use an internal thread pool to
* execute callbacks, but this pool may not have a sufficient number of
* threads if a large number is desired.
* <p>
* Another option would be to hand the result off to a different component
* for processing and keep the callback routine fast.
*
* @param stream
* Stream to put to.
* @param partitionKey
* Partition key. Length must be at least one, and at most 256
* (inclusive).
* @param explicitHashKey
* The hash value used to explicitly determine the shard the data
* record is assigned to by overriding the partition key hash.
* Must be a valid string representation of a positive integer
* with value between 0 and <code>2^128 - 1</code> (inclusive).
* @param data
* Binary data of the record. Maximum size 1MiB.
*
* @param schema
* Defines structure and format of a data record.
* @param streamARN
* ARN of the stream, e.g., arn:aws:kinesis:us-east-2:123456789012:stream/mystream
* @return A future for the result of the put.
* @throws IllegalArgumentException
* if input does not meet stated constraints
* @throws DaemonException
* if the child process is dead
* @see ListenableFuture
* @see UserRecordResult
* @see KinesisProducerConfiguration#setRecordTtl(long)
* @see UserRecordFailedException
*/
@Override
public ListenableFuture<UserRecordResult> addUserRecord(String stream, String partitionKey, String explicitHashKey, ByteBuffer data, String streamARN, Schema schema) {
if (stream == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public UserRecord(String streamName, String partitionKey, String explicitHashKey
this.data = data;
this.schema = schema;
}

public UserRecord(String streamName, String partitionKey, String explicitHashKey, ByteBuffer data, String streamARN, Schema schema) {
this.streamName = streamName;
this.partitionKey = partitionKey;
Expand Down

0 comments on commit 47d2c7d

Please sign in to comment.