rabbah commented on a change in pull request #4837: Move the ack
implementations to the common package.
URL: https://github.com/apache/openwhisk/pull/4837#discussion_r383953526
##########
File path:
common/scala/src/main/scala/org/apache/openwhisk/core/entity/InstanceId.scala
##########
@@ -31,30 +29,51 @@ import
org.apache.openwhisk.core.entity.ControllerInstanceId.MAX_NAME_LENGTH
case class InvokerInstanceId(val instance: Int,
uniqueName: Option[String] = None,
displayedName: Option[String] = None,
- val userMemory: ByteSize) {
+ val userMemory: ByteSize)
+ extends InstanceId {
def toInt: Int = instance
+ override def instanceType: String = "invoker"
+
+ override val source: String = s"$instanceType$instance"
+
override def toString: String = (Seq("invoker" + instance) ++ uniqueName ++
displayedName).mkString("/")
}
-case class ControllerInstanceId(val asString: String) {
- require(
- asString.length <= MAX_NAME_LENGTH && asString.matches(LEGAL_CHARS),
- "Controller instance id contains invalid characters")
+case class ControllerInstanceId(asString: String) extends InstanceId {
+ validate(asString)
+ override def instanceType: String = "controller"
Review comment:
same - make defs vals.
----------------------------------------------------------------
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]
With regards,
Apache Git Services