realtime cleanup and renaming#16652
Conversation
changes: * `FireHydrant` is now `PartialSegment`. This name much more clearly describes what this class does, and with all the other fireman terminology removed it didn't even fit a theme anymore. * `Sink` is now `AppendableSegment`. This name also much more clearly describes what this class does, and is composed of `PartialSegments` per the previous `FireHydrant` rename. * Additionally, `SinkQuerySegmentWalker` -> `AppendableSegmentQuerySegmentWalker`, and `SinkQueryRunner` -> `AppendableSegmentQueryRunner` * Remove `Firehose`, `IngestSegmentFirehose` was only used by Hadoop indexing `DruidRecordReader`, moved to internal class of `DruidRecordReader` as `SegmentReader` * Remove `FirehoseFactory` and remaining implementations, after apache#16602 they were no longer used * Moved things from `org.apache.druid.segment.realtime.sink` and `org.apache.druid.segment.realtime.firehose` up to `org.apache.druid.segment.realtime`.
| expectedException.expectMessage("segment.close() is called somewhere outside PartialSegment.swapSegment()"); | ||
| partialSegment.getPartialSegment().close(); | ||
| Assert.assertEquals(0, partialSegment.getPartialSegment().getNumReferences()); | ||
| ReferenceCountingSegment segment = partialSegment.getIncrementedSegment(); |
Check notice
Code scanning / CodeQL
Unread local variable
| final int hydrantNumber = Integer.parseInt(hydrantDir.getName()); | ||
| List<PartialSegment> partialSegments = new ArrayList<>(); | ||
| for (File partialSegmentDir : appendableSegmentFiles) { | ||
| final int partialSegmentNumber = Integer.parseInt(partialSegmentDir.getName()); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
| final int hydrantNumber = Integer.parseInt(hydrantDir.getName()); | ||
| List<PartialSegment> partialSegments = new ArrayList<>(); | ||
| for (File partialSegmentDir : appendableSegmentFiles) { | ||
| final int partialSegmentNumber = Integer.parseInt(partialSegmentDir.getName()); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
| final int hydrantNumber = Integer.parseInt(hydrantDir.getName()); | ||
| List<PartialSegment> partialSegments = new ArrayList<>(); | ||
| for (File partialSegmentDir : appendableSegmentFiles) { | ||
| final int partialSegmentNumber = Integer.parseInt(partialSegmentDir.getName()); |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException
| } | ||
|
|
||
| private int calculateSinkMemoryInUsed(Sink sink) | ||
| private int calculateAppendableSegmentMemoryInUsed(AppendableSegment appendableSegment) |
Check notice
Code scanning / CodeQL
Useless parameter
I think it is okay to deprecate the older metric but keep emitting it along with the new one for a couple of releases. Also, @clintropolis , what do you think about calling it |
My reasoning for |
Yeah, I wondered if this was the case, didn't see that |
What don't you like about |
Agreed. I have myself been on the fence about the 'pending' part too as it is certainly confusing. But then, I am not sure what a better alternative would have been either (maybe In that regard, I do like You seem to have given it enough thought and I do agree with the arguments against the other options, so let's go ahead with I don't think we need to rename |
|
closing in favor of #16758 |
changes:
FireHydrantis nowPartialSegment. This name much more clearly describes what this class does, and with all the other fireman terminology removed it didn't even fit a theme anymore.Sinkis nowAppendableSegment. This name also much more clearly describes what this class does, and is composed ofPartialSegmentsper the previousFireHydrantrename.SinkQuerySegmentWalker->AppendableSegmentQuerySegmentWalker, andSinkQueryRunner->AppendableSegmentQueryRunnerFirehose,IngestSegmentFirehosewas only used by Hadoop indexingDruidRecordReader, moved to internal class ofDruidRecordReaderasSegmentReaderFirehoseFactoryand remaining implementations, after Remove index_realtime and index_realtime_appenderator tasks #16602 they were no longer usedorg.apache.druid.segment.realtime.sinkandorg.apache.druid.segment.realtime.firehoseup toorg.apache.druid.segment.realtime.Discussion: should we move metric
ingest/sink/counttoingest/appendableSegment/countor something similar? That is kind of disruptive since there is like a continuity of measurement issue which is kind of sad. We could also always double emit it, but also sad in its own way.Release note
todo
This PR has: