schnell18 commented on a change in pull request #3256:
URL: https://github.com/apache/rocketmq/pull/3256#discussion_r691685939



##########
File path: store/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java
##########
@@ -34,6 +37,7 @@
     private static final InternalLogger LOG_ERROR = 
InternalLoggerFactory.getLogger(LoggerName.STORE_ERROR_LOGGER_NAME);
 
     private static final int DELETE_FILES_BATCH_MAX = 10;
+    private static final Pattern MAPPED_FILENAME_PATTERN = 
Pattern.compile("^\\d{20}$");

Review comment:
       Good catch!
   
   I just pushed a new changeset to centralize these magic numbers in the 
UtilAll class like:
   
       public static final int MAPPED_FILENAME_DIGITS = 20;
       public static final Pattern MAPPED_FILENAME_PATTERN = 
Pattern.compile("^\\d{20}$");
   
   I don't reduce instances of magic number '20' to one since I don't want 
string-concated-regex, which is ugly and hard to read.
   
   




-- 
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: dev-unsubscr...@rocketmq.apache.org

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


Reply via email to