dybyte commented on issue #10329:
URL: https://github.com/apache/seatunnel/issues/10329#issuecomment-3776960505

   > Thanks for proposing this feature. The issue is valid: current IMap file 
storage (`IMapFileStorage`, `CloudWriter`, `HdfsWriter`) uses append-only 
writes without cleanup, causing unlimited storage growth for high-frequency 
IMaps like `engine_runningJobMetrics`. `WALReader` only merges data in-memory 
without physically deleting old files.
   > 
   > To design a compaction mechanism effectively, please clarify:
   > 
   > 1. Preferred default trigger strategy (time-based/file-count/file-size 
thresholds)?
   > 2. Should manual triggering be supported (REST API/CLI)?
   > 3. Any performance tolerance limits for compaction during job execution?
   > 
   > Potential starting points:
   > 
   > * 
`seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/IMapFileStorage.java`
 - add `compact()` and scheduled compaction task
   > * 
`seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/common/FileConstants.java`
 - add compaction config constants
   > * 
`seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/SeaTunnelServer.java`
 - add REST API endpoint
   
   **[Compaction Design Summary]**
   
   1. **Target Files**
       - Exclude active buffer (not yet persisted)
       - Only sealed, older files are eligible
   2. **Merge Criteria**
       - Max single file size(default: 56MB) ≤ 1/2 × total compaction threshold 
(default: 512MB)
   3. **Trigger**
       - Based on total file size threshold (default: 512MB)
   4. **Throughput Control**
       - Process data in batches, sleep between batches
       - Example: batch_bytes (default: 64MB), sleep_ms (default: 5000ms)
       - Configurable by user


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

Reply via email to