Skip to content

refactor: use AsyncResource instead of Future to acquire segment references - #20197

Draft
clintropolis wants to merge 1 commit into
apache:masterfrom
clintropolis:acquire-segment-async-resource
Draft

refactor: use AsyncResource instead of Future to acquire segment references#20197
clintropolis wants to merge 1 commit into
apache:masterfrom
clintropolis:acquire-segment-async-resource

Conversation

@clintropolis

Copy link
Copy Markdown
Member

Description

Exploration in replacing Future with AsyncResource for acquiring segment references and MSQ processing.

@github-actions github-actions Bot added Area - Batch Ingestion Area - Segment Format and Ser/De Area - Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 labels Aug 29, 2026
// AcquireSegmentAction currently doesn't have a meaningful toString method, so if this message
// ever actually gets logged, it won't mention the specific segment that had a problem. Perhaps
// one day this will change.
e -> log.warn(e, "Failed to close loadingSegment[%s]", acquireSegmentAction)

private DataSegment makeSegment(String name)
{
return DataSegment.builder()
.loadSpec(ImmutableMap.of("type", "gated", "size", (int) SEGMENT_SIZE, "name", name))
.dimensions(ImmutableList.of())
.metrics(ImmutableList.of())
.shardSpec(new NumberedShardSpec(Integer.parseInt(name.substring(name.length() - 1)), 0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - Batch Ingestion Area - Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 Area - Segment Format and Ser/De

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants