ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [13/32] incubator-ignite git commit: #IGNITE-857 WIP.
Date Thu, 28 May 2015 16:21:18 GMT
#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/5e3bcb2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5e3bcb2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5e3bcb2e

Branch: refs/heads/ignite-sprint-5
Commit: 5e3bcb2e423df46a325834de236b3a8a91ff5659
Parents: daac03e
Author: nikolay tikhonov <ntikhonov@gridgain.com>
Authored: Tue May 26 09:14:21 2015 +0300
Committer: nikolay tikhonov <ntikhonov@gridgain.com>
Committed: Tue May 26 09:14:21 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/mesos/IgniteScheduler.java    | 67 +++++++++-----------
 .../ignite/mesos/IgniteSchedulerSelfTest.java   |  1 -
 2 files changed, 30 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e3bcb2e/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
----------------------------------------------------------------------
diff --git a/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java b/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
index cd517fb..7d713cd 100644
--- a/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
+++ b/modules/mesos/src/main/java/org/apache/ignite/mesos/IgniteScheduler.java
@@ -71,17 +71,6 @@ public class IgniteScheduler implements Scheduler {
     }
 
     /** {@inheritDoc} */
-    @Override public void registered(SchedulerDriver schedulerDriver, Protos.FrameworkID
frameworkID,
-        Protos.MasterInfo masterInfo) {
-        log.info("registered() master={}:{}, framework={}", masterInfo.getIp(), masterInfo.getPort(),
frameworkID);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void reregistered(SchedulerDriver schedulerDriver, Protos.MasterInfo
masterInfo) {
-        log.info("reregistered()");
-    }
-
-    /** {@inheritDoc} */
     @Override public void resourceOffers(SchedulerDriver schedulerDriver, List<Protos.Offer>
offers) {
         synchronized (mux) {
             log.info("resourceOffers() with {} offers", offers.size());
@@ -201,28 +190,24 @@ public class IgniteScheduler implements Scheduler {
                 if (resource.getType().equals(Protos.Value.Type.SCALAR))
                     cpus = resource.getScalar().getValue();
                 else
-                    log.debug("Cpus resource was not a scalar: " + resource.getType().toString());
+                    log.debug("Cpus resource was not a scalar: {}" + resource.getType());
             }
             else if (resource.getName().equals(MEM)) {
                 if (resource.getType().equals(Protos.Value.Type.SCALAR))
                     mem = resource.getScalar().getValue();
                 else
-                    log.debug("Mem resource was not a scalar: " + resource.getType().toString());
+                    log.debug("Mem resource was not a scalar: {}", resource.getType());
             }
             else if (resource.getName().equals(DISK))
                 if (resource.getType().equals(Protos.Value.Type.SCALAR))
                     disk = resource.getScalar().getValue();
                 else
-                    log.debug("Disk resource was not a scalar: " + resource.getType().toString());
+                    log.debug("Disk resource was not a scalar: {}", resource.getType());
         }
 
         // Check that slave satisfies min requirements.
         if (cpus < clusterLimit.minCpuPerNode()  && mem < clusterLimit.minMemoryPerNode()
) {
-            log.info("Offer not sufficient for slave request:\n" + offer.getResourcesList().toString()
+
-                "\n" + offer.getAttributesList().toString() +
-                "\nRequested for slave:\n" +
-                "  cpus:  " + cpus + "\n" +
-                "  mem:   " + mem);
+            log.debug("Offer not sufficient for slave request: {}", offer.getResourcesList());
 
             return null;
         }
@@ -245,22 +230,13 @@ public class IgniteScheduler implements Scheduler {
         if (cpus > 0 && mem > 0)
             return new IgniteTask(offer.getHostname(), cpus, mem, disk);
         else {
-            log.info("Offer not sufficient for slave request:\n" + offer.getResourcesList().toString()
+
-                "\n" + offer.getAttributesList().toString() +
-                "\nRequested for slave:\n" +
-                "  cpus:  " + cpus + "\n" +
-                "  mem:   " + mem);
+            log.debug("Offer not sufficient for slave request: {}", offer.getResourcesList());
 
             return null;
         }
     }
 
     /** {@inheritDoc} */
-    @Override public void offerRescinded(SchedulerDriver schedulerDriver, Protos.OfferID
offerID) {
-        log.info("offerRescinded()");
-    }
-
-    /** {@inheritDoc} */
     @Override public void statusUpdate(SchedulerDriver schedulerDriver, Protos.TaskStatus
taskStatus) {
         final String taskId = taskStatus.getTaskId().getValue();
 
@@ -296,29 +272,46 @@ public class IgniteScheduler implements Scheduler {
     }
 
     /** {@inheritDoc} */
-    @Override public void frameworkMessage(SchedulerDriver schedulerDriver, Protos.ExecutorID
executorID,
-        Protos.SlaveID slaveID, byte[] bytes) {
-        log.info("frameworkMessage()");
+    @Override public void registered(SchedulerDriver schedulerDriver, Protos.FrameworkID
frameworkID,
+        Protos.MasterInfo masterInfo) {
+        log.info("Scheduler registered. Master: [{}:{}], framework=[{}]", masterInfo.getIp(),
masterInfo.getPort(),
+            frameworkID);
     }
 
     /** {@inheritDoc} */
     @Override public void disconnected(SchedulerDriver schedulerDriver) {
-        log.info("disconnected()");
+        log.info("Scheduler disconnected.");
+    }
+
+    /** {@inheritDoc} */
+    @Override public void error(SchedulerDriver schedulerDriver, String s) {
+        log.error("Failed. Error message: {}", s);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void frameworkMessage(SchedulerDriver schedulerDriver, Protos.ExecutorID
executorID,
+        Protos.SlaveID slaveID, byte[] bytes) {
+        // No-op.
     }
 
     /** {@inheritDoc} */
     @Override public void slaveLost(SchedulerDriver schedulerDriver, Protos.SlaveID slaveID)
{
-        log.info("slaveLost()");
+        // No-op.
     }
 
     /** {@inheritDoc} */
     @Override public void executorLost(SchedulerDriver schedulerDriver, Protos.ExecutorID
executorID,
         Protos.SlaveID slaveID, int i) {
-        log.info("executorLost()");
+        // No-op.
     }
 
     /** {@inheritDoc} */
-    @Override public void error(SchedulerDriver schedulerDriver, String s) {
-        log.error("error() {}", s);
+    @Override public void offerRescinded(SchedulerDriver schedulerDriver, Protos.OfferID
offerID) {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override public void reregistered(SchedulerDriver schedulerDriver, Protos.MasterInfo
masterInfo) {
+        // No-op.
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e3bcb2e/modules/mesos/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/mesos/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java
b/modules/mesos/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java
index 8f8ca8b..4124331 100644
--- a/modules/mesos/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java
+++ b/modules/mesos/src/test/java/org/apache/ignite/mesos/IgniteSchedulerSelfTest.java
@@ -159,6 +159,5 @@ public class IgniteSchedulerSelfTest extends TestCase {
         @Override public Protos.Status reconcileTasks(Collection<Protos.TaskStatus>
statuses) {
             return null;
         }
-
     }
 }
\ No newline at end of file


Mime
View raw message