KWayMerge
Read onlyYes
FinalYes
Methods
- __construct() : mixed
- merge() : Generator<string|int, Rows>
- Merges block by block: every loaded row that sorts at or before the smallest last loaded row (the frontier) is final, because a stream's unloaded rows sort after its loaded ones. Ties sort by stream, then by position, so equal rows keep their input order.
Methods
__construct()
public
__construct(array<int, SortColumn> $columns, Backend $backend[, BatchSize $batchSize = new BatchSize(1000) ]) : mixed
Parameters
- $columns : array<int, SortColumn>
- $backend : Backend
- $batchSize : BatchSize = new BatchSize(1000)
merge()
Merges block by block: every loaded row that sorts at or before the smallest last loaded row (the frontier) is final, because a stream's unloaded rows sort after its loaded ones. Ties sort by stream, then by position, so equal rows keep their input order.
public
merge(array<int, Generator<string|int, Rows>> $streams) : Generator<string|int, Rows>
Parameters
- $streams : array<int, Generator<string|int, Rows>>
-
each sorted in this order