public override bool Read() { if (OrderByValuesQueue.IsEmpty()) { return(false); } if (IsFirstNext) { IsFirstNext = false; return(true); } OrderByValue firstOrderByValue = OrderByValuesQueue.Poll(); if (firstOrderByValue.MoveNext()) { OrderByValuesQueue.Offer(firstOrderByValue); } if (OrderByValuesQueue.IsEmpty()) { return(false); } SetCurrentStreamDataReader(OrderByValuesQueue.Peek().GetStreamDataReader()); return(true); }
private void OrderResultSetsToQueue(List <IStreamDataReader> streamDataReaders, SelectCommandContext selectCommandContext, SchemaMetaData schemaMetaData) { foreach (var queryResult in streamDataReaders) { OrderByValue orderByValue = new OrderByValue(queryResult, OrderByItems, selectCommandContext, schemaMetaData); if (orderByValue.MoveNext()) { OrderByValuesQueue.Offer(orderByValue); } } SetCurrentStreamDataReader(OrderByValuesQueue.IsEmpty() ? streamDataReaders[0] : OrderByValuesQueue.Peek().GetStreamDataReader()); }