Skip to content

Commit

Permalink
[EXPORTER] fix typo: targeOffset -> targetOffset (#1831)
Browse files Browse the repository at this point in the history
  • Loading branch information
chia7712 authored Jul 13, 2023
1 parent 55c83d0 commit d647b4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ protected void put(List<Record<byte[], byte[]>> records) {
}

protected boolean isValid(Record<byte[], byte[]> r) {
var targetOffset = targeOffset(r);
var targetOffset = targetOffset(r);

// If the target offset exists and the record's offset is less than the target offset,
// set the seek offset to the target offset and return false.
Expand All @@ -394,7 +394,7 @@ protected boolean isValid(Record<byte[], byte[]> r) {
* is not found.
*/
// visible for test
protected Optional<Long> targeOffset(Record<byte[], byte[]> r) {
protected Optional<Long> targetOffset(Record<byte[], byte[]> r) {
var topicMap = this.offsetForTopicPartition.get(r.topic());

// If we are unable to obtain the target offset from the 'offsetForTopicPartition' map,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -937,11 +937,11 @@ void testIsValid() {
.timestamp(System.currentTimeMillis())
.build();

Assertions.assertFalse(task.targeOffset(record1).isPresent());
Assertions.assertEquals(100, task.targeOffset(record2).orElse(null));
Assertions.assertEquals(200, task.targeOffset(record3).orElse(null));
Assertions.assertEquals(200, task.targeOffset(record4).orElse(null));
Assertions.assertFalse(task.targeOffset(record5).isPresent());
Assertions.assertFalse(task.targetOffset(record1).isPresent());
Assertions.assertEquals(100, task.targetOffset(record2).orElse(null));
Assertions.assertEquals(200, task.targetOffset(record3).orElse(null));
Assertions.assertEquals(200, task.targetOffset(record4).orElse(null));
Assertions.assertFalse(task.targetOffset(record5).isPresent());

Assertions.assertTrue(task.isValid(record1));
Assertions.assertFalse(task.isValid(record2));
Expand Down

0 comments on commit d647b4c

Please sign in to comment.