format source with scalafmt, #26511

This commit is contained in:
Auto Format 2019-03-13 10:56:20 +01:00 committed by Patrik Nordwall
parent 2ba9b988df
commit 75579bed17
779 changed files with 15729 additions and 13096 deletions

View file

@ -31,10 +31,11 @@ object GraphInterpreterSpecKit {
* @param attributes Optional set of attributes to pass to the stages when creating the logics
* @return Created logics and the maps of all inlets respective outlets to those logics
*/
private[stream] def createLogics(stages: Array[GraphStageWithMaterializedValue[_ <: Shape, _]],
upstreams: Array[UpstreamBoundaryStageLogic[_]],
downstreams: Array[DownstreamBoundaryStageLogic[_]],
attributes: Array[Attributes] = Array.empty)
private[stream] def createLogics(
stages: Array[GraphStageWithMaterializedValue[_ <: Shape, _]],
upstreams: Array[UpstreamBoundaryStageLogic[_]],
downstreams: Array[DownstreamBoundaryStageLogic[_]],
attributes: Array[Attributes] = Array.empty)
: (Array[GraphStageLogic], SMap[Inlet[_], GraphStageLogic], SMap[Outlet[_], GraphStageLogic]) = {
if (attributes.nonEmpty && attributes.length != stages.length)
throw new IllegalArgumentException("Attributes must be either empty or one per stage")
@ -115,11 +116,12 @@ object GraphInterpreterSpecKit {
val outOwner = window(0)
val inOwner = window(1)
val connection = new Connection(id = idx,
outOwner = outOwner,
outHandler = outOwner.outHandler(0),
inOwner = inOwner,
inHandler = inOwner.inHandler(0))
val connection = new Connection(
id = idx,
outOwner = outOwner,
outHandler = outOwner.outHandler(0),
inOwner = inOwner,
inHandler = inOwner.inHandler(0))
outOwner.portToConn(outOwner.inCount) = connection
inOwner.portToConn(0) = connection
@ -132,10 +134,11 @@ object GraphInterpreterSpecKit {
/**
* Create interpreter connections for all the given `connectedPorts`.
*/
private[stream] def createConnections(logics: Seq[GraphStageLogic],
connectedPorts: Seq[(Outlet[_], Inlet[_])],
inOwners: SMap[Inlet[_], GraphStageLogic],
outOwners: SMap[Outlet[_], GraphStageLogic]): Array[Connection] = {
private[stream] def createConnections(
logics: Seq[GraphStageLogic],
connectedPorts: Seq[(Outlet[_], Inlet[_])],
inOwners: SMap[Inlet[_], GraphStageLogic],
outOwners: SMap[Outlet[_], GraphStageLogic]): Array[Connection] = {
val connections = new Array[Connection](connectedPorts.size)
connectedPorts.zipWithIndex.foreach {
@ -143,11 +146,12 @@ object GraphInterpreterSpecKit {
val outOwner = outOwners(outlet)
val inOwner = inOwners(inlet)
val connection = new Connection(id = idx,
outOwner = outOwner,
outHandler = outOwner.outHandler(outlet.id),
inOwner = inOwner,
inHandler = inOwner.inHandler(inlet.id))
val connection = new Connection(
id = idx,
outOwner = outOwner,
outHandler = outOwner.outHandler(outlet.id),
inOwner = inOwner,
inHandler = inOwner.inHandler(inlet.id))
connections(idx) = connection
inOwner.portToConn(inlet.id) = connection
@ -249,13 +253,14 @@ trait GraphInterpreterSpecKit extends StreamSpec {
}
def manualInit(logics: Array[GraphStageLogic], connections: Array[Connection]): Unit = {
_interpreter = new GraphInterpreter(NoMaterializer,
logger,
logics,
connections,
onAsyncInput = (_, _, _, _) => (),
fuzzingMode = false,
context = null)
_interpreter = new GraphInterpreter(
NoMaterializer,
logger,
logics,
connections,
onAsyncInput = (_, _, _, _) => (),
fuzzingMode = false,
context = null)
_interpreter.init(null)
}
@ -532,15 +537,16 @@ trait GraphInterpreterSpecKit extends StreamSpec {
val out = Outlet[TT]("out")
out.id = 0
setHandler(out,
new OutHandler {
override def onPull(): Unit = {
if (lastEvent.contains(RequestOne)) lastEvent += RequestAnother
else lastEvent += RequestOne
}
setHandler(
out,
new OutHandler {
override def onPull(): Unit = {
if (lastEvent.contains(RequestOne)) lastEvent += RequestAnother
else lastEvent += RequestOne
}
override def onDownstreamFinish(): Unit = lastEvent += Cancel
})
override def onDownstreamFinish(): Unit = lastEvent += Cancel
})
def onNext(elem: TT): Unit = {
push(out, elem)