druid/codestyle
Gian Merlino ca4e64aea3
Frame processing and channels. (#12848)
* Frame processing and channels.

Follow-up to #12745. This patch adds three new concepts:

1) Frame channels are interfaces for doing nonblocking reads and writes
   of frames.

2) Frame processors are interfaces for doing nonblocking processing of
   frames received from input channels and sent to output channels.

3) Cluster-by keys, which can be used for sorting or partitioning.

The patch also adds SuperSorter, a user of these concepts, both to
illustrate how they are used, and also because it is going to be useful
in future work.

Central classes:

- ReadableFrameChannel. Implementations include
  BlockingQueueFrameChannel (in-memory channel that implements both interfaces),
  ReadableFileFrameChannel (file-based channel),
  ReadableByteChunksFrameChannel (byte-stream-based channel), and others.

- WritableFrameChannel. Implementations include BlockingQueueFrameChannel
  and WritableStreamFrameChannel (byte-stream-based channel).

- ClusterBy, a sorting or partitioning key.

- FrameProcessor, nonblocking processor of frames. Implementations include
  FrameChannelBatcher, FrameChannelMerger, and FrameChannelMuxer.

- FrameProcessorExecutor, an executor service that runs FrameProcessors.

- SuperSorter, a class that uses frame channels and processors to
  do parallel external merge sort of any amount of data (as long as there
  is enough disk space).

* Additional tests, fixes.

* Changes from review.

* Better implementation for ReadableInputStreamFrameChannel.

* Rename getFrameFileReference -> newFrameFileReference.

* Add InterruptedException to runIncrementally; add more tests.

* Cancellation adjustments.

* Review adjustments.

* Refactor BlockingQueueFrameChannel, rename doneReading and doneWriting to close.

* Additional changes from review.

* Additional changes.

* Fix test.

* Adjustments.

* Adjustments.
2022-08-04 21:29:04 -07:00
..
LICENSE.txt Update license headers. (#5976) 2018-07-11 09:55:18 -07:00
checkstyle-suppressions.xml handle timestamps of complex types when parsing protobuf messages (#11293) 2021-06-07 15:19:39 +05:30
checkstyle.xml Add Checkstyle check for String literal equality (#8386) 2019-08-28 17:53:42 +03:00
druid-forbidden-apis.txt GroupBy: Reduce allocations by reusing entry and key holders. (#12474) 2022-04-28 23:21:13 -07:00
guava16-forbidden-apis.txt Forbiddenapis: Split the guava16-only signatures file from main signatures file (#12170) 2022-01-19 17:50:28 -08:00
joda-time-forbidden-apis.txt Introduce SegmentId class (#6370) 2019-01-21 11:11:10 -08:00
pmd-ruleset.xml Remove use of deprecated PMD ruleset (#12044) 2021-12-09 13:04:27 -08:00
spotbugs-exclude.xml Frame processing and channels. (#12848) 2022-08-04 21:29:04 -07:00