ningyougang commented on a change in pull request #5061: URL: https://github.com/apache/openwhisk/pull/5061#discussion_r572519550
########## File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala ########## @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.openwhisk.core.containerpool.v2 + +import java.time.Instant + +import akka.actor.ActorRef +import org.apache.openwhisk.common.TransactionId +import org.apache.openwhisk.core.containerpool.Container +import org.apache.openwhisk.core.entity.{ByteSize, CodeExec, DocRevision, ExecutableWhiskAction} +import org.apache.openwhisk.core.entity.size._ + +// Events received by the actor +case class Initialize(invocationNamespace: String, + action: ExecutableWhiskAction, + schedulerHost: String, + rpcPort: Int, + transId: TransactionId) +case class Start(exec: CodeExec[_], memoryLimit: ByteSize) + +// Event sent by the actor +case class ContainerCreationFailed(throwable: Throwable) +case class ContainerIsPaused(data: WarmData) +case class ClientCreationFailed(throwable: Throwable, + container: Container, + invocationNamespace: String, + action: ExecutableWhiskAction) +case class ReadyToWork(data: Data) +case class Initialized(data: InitializedData) +case class Resumed(data: WarmData) +case class ResumeFailed(data: WarmData) +case class RecreateClient(action: ExecutableWhiskAction) +case object ContainerRemoved // when container is destroyed + +// States +sealed trait ProxyState +case object LeaseStart extends ProxyState +case object Uninitialized extends ProxyState +case object ContainerCreating extends ProxyState Review comment: Updated accordingly. ########## File path: core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala ########## @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.openwhisk.core.containerpool.v2 + +import java.time.Instant + +import akka.actor.ActorRef +import org.apache.openwhisk.common.TransactionId +import org.apache.openwhisk.core.containerpool.Container +import org.apache.openwhisk.core.entity.{ByteSize, CodeExec, DocRevision, ExecutableWhiskAction} +import org.apache.openwhisk.core.entity.size._ + +// Events received by the actor +case class Initialize(invocationNamespace: String, + action: ExecutableWhiskAction, + schedulerHost: String, + rpcPort: Int, + transId: TransactionId) +case class Start(exec: CodeExec[_], memoryLimit: ByteSize) + +// Event sent by the actor +case class ContainerCreationFailed(throwable: Throwable) +case class ContainerIsPaused(data: WarmData) +case class ClientCreationFailed(throwable: Throwable, + container: Container, + invocationNamespace: String, + action: ExecutableWhiskAction) +case class ReadyToWork(data: Data) +case class Initialized(data: InitializedData) +case class Resumed(data: WarmData) +case class ResumeFailed(data: WarmData) +case class RecreateClient(action: ExecutableWhiskAction) +case object ContainerRemoved // when container is destroyed + +// States +sealed trait ProxyState +case object LeaseStart extends ProxyState +case object Uninitialized extends ProxyState +case object ContainerCreating extends ProxyState +case object ContainerCreated extends ProxyState +case object ClientCreating extends ProxyState Review comment: Updated accordingly ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
