Re: [PR] Optimize load logic [iotdb]

2026-07-09 Thread via GitHub


jt2594838 merged PR #18153:
URL: https://github.com/apache/iotdb/pull/18153


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] Optimize load logic [iotdb]

2026-07-09 Thread via GitHub


luoluoyuyu commented on code in PR #18153:
URL: https://github.com/apache/iotdb/pull/18153#discussion_r3551034721


##
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPathHelper.java:
##
@@ -255,6 +279,11 @@ private static void validateAttributeValue(final String 
key, final String value)
   case LoadTsFileConfigurator.VERIFY_KEY:
 LoadTsFileConfigurator.validateVerifyParam(value);
 break;
+  case USER_KEY:
+if (value == null || value.isEmpty()) {
+  throw new SemanticException("User name must not be empty");

Review Comment:
   fixed



##
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPathHelper.java:
##
@@ -208,7 +218,17 @@ public static boolean containsDatabaseName(final 
Map attributes)
   }
 
   private static String formatSegment(final String key, final String value) {
-return key + SEGMENT_SEPARATOR + encodeValue(value);
+return key + SEGMENT_SEPARATOR + encodeValue(maskValueIfNecessary(key, 
value));
+  }
+
+  private static String maskValueIfNecessary(final String key, final String 
value) {
+if (!USER_KEY.equals(key)) {
+  return value;
+}
+return USER_VALUE_MASK_PREFIX
++ Base64.getUrlEncoder()
+.withoutPadding()
+.encodeToString(value.getBytes(StandardCharsets.UTF_8));

Review Comment:
   fixed



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



Re: [PR] Optimize load logic [iotdb]

2026-07-09 Thread via GitHub


jt2594838 commented on code in PR #18153:
URL: https://github.com/apache/iotdb/pull/18153#discussion_r3549638627


##
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPathHelper.java:
##
@@ -255,6 +279,11 @@ private static void validateAttributeValue(final String 
key, final String value)
   case LoadTsFileConfigurator.VERIFY_KEY:
 LoadTsFileConfigurator.validateVerifyParam(value);
 break;
+  case USER_KEY:
+if (value == null || value.isEmpty()) {
+  throw new SemanticException("User name must not be empty");

Review Comment:
   i18n



##
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadPathHelper.java:
##
@@ -208,7 +218,17 @@ public static boolean containsDatabaseName(final 
Map attributes)
   }
 
   private static String formatSegment(final String key, final String value) {
-return key + SEGMENT_SEPARATOR + encodeValue(value);
+return key + SEGMENT_SEPARATOR + encodeValue(maskValueIfNecessary(key, 
value));
+  }
+
+  private static String maskValueIfNecessary(final String key, final String 
value) {
+if (!USER_KEY.equals(key)) {
+  return value;
+}
+return USER_VALUE_MASK_PREFIX
++ Base64.getUrlEncoder()
+.withoutPadding()
+.encodeToString(value.getBytes(StandardCharsets.UTF_8));

Review Comment:
   Better to use Base32 since some file systems are case-insensitive,



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]