Copilot commented on code in PR #3127:
URL: https://github.com/apache/hugegraph/pull/3127#discussion_r3678535915


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/task/HugeTask.java:
##########
@@ -575,9 +575,29 @@ protected synchronized Object[] asArray() {
 
         if (this.result != null) {
             byte[] bytes = StringEncoding.compress(this.result);
-            checkPropertySize(bytes.length, P.RESULT);
-            list.add(P.RESULT);
-            list.add(bytes);
+            int chunkSize = 
CoreOptions.instance().get(CoreOptions.TASK_RESULT_CHUNK_SIZE);

Review Comment:
   `CoreOptions.instance()` doesn’t exist (CoreOptions extends OptionHolder and 
has no static `instance()`), so this line won’t compile. Use the task’s graph 
config instead (as `checkPropertySize()` already does).
   
   This issue also appears in the following locations of the same file:
   - line 586
   - line 589



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/config/CoreOptions.java:
##########
@@ -306,6 +306,19 @@ public class CoreOptions extends OptionHolder {
                     rangeInt(0L, Bytes.GB),
                     16 * Bytes.MB
             );
+    /**
+     * The chunk size for task results in bytes.
+     * When the compressed result exceeds this size, it will be split into
+     * multiple properties (task_result_0, task_result_1, ...).
+     * Set to 0 to disable chunking.
+     */
+    public static final ConfigOption<Integer> TASK_RESULT_CHUNK_SIZE =
+            new ConfigOption<>(
+                    "task.result_chunk_size",
+                    "The chunk size for task results in bytes. Set 0 to 
disable chunking.",
+                    rangeInt(0, BytesBuffer.BYTES_LEN_MAX),

Review Comment:
   `rangeInt(0, BytesBuffer.BYTES_LEN_MAX)` mixes `Integer` and `Long` 
arguments; `OptionChecker.rangeInt(N min, N max)` requires both args to be the 
same numeric type, so this won’t compile. Cast the max to `int` (it’s 10MB) or 
use `0L`/`Long` consistently with a `ConfigOption<Long>`.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to