Skip to content

Commit da8658a

Browse files
committed
[GUI] enable to set timestamp
1 parent fa46b18 commit da8658a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

common/src/main/java/org/astraea/common/admin/AdminImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public CompletionStage<Map<TopicPartition, Long>> maxTimestamps(
439439
tp ->
440440
Optional.ofNullable(result.get(TopicPartition.to(tp))).stream()
441441
.map(ListOffsetsResult.ListOffsetsResultInfo::timestamp)
442-
.filter(t -> t > 0)
442+
.filter(t -> t >= 0)
443443
.map(t -> Map.entry(tp, t)))
444444
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
445445
}

gui/src/main/java/org/astraea/gui/tab/ClientNode.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,14 @@ record -> {
527527
private static Node writeNode(Context context) {
528528
var topicKey = "topic";
529529
var partitionKey = "partition";
530+
var timestampKey = "timestamp";
530531
var keyKey = "key";
531532
var valueKey = "value";
532533
var multiInput =
533534
List.of(
534535
TextInput.required(topicKey, EditableText.singleLine().build()),
535536
TextInput.of(partitionKey, EditableText.singleLine().build()),
537+
TextInput.of(timestampKey, EditableText.singleLine().build()),
536538
TextInput.of(keyKey, EditableText.multiline().build()),
537539
TextInput.of(valueKey, EditableText.multiline().build()));
538540
var firstPart =
@@ -553,6 +555,10 @@ private static Node writeNode(Context context) {
553555
.get(partitionKey)
554556
.map(Integer::parseInt)
555557
.ifPresent(builder::partition);
558+
argument
559+
.get(timestampKey)
560+
.map(Long::parseLong)
561+
.ifPresent(builder::timestamp);
556562
argument
557563
.get(keyKey)
558564
.map(b -> Serializer.STRING.serialize(topic, List.of(), b))

0 commit comments

Comments
 (0)