#IGNITE-857 WIP.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/daac03ee Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/daac03ee Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/daac03ee Branch: refs/heads/ignite-471-2 Commit: daac03eedbd47f615af06285e8ad6934a5586729 Parents: c462a0f Author: nikolay tikhonov <ntikho...@gridgain.com> Authored: Tue May 26 09:01:57 2015 +0300 Committer: nikolay tikhonov <ntikho...@gridgain.com> Committed: Tue May 26 09:01:57 2015 +0300 ---------------------------------------------------------------------- .../org/apache/ignite/mesos/IgniteFramework.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/daac03ee/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteFramework.java ---------------------------------------------------------------------- diff --git a/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteFramework.java b/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteFramework.java index 6cc43b1..b385bc9 100644 --- a/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteFramework.java +++ b/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteFramework.java @@ -23,6 +23,7 @@ import org.apache.mesos.*; import org.glassfish.grizzly.http.server.*; import org.glassfish.jersey.grizzly2.httpserver.*; import org.glassfish.jersey.server.*; +import org.slf4j.*; import java.net.*; @@ -30,7 +31,10 @@ import java.net.*; * Ignite mesos framework. */ public class IgniteFramework { + /** */ + public static final Logger log = LoggerFactory.getLogger(IgniteFramework.class); + /** Framework name. */ public static final String IGNITE_FRAMEWORK_NAME = "Ignite"; /** @@ -48,11 +52,12 @@ public class IgniteFramework { .setFailoverTimeout(frameworkFailoverTimeout); if (System.getenv("MESOS_CHECKPOINT") != null) { - System.out.println("Enabling checkpoint for the framework"); + log.info("Enabling checkpoint for the framework"); + frameworkBuilder.setCheckpoint(true); } - ClusterProperties clusterProps = ClusterProperties.from(args.length == 1 ? args[0] : null); + ClusterProperties clusterProps = ClusterProperties.from(args.length >= 1 ? args[0] : null); String baseUrl = String.format("http://%s:%d", clusterProps.httpServerHost(), clusterProps.httpServerPort()); @@ -60,7 +65,7 @@ public class IgniteFramework { ResourceConfig rc = new ResourceConfig() .registerInstances(new ResourceController(clusterProps.userLibs(), clusterProps.igniteCfg(), - clusterProps.igniteWorkDir())); + clusterProps.igniteWorkDir())); HttpServer httpServer = GrizzlyHttpServerFactory.createHttpServer(httpServerBaseUri, rc); @@ -76,15 +81,17 @@ public class IgniteFramework { // create the driver MesosSchedulerDriver driver; if (System.getenv("MESOS_AUTHENTICATE") != null) { - System.out.println("Enabling authentication for the framework"); + log.info("Enabling authentication for the framework"); if (System.getenv("DEFAULT_PRINCIPAL") == null) { - System.err.println("Expecting authentication principal in the environment"); + log.error("Expecting authentication principal in the environment"); + System.exit(1); } if (System.getenv("DEFAULT_SECRET") == null) { - System.err.println("Expecting authentication secret in the environment"); + log.error("Expecting authentication secret in the environment"); + System.exit(1); }