Skip to content

Commit f472d93

Browse files
committed
chore(modelql): replace "flow" with "stream" in all names
1 parent ace6ccf commit f472d93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+180
-184
lines changed

model-server/src/main/kotlin/org/modelix/model/server/handlers/ModelReplicationServer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ class InMemoryMemoizationPersistence : IMemoizationPersistence {
485485
override fun memoize(input: IStepOutput<In>): IStepOutput<Out> {
486486
runSynchronized(cache) {
487487
return cache.get(IndexCacheKey(normalizedQueryDescriptor, input)) {
488-
query.asFlow(QueryEvaluationContext.EMPTY, input).exactlyOne().getSynchronous()
488+
query.asStream(QueryEvaluationContext.EMPTY, input).exactlyOne().getSynchronous()
489489
}.upcast()
490490
}
491491
}

modelql-client/src/commonMain/kotlin/org/modelix/modelql/client/ModelQLNode.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import org.modelix.modelql.core.IMonoUnboundQuery
3737
import org.modelix.modelql.core.IQueryExecutor
3838
import org.modelix.modelql.core.IUnboundQuery
3939
import org.modelix.modelql.core.IZip2Output
40-
import org.modelix.modelql.core.StepFlow
40+
import org.modelix.modelql.core.StepStream
4141
import org.modelix.modelql.core.asMono
4242
import org.modelix.modelql.core.asStepOutput
4343
import org.modelix.modelql.core.filterNotNull
@@ -72,7 +72,7 @@ abstract class ModelQLNode(val client: ModelQLClient) : INode, ISupportsModelQL,
7272
return this
7373
}
7474

75-
override fun <Out> createFlow(query: IUnboundQuery<INode, *, Out>): StepFlow<Out> {
75+
override fun <Out> createStream(query: IUnboundQuery<INode, *, Out>): StepStream<Out> {
7676
return singleFromCoroutine {
7777
val result = when (query) {
7878
is IMonoUnboundQuery<*, *> -> {

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/CollectorStep.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class MultimapCollectorStepOutputSerializer<K, V>(inputElementSerializer: KSeria
148148
class ListCollectorStep<E> : CollectorStep<E, List<E>>() {
149149
override fun createDescriptor(context: QueryGraphDescriptorBuilder) = Descriptor()
150150

151-
override fun aggregate(input: StepFlow<E>, context: IFlowInstantiationContext): Single<IStepOutput<List<E>>> {
151+
override fun aggregate(input: StepStream<E>, context: IStreamInstantiationContext): Single<IStepOutput<List<E>>> {
152152
return input.toList().map { inputList ->
153153
val outputList = inputList.map { it.value }
154154
CollectorStepOutput(inputList, inputList, outputList)
@@ -178,7 +178,7 @@ class SetCollectorStep<E> : CollectorStep<E, Set<E>>() {
178178

179179
override fun createDescriptor(context: QueryGraphDescriptorBuilder) = Descriptor()
180180

181-
override fun aggregate(input: StepFlow<E>, context: IFlowInstantiationContext): Single<IStepOutput<Set<E>>> {
181+
override fun aggregate(input: StepStream<E>, context: IStreamInstantiationContext): Single<IStepOutput<Set<E>>> {
182182
return input.toList().map { inputAsList ->
183183
val inputList = ArrayList<IStepOutput<E>>()
184184
val outputSet = HashSet<E>()
@@ -210,7 +210,7 @@ class MapCollectorStep<K, V> : CollectorStep<IZip2Output<Any?, K, V>, Map<K, V>>
210210

211211
override fun createDescriptor(context: QueryGraphDescriptorBuilder) = Descriptor()
212212

213-
override fun aggregate(input: StepFlow<IZip2Output<Any?, K, V>>, context: IFlowInstantiationContext): Single<IStepOutput<Map<K, V>>> {
213+
override fun aggregate(input: StepStream<IZip2Output<Any?, K, V>>, context: IStreamInstantiationContext): Single<IStepOutput<Map<K, V>>> {
214214
return input.toList().map { inputAsList ->
215215
val inputList = ArrayList<IStepOutput<IZip2Output<Any?, K, V>>>()
216216
val internalMap = HashMap<K, IStepOutput<V>>()
@@ -253,7 +253,7 @@ class MultimapCollectorStep<K, V> : CollectorStep<IZip2Output<Any?, K, V>, Map<K
253253

254254
override fun createDescriptor(context: QueryGraphDescriptorBuilder) = Descriptor()
255255

256-
override fun aggregate(input: StepFlow<IZip2Output<Any?, K, V>>, context: IFlowInstantiationContext): Single<IStepOutput<Map<K, List<V>>>> {
256+
override fun aggregate(input: StepStream<IZip2Output<Any?, K, V>>, context: IStreamInstantiationContext): Single<IStepOutput<Map<K, List<V>>>> {
257257
return input.toList().map { inputAsList ->
258258
val inputList = ArrayList<IStepOutput<IZip2Output<Any?, K, V>>>()
259259
val internalMap = HashMap<K, MutableList<IStepOutput<V>>>()

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/ConstantSourceStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ open class ConstantSourceStep<E>(val element: E, val type: KType) : ProducingSte
5858
return element
5959
}
6060

61-
override fun createFlow(context: IFlowInstantiationContext): StepFlow<E> {
61+
override fun createStream(context: IStreamInstantiationContext): StepStream<E> {
6262
return observableOf(element.asStepOutput(this))
6363
}
6464

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/CountingStep.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import kotlinx.serialization.Serializable
2020
import org.modelix.streams.count
2121

2222
class CountingStep() : AggregationStep<Any?, Int>() {
23-
override fun aggregate(input: StepFlow<Any?>, context: IFlowInstantiationContext): Single<IStepOutput<Int>> {
24-
return input.count().asStepFlow(this)
23+
override fun aggregate(input: StepStream<Any?>, context: IStreamInstantiationContext): Single<IStepOutput<Int>> {
24+
return input.count().asStepStream(this)
2525
}
2626

2727
override fun createDescriptor(context: QueryGraphDescriptorBuilder) = CountDescriptor()

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/DropStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DropStep<E>(val count: Int) : TransformingStep<E, E>(), IMonoStep<E>, IFlu
2424

2525
override fun canBeMultiple(): Boolean = getProducer().canBeMultiple()
2626

27-
override fun createFlow(input: StepFlow<E>, context: IFlowInstantiationContext): StepFlow<E> {
27+
override fun createStream(input: StepStream<E>, context: IStreamInstantiationContext): StepStream<E> {
2828
return input.skip(count.toLong())
2929
}
3030

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/EmptyStringIfNullStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class EmptyStringIfNullStep : MonoTransformingStep<String?, String>() {
3131
)
3232
}
3333

34-
override fun createFlow(input: StepFlow<String?>, context: IFlowInstantiationContext): StepFlow<String> {
34+
override fun createStream(input: StepStream<String?>, context: IStreamInstantiationContext): StepStream<String> {
3535
return input.map {
3636
if (it.value == null) {
3737
MultiplexedOutput(1, "".asStepOutput(this))

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/FilteringStep.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class FilteringStep<E>(val condition: MonoUnboundQuery<E, Boolean?>) : Transform
3434
}
3535
}
3636

37-
override fun createFlow(input: StepFlow<E>, context: IFlowInstantiationContext): StepFlow<E> {
38-
return input.filterBySingle { condition.asFlow(context.evaluationContext, it).map { it.value == true }.firstOrDefault(false) }
37+
override fun createStream(input: StepStream<E>, context: IStreamInstantiationContext): StepStream<E> {
38+
return input.filterBySingle { condition.asStream(context.evaluationContext, it).map { it.value == true }.firstOrDefault(false) }
3939
}
4040

4141
override fun getOutputSerializer(serializationContext: SerializationContext): KSerializer<out IStepOutput<E>> {

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/FirstElementStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import kotlinx.serialization.Serializable
2121
class FirstElementStep<E>() : MonoTransformingStep<E, E>() {
2222
override fun canBeMultiple(): Boolean = false
2323

24-
override fun createFlow(input: StepFlow<E>, context: IFlowInstantiationContext): StepFlow<E> {
24+
override fun createStream(input: StepStream<E>, context: IStreamInstantiationContext): StepStream<E> {
2525
return input.take(1)
2626
}
2727

modelql-core/src/commonMain/kotlin/org/modelix/modelql/core/FirstOrNullStep.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import kotlinx.serialization.SerialName
2222
import kotlinx.serialization.Serializable
2323

2424
class FirstOrNullStep<E>() : AggregationStep<E, E?>() {
25-
override fun aggregate(input: StepFlow<E>, context: IFlowInstantiationContext): Single<IStepOutput<E?>> {
25+
override fun aggregate(input: StepStream<E>, context: IStreamInstantiationContext): Single<IStepOutput<E?>> {
2626
return input.firstOrComplete().map { MultiplexedOutput(0, it) }
2727
.defaultIfEmpty(MultiplexedOutput(1, null.asStepOutput(this)))
2828
}

0 commit comments

Comments
 (0)