Skip to content

Add support keepSegmentGranularity for automatic compaction#6407

Merged
fjy merged 7 commits intoapache:masterfrom
jihoonson:auto-compact-seg
Oct 7, 2018
Merged

Add support keepSegmentGranularity for automatic compaction#6407
fjy merged 7 commits intoapache:masterfrom
jihoonson:auto-compact-seg

Conversation

@jihoonson
Copy link
Copy Markdown
Contributor

Fixes #6135.

@jihoonson jihoonson added the WIP label Sep 30, 2018
@jihoonson jihoonson added this to the 0.13.0 milestone Sep 30, 2018
@jihoonson jihoonson removed the WIP label Oct 4, 2018
@jihoonson
Copy link
Copy Markdown
Contributor Author

Ready for review.

Comment thread docs/content/configuration/index.md Outdated
|`taskPriority`|[Priority](../ingestion/tasks.html#task-priorities) of compact task.|no (default = 25)|
|`targetCompactionSizeBytes`|The target segment size of compaction. The actual size of a compact segment might be slightly larger or smaller than this value.|no (default = 838860800)|
|`numTargetCompactionSegments`|Max number of segments to compact together.|no (default = 150)|
|`inputSegmentSizeBytes`|Total input segment size of a compactionTask. The actual input size can be slightly larger than this value.|no (default = 419430400)|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the total size can be larger, what's the point of this config?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is a target size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm makes sense. Fixed.

private static final double ALLOWED_MARGIN_OF_COMPACTION_SIZE = .1;

static boolean isCompactible(long remainingBytes, long currentTotalBytes, long additionalBytes)
static boolean isCompactibleSize(long targetBytes, long currentTotalBytes, long additionalBytes)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a confusing name for a function - why rename?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, there's 2 functions, by Size and by Name

return segments;
}

int size()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call this getSize() and explicitly list if it is public/private/protected?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

final DataSegment segment = chunks.get(0).getObject();
log.warn(
"shardSize[%d] for dataSource[%s] and interval[%s] is larger than inputSegmentSize[%d]."
+ " Contitnue to the next shard.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continue*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks.

@fjy fjy merged commit 88d23b7 into apache:master Oct 7, 2018
@jon-wei jon-wei removed their assignment Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants