Skip to content

Commit a96533d

Browse files
committed
Make LaunchArguments public so that it can be used with Launcher API
1 parent 18dbd17 commit a96533d

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

akkeeper/src/main/scala/akkeeper/launcher/LaunchArguments.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ import java.net.URI
2020
import com.typesafe.config.Config
2121
import LaunchArguments._
2222

23-
private[akkeeper] case class LaunchArguments(akkeeperJarPath: URI = new URI("."),
24-
userJar: URI = new URI("."),
25-
otherJars: Seq[URI] = Seq.empty,
26-
resources: Seq[URI] = Seq.empty,
27-
masterJvmArgs: Seq[String] = Seq.empty,
28-
userConfig: Option[Config] = None,
29-
pollInterval: Long = DefaultPollInterval,
30-
yarnQueue: Option[String] = None,
31-
principal: Option[String] = None,
32-
keytab: URI = new URI("."))
23+
final case class LaunchArguments(akkeeperJarPath: URI = new URI("."),
24+
userJar: URI = new URI("."),
25+
otherJars: Seq[URI] = Seq.empty,
26+
resources: Seq[URI] = Seq.empty,
27+
masterJvmArgs: Seq[String] = Seq.empty,
28+
userConfig: Option[Config] = None,
29+
pollInterval: Long = DefaultPollInterval,
30+
yarnQueue: Option[String] = None,
31+
principal: Option[String] = None,
32+
keytab: Option[URI] = None)
3333

3434
object LaunchArguments {
3535
val DefaultPollInterval = 1000

akkeeper/src/main/scala/akkeeper/launcher/Launcher.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration
2323

2424
import scala.concurrent.{ExecutionContext, Future}
2525

26-
case class LaunchResult(appId: String, masterAddress: Address)
26+
final case class LaunchResult(appId: String, masterAddress: Address)
2727

2828
/** Launcher for the Akkeeper application. */
2929
trait Launcher[F[_]] {

akkeeper/src/main/scala/akkeeper/launcher/LauncherMain.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ object LauncherMain extends App {
7676
}).text("Principal to be used to login to KDC.")
7777

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

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

9898
launcherArgs.principal.foreach(p => {
99-
YarnUtils.loginFromKeytab(p, launcherArgs.keytab.toString)
99+
YarnUtils.loginFromKeytab(p, launcherArgs.keytab.get.toString)
100100
})
101101

102102
val launcherTimeout =

akkeeper/src/main/scala/akkeeper/launcher/yarn/YarnLauncher.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ final class YarnLauncher(yarnConf: YarnConfiguration,
120120

121121
args.principal.foreach(_ => {
122122
// Distribute keytab.
123-
val keytabResource = resourceManger.createLocalResource(args.keytab.toString,
123+
val keytabResource = resourceManger.createLocalResource(args.keytab.get.toString,
124124
LocalResourceNames.KeytabName)
125125
localResources.put(LocalResourceNames.KeytabName, keytabResource)
126126
})

akkeeper/src/test/scala/akkeeper/launcher/yarn/YarnLauncherSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class YarnLauncherSpec extends FlatSpec with Matchers with MockFactory
9191
userConfig = Some(ConfigFactory.load("application-container-test.conf")),
9292
yarnQueue = Some("queue"),
9393
principal = Some("username"),
94-
keytab = new URI(createResource(resourcesDir, "some.keytab"))
94+
keytab = Some(new URI(createResource(resourcesDir, "some.keytab")))
9595
)
9696
}
9797

0 commit comments

Comments
 (0)