From d647b4ccfc46d9a5f9dd3dd067b06389179e7326 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Thu, 13 Jul 2023 22:10:36 +0800 Subject: [PATCH] [EXPORTER] fix typo: targeOffset -> targetOffset (#1831) --- .../java/org/astraea/connector/backup/Exporter.java | 4 ++-- .../org/astraea/connector/backup/ExporterTest.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/connector/src/main/java/org/astraea/connector/backup/Exporter.java b/connector/src/main/java/org/astraea/connector/backup/Exporter.java index 855320ec1a..2080d8dc29 100644 --- a/connector/src/main/java/org/astraea/connector/backup/Exporter.java +++ b/connector/src/main/java/org/astraea/connector/backup/Exporter.java @@ -373,7 +373,7 @@ protected void put(List> records) { } protected boolean isValid(Record 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. @@ -394,7 +394,7 @@ protected boolean isValid(Record r) { * is not found. */ // visible for test - protected Optional targeOffset(Record r) { + protected Optional targetOffset(Record r) { var topicMap = this.offsetForTopicPartition.get(r.topic()); // If we are unable to obtain the target offset from the 'offsetForTopicPartition' map, diff --git a/connector/src/test/java/org/astraea/connector/backup/ExporterTest.java b/connector/src/test/java/org/astraea/connector/backup/ExporterTest.java index 28e8d14de3..6f03beba1f 100644 --- a/connector/src/test/java/org/astraea/connector/backup/ExporterTest.java +++ b/connector/src/test/java/org/astraea/connector/backup/ExporterTest.java @@ -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));