ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [39/50] incubator-ignite git commit: # ignite-857 review
Date Fri, 29 May 2015 07:07:02 GMT
# ignite-857 review


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

Branch: refs/heads/ignite-471-2
Commit: a36214c77564372916cb345b1a08f8e095276832
Parents: 789106b
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Thu May 28 17:20:58 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Thu May 28 17:20:58 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/mesos/IgniteScheduler.java   | 12 ++++++++----
 .../apache/ignite/mesos/IgniteSchedulerSelfTest.java    |  8 +++-----
 2 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a36214c7/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 e833025..9507642 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
@@ -40,14 +40,14 @@ public class IgniteScheduler implements Scheduler {
     /** Default port range. */
     public static final String DEFAULT_PORT = ":47500..47510";
 
-    /** Delimiter to use in IP names. */
+    /** Delimiter char. */
     public static final String DELIM = ",";
 
     /** Logger. */
     private static final Logger log = LoggerFactory.getLogger(IgniteScheduler.class);
 
     /** Mutex. */
-    private static final Object mux = new Object();
+    private final Object mux = new Object();
 
     /** ID generator. */
     private AtomicInteger taskIdGenerator = new AtomicInteger();
@@ -89,7 +89,7 @@ public class IgniteScheduler implements Scheduler {
                 Protos.TaskID taskId = Protos.TaskID.newBuilder()
                     .setValue(Integer.toString(taskIdGenerator.incrementAndGet())).build();
 
-                log.info("Launching task: [{}]", igniteTask);
+                log.info("Launching task: {}", igniteTask);
 
                 // Create task to run.
                 Protos.TaskInfo task = createTask(offer, igniteTask, taskId);
@@ -175,7 +175,9 @@ public class IgniteScheduler implements Scheduler {
     /**
      * @return Address running nodes.
      */
-    protected String getAddress(String address) {
+    private String getAddress(String address) {
+        assert Thread.holdsLock(mux);
+
         if (tasks.isEmpty()) {
             if (address != null && !address.isEmpty())
                 return address + DEFAULT_PORT;
@@ -198,6 +200,8 @@ public class IgniteScheduler implements Scheduler {
      * @return Ignite task description.
      */
     private IgniteTask checkOffer(Protos.Offer offer) {
+        assert Thread.holdsLock(mux);
+
         // Check limit on running nodes.
         if (clusterProps.instances() <= tasks.size())
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a36214c7/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 13855b5..d627553 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
@@ -341,16 +341,14 @@ public class IgniteSchedulerSelfTest extends TestCase {
      * No-op implementation.
      */
     public static class DriverMock implements SchedulerDriver {
-        /**
-         *
-         */
+        /** */
         Collection<Protos.TaskInfo> launchedTask;
 
         /** */
         Protos.OfferID declinedOffer;
 
         /**
-         * Clear launched task.
+         * Clears launched task.
          */
         public void clear() {
             launchedTask = null;
@@ -463,4 +461,4 @@ public class IgniteSchedulerSelfTest extends TestCase {
             return null;
         }
     }
-}
\ No newline at end of file
+}


Mime
View raw message