ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [02/38] incubator-ignite git commit: #IGNITE-857 Decline offer with doesn't match by mem and cpu
Date Fri, 29 May 2015 11:46:37 GMT
#IGNITE-857 Decline offer with doesn't match by mem and cpu


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b896ec8b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b896ec8b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b896ec8b

Branch: refs/heads/ignite-943
Commit: b896ec8b311b65af97a53d8271ee4bfe69e1ebd3
Parents: 934bf69
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Fri May 8 16:42:48 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Fri May 8 16:42:48 2015 +0300

----------------------------------------------------------------------
 modules/mesos/pom.xml                              |  2 +-
 .../org/apache/ignite/messo/IgniteScheduler.java   | 17 ++++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b896ec8b/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 8c50085..4d19b11 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -59,7 +59,7 @@
                 <version>2.4.1</version>
                 <configuration>
                     <descriptorRefs>
-                        <descriptorRef>fat-jar</descriptorRef>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
                     </descriptorRefs>
                 </configuration>
                 <executions>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b896ec8b/modules/mesos/src/main/java/org/apache/ignite/messo/IgniteScheduler.java
----------------------------------------------------------------------
diff --git a/modules/mesos/src/main/java/org/apache/ignite/messo/IgniteScheduler.java b/modules/mesos/src/main/java/org/apache/ignite/messo/IgniteScheduler.java
index bddcec6..3cb63e6 100644
--- a/modules/mesos/src/main/java/org/apache/ignite/messo/IgniteScheduler.java
+++ b/modules/mesos/src/main/java/org/apache/ignite/messo/IgniteScheduler.java
@@ -60,15 +60,15 @@ public class IgniteScheduler implements Scheduler {
     @Override public void resourceOffers(SchedulerDriver schedulerDriver, List<Protos.Offer>
offers) {
         log.info("resourceOffers() with {} offers", offers.size());
 
-        List<Protos.OfferID> offerIDs = new ArrayList<>(offers.size());
-        List<Protos.TaskInfo> tasks = new ArrayList<>(offers.size());
-
         for (Protos.Offer offer : offers) {
             Pair<Double, Double> cpuMem = checkOffer(offer);
 
-            //
-            if (cpuMem == null)
+            // Decline offer which doesn't match by mem or cpu.
+            if (cpuMem == null) {
+                schedulerDriver.declineOffer(offer.getId());
+
                 continue;
+            }
 
             // Generate a unique task ID.
             Protos.TaskID taskId = Protos.TaskID.newBuilder()
@@ -103,11 +103,10 @@ public class IgniteScheduler implements Scheduler {
                 .setCommand(Protos.CommandInfo.newBuilder().setShell(false))
                 .build();
 
-            offerIDs.add(offer.getId());
-            tasks.add(task);
+            schedulerDriver.launchTasks(Collections.singletonList(offer.getId()),
+                Collections.singletonList(task),
+                Protos.Filters.newBuilder().setRefuseSeconds(1).build());
         }
-
-        schedulerDriver.launchTasks(offerIDs, tasks, Protos.Filters.newBuilder().setRefuseSeconds(1).build());
     }
 
     /**


Mime
View raw message