-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Message Search Functionality (#288)
* Added search message page * Overhaul search functionality protoype. Improved performance by not reading the entire topic into memory and having a safetly limit on the number of messages to read befor the search aborts. Added a maximum results count. Added a date filter to allow user to specify which timestamp to start searching from. Added better output. * Fix bad merge * Remove redundant class * Remove redundant file * Make pom customizable for our needs * Fix formatting and input a bit * Update search message page card layout * Standardize code formatting * Addressed compilation errors and refactored Refactored to increase maintainability * Removed impossible end state REACHED_END_OF_TIMESPAN --------- Co-authored-by: pedro lastra <[email protected]> Co-authored-by: Nathan Daniels <[email protected]> Co-authored-by: Bert Roos <[email protected]> Co-authored-by: Bert Roos <[email protected]>
- Loading branch information
1 parent
92bc60a
commit ed9d1cd
Showing
11 changed files
with
654 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ settings.xml | |
kafka.properties* | ||
kafka.truststore.jks* | ||
kafka.keystore.jks* | ||
/.vs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package kafdrop.form; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import jakarta.validation.constraints.Max; | ||
import jakarta.validation.constraints.Min; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import kafdrop.util.MessageFormat; | ||
import org.springframework.format.annotation.DateTimeFormat; | ||
|
||
import java.util.Date; | ||
|
||
public class SearchMessageForm { | ||
|
||
@NotBlank | ||
private String searchText; | ||
|
||
@NotNull | ||
@Min(1) | ||
@Max(1000) | ||
private Integer maximumCount; | ||
|
||
private MessageFormat format; | ||
|
||
private MessageFormat keyFormat; | ||
|
||
private String descFile; | ||
|
||
private String msgTypeName; | ||
|
||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") | ||
private Date startTimestamp; | ||
|
||
public SearchMessageForm(String searchText, MessageFormat format) { | ||
this.searchText = searchText; | ||
this.format = format; | ||
} | ||
|
||
public Date getStartTimestamp() { | ||
return startTimestamp; | ||
} | ||
|
||
public void setStartTimestamp(Date startTimestamp) { | ||
this.startTimestamp = startTimestamp; | ||
} | ||
|
||
public SearchMessageForm(String searchText) { | ||
this(searchText, MessageFormat.DEFAULT); | ||
} | ||
|
||
public SearchMessageForm() { | ||
} | ||
|
||
@JsonIgnore | ||
public boolean isEmpty() { | ||
return searchText == null || searchText.isEmpty(); | ||
} | ||
|
||
public String getSearchText() { | ||
return searchText; | ||
} | ||
|
||
public void setSearchText(String searchText) { | ||
this.searchText = searchText; | ||
} | ||
|
||
public Integer getMaximumCount() { | ||
return maximumCount; | ||
} | ||
|
||
public void setMaximumCount(Integer maximumCount) { | ||
this.maximumCount = maximumCount; | ||
} | ||
|
||
public MessageFormat getKeyFormat() { | ||
return keyFormat; | ||
} | ||
|
||
public void setKeyFormat(MessageFormat keyFormat) { | ||
this.keyFormat = keyFormat; | ||
} | ||
|
||
public MessageFormat getFormat() { | ||
return format; | ||
} | ||
|
||
public void setFormat(MessageFormat format) { | ||
this.format = format; | ||
} | ||
|
||
public String getDescFile() { | ||
return descFile; | ||
} | ||
|
||
public void setDescFile(String descFile) { | ||
this.descFile = descFile; | ||
} | ||
|
||
public String getMsgTypeName() { | ||
return msgTypeName; | ||
} | ||
|
||
public void setMsgTypeName(String msgTypeName) { | ||
this.msgTypeName = msgTypeName; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2021 Kafdrop contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* | ||
*/ | ||
|
||
package kafdrop.model; | ||
|
||
import java.util.List; | ||
|
||
public final class SearchResultsVO { | ||
private List<MessageVO> messages; | ||
|
||
private String completionDetails; | ||
|
||
public List<MessageVO> getMessages() { | ||
return messages; | ||
} | ||
|
||
public String getCompletionDetails() { | ||
return completionDetails; | ||
} | ||
|
||
public void setCompletionDetails(String completionDetails) { | ||
this.completionDetails = completionDetails; | ||
} | ||
|
||
public void setMessages(List<MessageVO> messages) { | ||
this.messages = messages; | ||
} | ||
} |
Oops, something went wrong.