You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/09/09 20:22:38 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9359: Improve segment name check in metadata push

Jackie-Jiang commented on code in PR #9359:
URL: https://github.com/apache/pinot/pull/9359#discussion_r967435756


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/name/SegmentNameGenerator.java:
##########
@@ -37,7 +37,7 @@ public interface SegmentNameGenerator extends Serializable {
    * @param segmentName provide segment name
    * @return true if segmentName is valid.
    */
-  default boolean isValidSegmentName(String segmentName) {
+  static boolean isValidSegmentName(String segmentName) {

Review Comment:
   Let's create a `SegmentNameUtils` class and move this method there



##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/name/SegmentNameGenerator.java:
##########
@@ -37,7 +37,7 @@ public interface SegmentNameGenerator extends Serializable {
    * @param segmentName provide segment name
    * @return true if segmentName is valid.
    */
-  default boolean isValidSegmentName(String segmentName) {
+  static boolean isValidSegmentName(String segmentName) {

Review Comment:
   Consider changing it to `void validateSegmentName(String segmentName)` and throw `IllegalArgumentException` to simplify the caller code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org