ulysses-you commented on code in PR #3178:
URL: https://github.com/apache/incubator-kyuubi/pull/3178#discussion_r936544423
##########
docs/extensions/server/applications.rst:
##########
@@ -113,4 +82,54 @@ The steps of adding a custom Application Operation
url: Option[String] = None,
error: Option[String] = None)
+For application state mapping, you can reference the implementation of yarn:
+
+ .. code-block:: scala
+
+ def toApplicationState(state: YarnApplicationState): ApplicationState =
state match {
+ case YarnApplicationState.NEW => ApplicationState.PENDING
+ case YarnApplicationState.NEW_SAVING => ApplicationState.PENDING
+ case YarnApplicationState.SUBMITTED => ApplicationState.PENDING
+ case YarnApplicationState.ACCEPTED => ApplicationState.PENDING
+ case YarnApplicationState.RUNNING => ApplicationState.RUNNING
+ case YarnApplicationState.FINISHED => ApplicationState.FINISHED
+ case YarnApplicationState.FAILED => ApplicationState.FAILED
+ case YarnApplicationState.KILLED => ApplicationState.KILLED
+ case _ =>
+ warn(s"The yarn driver state: $state is not supported, " +
+ "mark the application state as UNKNOWN.")
+ ApplicationState.UNKNOWN
+ }
+
+Build A Custom Application Operation
+------------------------------------
+
+- reference kyuubi-server
+
+ .. code-block:: xml
+
+ <dependency>
+ <groupId>org.apache.kyuubi</groupId>
+ <artifactId>kyuubi-server_2.12</artifactId>
+ <version>1.5.2-incubating</version>
+ <scope>provided</scope>
+ </dependency>
+
+- create a custom class which implements the
``org.apache.kyuubi.engine.ApplicationOperation``.
+
+Enable Custom Application Operation
+-----------------------------------
+
+.. note:: Kyuubi uses Java SPI to load the custom Application Operation
+
+1. create a directory META-INF.services and a file with the fully-qualified
name of the interface ``ApplicationOperation``:
Review Comment:
got it
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]