Skip to content

Commit

Permalink
Make LaunchArguments public so that it can be used with Launcher API
Browse files Browse the repository at this point in the history
  • Loading branch information
izeigerman committed Nov 20, 2018
1 parent 18dbd17 commit a96533d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions akkeeper/src/main/scala/akkeeper/launcher/LaunchArguments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ import java.net.URI
import com.typesafe.config.Config
import LaunchArguments._

private[akkeeper] case class LaunchArguments(akkeeperJarPath: URI = new URI("."),
userJar: URI = new URI("."),
otherJars: Seq[URI] = Seq.empty,
resources: Seq[URI] = Seq.empty,
masterJvmArgs: Seq[String] = Seq.empty,
userConfig: Option[Config] = None,
pollInterval: Long = DefaultPollInterval,
yarnQueue: Option[String] = None,
principal: Option[String] = None,
keytab: URI = new URI("."))
final case class LaunchArguments(akkeeperJarPath: URI = new URI("."),
userJar: URI = new URI("."),
otherJars: Seq[URI] = Seq.empty,
resources: Seq[URI] = Seq.empty,
masterJvmArgs: Seq[String] = Seq.empty,
userConfig: Option[Config] = None,
pollInterval: Long = DefaultPollInterval,
yarnQueue: Option[String] = None,
principal: Option[String] = None,
keytab: Option[URI] = None)

object LaunchArguments {
val DefaultPollInterval = 1000
Expand Down
2 changes: 1 addition & 1 deletion akkeeper/src/main/scala/akkeeper/launcher/Launcher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration

import scala.concurrent.{ExecutionContext, Future}

case class LaunchResult(appId: String, masterAddress: Address)
final case class LaunchResult(appId: String, masterAddress: Address)

/** Launcher for the Akkeeper application. */
trait Launcher[F[_]] {
Expand Down
4 changes: 2 additions & 2 deletions akkeeper/src/main/scala/akkeeper/launcher/LauncherMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ object LauncherMain extends App {
}).text("Principal to be used to login to KDC.")

opt[URI]("keytab").valueName("<keytab path>").action((v, c) => {
c.copy(keytab = transformUri(v))
c.copy(keytab = Some(transformUri(v)))
}).text("The full path to the file that contains the keytab for the principal specified above.")

opt[File]("config").valueName("<file>").action((v, c) => {
Expand All @@ -96,7 +96,7 @@ object LauncherMain extends App {
.getOrElse(ConfigFactory.load())

launcherArgs.principal.foreach(p => {
YarnUtils.loginFromKeytab(p, launcherArgs.keytab.toString)
YarnUtils.loginFromKeytab(p, launcherArgs.keytab.get.toString)
})

val launcherTimeout =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ final class YarnLauncher(yarnConf: YarnConfiguration,

args.principal.foreach(_ => {
// Distribute keytab.
val keytabResource = resourceManger.createLocalResource(args.keytab.toString,
val keytabResource = resourceManger.createLocalResource(args.keytab.get.toString,
LocalResourceNames.KeytabName)
localResources.put(LocalResourceNames.KeytabName, keytabResource)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class YarnLauncherSpec extends FlatSpec with Matchers with MockFactory
userConfig = Some(ConfigFactory.load("application-container-test.conf")),
yarnQueue = Some("queue"),
principal = Some("username"),
keytab = new URI(createResource(resourcesDir, "some.keytab"))
keytab = Some(new URI(createResource(resourcesDir, "some.keytab")))
)
}

Expand Down

0 comments on commit a96533d

Please sign in to comment.