fix: address SonarQube reliability issues
- ElkDiagramRenderer.getElkRoot(): add null guard to prevent NPE when node is null (SQ java:S2259) - WriteBuffer: add offerOrWarn() that logs when buffer is full instead of silently dropping data. ChunkAccumulator now uses this method so ingestion backpressure is visible in logs (SQ java:S899) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,16 @@ public class WriteBuffer<T> {
|
||||
return queue.offer(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Offer an item, logging a warning if the buffer is full.
|
||||
* Use this as a {@code Consumer<T>} when the caller cannot handle backpressure.
|
||||
*/
|
||||
public void offerOrWarn(T item) {
|
||||
if (!queue.offer(item)) {
|
||||
log.warn("WriteBuffer full (capacity={}), item dropped", capacity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Offer a batch of items with all-or-nothing semantics.
|
||||
* If the buffer does not have enough remaining capacity for the entire batch,
|
||||
|
||||
Reference in New Issue
Block a user