myriad-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smare...@apache.org
Subject [01/20] incubator-myriad git commit: spacing changes
Date Wed, 28 Oct 2015 16:07:33 GMT
Repository: incubator-myriad
Updated Branches:
  refs/heads/master e0ca4da1d -> 101bcad35


http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/MyriadWebServer.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/MyriadWebServer.java b/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/MyriadWebServer.java
index 93237d5..2b54d4c 100644
--- a/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/MyriadWebServer.java
+++ b/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/MyriadWebServer.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -30,44 +30,43 @@ import javax.inject.Inject;
  * The myriad web server configuration for jetty
  */
 public class MyriadWebServer {
-    private final Server jetty;
-    private final Connector connector;
-    private final GuiceFilter filter;
+  private final Server jetty;
+  private final Connector connector;
+  private final GuiceFilter filter;
 
-    @Inject
-    public MyriadWebServer(Server jetty, Connector connector, GuiceFilter filter) {
-        this.jetty = jetty;
-        this.connector = connector;
-        this.filter = filter;
-    }
+  @Inject
+  public MyriadWebServer(Server jetty, Connector connector, GuiceFilter filter) {
+    this.jetty = jetty;
+    this.connector = connector;
+    this.filter = filter;
+  }
 
-    public void start() throws Exception {
-        this.jetty.addConnector(connector);
+  public void start() throws Exception {
+    this.jetty.addConnector(connector);
 
-        ServletHandler servletHandler = new ServletHandler();
+    ServletHandler servletHandler = new ServletHandler();
 
-        String filterName = "MyriadGuiceFilter";
-        FilterHolder holder = new FilterHolder(filter);
-        holder.setName(filterName);
+    String filterName = "MyriadGuiceFilter";
+    FilterHolder holder = new FilterHolder(filter);
+    holder.setName(filterName);
 
-        FilterMapping filterMapping = new FilterMapping();
-        filterMapping.setPathSpec("/*");
-        filterMapping.setDispatches(Handler.ALL);
-        filterMapping.setFilterName(filterName);
+    FilterMapping filterMapping = new FilterMapping();
+    filterMapping.setPathSpec("/*");
+    filterMapping.setDispatches(Handler.ALL);
+    filterMapping.setFilterName(filterName);
 
-        servletHandler.addFilter(holder, filterMapping);
+    servletHandler.addFilter(holder, filterMapping);
 
-        Context context = new Context();
-        context.setServletHandler(servletHandler);
-        context.addServlet(DefaultServlet.class, "/");
+    Context context = new Context();
+    context.setServletHandler(servletHandler);
+    context.addServlet(DefaultServlet.class, "/");
 
-        String staticDir = this.getClass().getClassLoader().getResource("webapp/public").toExternalForm();
-        context.setResourceBase(staticDir);
-
-        this.jetty.addHandler(context);
-        this.jetty.start();
-    }
+    String staticDir = this.getClass().getClassLoader().getResource("webapp/public").toExternalForm();
+    context.setResourceBase(staticDir);
 
+    this.jetty.addHandler(context);
+    this.jetty.start();
+  }
 
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/WebAppGuiceModule.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/WebAppGuiceModule.java b/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/WebAppGuiceModule.java
index f87ce72..861dc00 100644
--- a/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/WebAppGuiceModule.java
+++ b/myriad-scheduler/src/main/java/com/ebay/myriad/webapp/WebAppGuiceModule.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -26,9 +26,9 @@ import org.mortbay.jetty.Connector;
  */
 public class WebAppGuiceModule extends AbstractModule {
 
-    @Override
-    protected void configure() {
-        bind(Connector.class).toProvider(HttpConnectorProvider.class);
-        install(new MyriadServletModule());
-    }
+  @Override
+  protected void configure() {
+    bind(Connector.class).toProvider(HttpConnectorProvider.class);
+    install(new MyriadServletModule());
+  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/MyriadFileSystemRMStateStore.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/MyriadFileSystemRMStateStore.java b/myriad-scheduler/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/MyriadFileSystemRMStateStore.java
index 7020a67..227229c 100644
--- a/myriad-scheduler/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/MyriadFileSystemRMStateStore.java
+++ b/myriad-scheduler/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/recovery/MyriadFileSystemRMStateStore.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,23 +32,21 @@ import com.ebay.myriad.state.MyriadStateStore;
 import com.ebay.myriad.state.utils.StoreContext;
 
 /**
- * StateStore that stores Myriad state in addition to RM state to DFS. 
+ * StateStore that stores Myriad state in addition to RM state to DFS.
  */
-public class MyriadFileSystemRMStateStore extends FileSystemRMStateStore
-  implements MyriadStateStore {
+public class MyriadFileSystemRMStateStore extends FileSystemRMStateStore implements MyriadStateStore {
 
-  private static final Logger LOGGER =
-    LoggerFactory.getLogger(MyriadFileSystemRMStateStore.class);
+  private static final Logger LOGGER = LoggerFactory.getLogger(MyriadFileSystemRMStateStore.class);
 
   protected static final String ROOT_NAME = "FSRMStateRoot";
   private static final String RM_MYRIAD_ROOT = "RMMyriadRoot";
   private static final String MYRIAD_STATE_FILE = "MyriadState";
 
   private Path myriadPathRoot = null;
-  private byte[] myriadStateBytes = null; 
+  private byte[] myriadStateBytes = null;
 
   @Override
-  public synchronized void initInternal(Configuration conf) throws Exception{
+  public synchronized void initInternal(Configuration conf) throws Exception {
     super.initInternal(conf);
     Path rootPath = new Path(fsWorkingPath, ROOT_NAME);
     myriadPathRoot = new Path(rootPath, RM_MYRIAD_ROOT);
@@ -70,13 +68,12 @@ public class MyriadFileSystemRMStateStore extends FileSystemRMStateStore
     try {
       // Throws IOException if file is not present.
       FileStatus fileStatus = fs.listStatus(myriadStatePath)[0];
-      FSDataInputStream in = fs.open(myriadStatePath);        
+      FSDataInputStream in = fs.open(myriadStatePath);
       myriadStateBytes = new byte[(int) fileStatus.getLen()];
       in.readFully(myriadStateBytes);
       in.close();
     } catch (IOException e) {
-      LOGGER.error("State information for Myriad could not be loaded from: "
-        + myriadStatePath);
+      LOGGER.error("State information for Myriad could not be loaded from: " + myriadStatePath);
     }
     return rmState;
   }
@@ -92,15 +89,14 @@ public class MyriadFileSystemRMStateStore extends FileSystemRMStateStore
   }
 
   @Override
-  public synchronized void storeMyriadState(StoreContext sc) throws Exception{
+  public synchronized void storeMyriadState(StoreContext sc) throws Exception {
     Path myriadStatePath = new Path(myriadPathRoot, MYRIAD_STATE_FILE);
 
     LOGGER.debug("Storing state information for Myriad at: " + myriadStatePath);
     try {
       updateFile(myriadStatePath, sc.toSerializedContext().toByteArray());
     } catch (Exception e) {
-        LOGGER.error("State information for Myriad could not be stored at: "
-                + myriadStatePath, e);
+      LOGGER.error("State information for Myriad could not be stored at: " + myriadStatePath, e);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/MesosModule.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/MesosModule.java b/myriad-scheduler/src/test/java/com/ebay/myriad/MesosModule.java
index a83d29b..5f4dd8e 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/MesosModule.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/MesosModule.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -51,10 +51,7 @@ public class MesosModule extends AbstractModule {
 
   @Provides
   @Singleton
-  SchedulerDriver providesSchedulerDriver(
-      MyriadScheduler scheduler,
-      MyriadConfiguration cfg,
-      SchedulerState schedulerState) {
+  SchedulerDriver providesSchedulerDriver(MyriadScheduler scheduler, MyriadConfiguration cfg, SchedulerState schedulerState) {
 
     SchedulerDriver driver = Mockito.mock(SchedulerDriver.class);
     Mockito.when(driver.start()).thenReturn(Status.DRIVER_RUNNING);
@@ -74,14 +71,12 @@ public class MesosModule extends AbstractModule {
     };
 
     Variable var = Mockito.mock(Variable.class);
-    Protos.FrameworkID id = Protos.FrameworkID.newBuilder()
-      .setValue("1").build();
+    Protos.FrameworkID id = Protos.FrameworkID.newBuilder().setValue("1").build();
 
     Mockito.when(var.value()).thenReturn(id.toByteArray());
     FutureTask<Variable> futureTask = new FutureTask<Variable>(dummyTask, var);
     futureTask.run();
-    Mockito.when(stateStore.fetch(MyriadState.KEY_FRAMEWORK_ID))
-      .thenReturn(futureTask);
+    Mockito.when(stateStore.fetch(MyriadState.KEY_FRAMEWORK_ID)).thenReturn(futureTask);
 
     return stateStore;
   }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsTest.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsTest.java b/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsTest.java
index 1bbd175..e282f21 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsTest.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsTest.java
@@ -1,20 +1,20 @@
 /**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package com.ebay.myriad;
 
@@ -32,17 +32,15 @@ import com.google.inject.Injector;
 
 /**
  * Test for Multibindings
- *
  */
 public class MultiBindingsTest {
 
   private static Injector injector;
-  
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     MyriadTestModule myriadModule = new MyriadTestModule();
-    injector = Guice.createInjector(
-            myriadModule);
+    injector = Guice.createInjector(myriadModule);
 
   }
 
@@ -52,22 +50,22 @@ public class MultiBindingsTest {
 
   @Test
   public void multiBindingsTest() {
-    
-    
+
+
     MultiBindingsUsage myinstance = injector.getInstance(MultiBindingsUsage.class);
-    
+
     Map<String, TaskFactory> taskMap = myinstance.getMap();
     assertNotNull(taskMap);
     assertEquals(3, taskMap.size());
-    
+
     taskMap = myinstance.getMap();
     for (Map.Entry<String, TaskFactory> entry : taskMap.entrySet()) {
       String keyName = entry.getKey();
       TaskFactory taskFactory = entry.getValue();
       System.out.println(taskFactory);
     }
-    
-    
+
+
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsUsage.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsUsage.java b/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsUsage.java
index aea29ed..d38f5a3 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsUsage.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/MultiBindingsUsage.java
@@ -1,20 +1,20 @@
 /**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package com.ebay.myriad;
 
@@ -26,7 +26,6 @@ import com.ebay.myriad.scheduler.TaskFactory;
 
 /**
  * Helper class to test multibindings
- *
  */
 public class MultiBindingsUsage {
 

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/MyriadTestModule.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/MyriadTestModule.java b/myriad-scheduler/src/test/java/com/ebay/myriad/MyriadTestModule.java
index a7f159f..a9dd0dc 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/MyriadTestModule.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/MyriadTestModule.java
@@ -1,20 +1,20 @@
 /**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package com.ebay.myriad;
 
@@ -44,23 +44,20 @@ import com.google.inject.multibindings.MapBinder;
 
 /**
  * AbstractModule extension for UnitTests
- *
  */
 public class MyriadTestModule extends AbstractModule {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(MyriadTestModule.class);
-  
+
   private MyriadConfiguration cfg;
-  
+
   @SuppressWarnings("unchecked")
   @Override
   protected void configure() {
-    
+
     ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
     try {
-      cfg = mapper.readValue(
-              Thread.currentThread().getContextClassLoader().getResource("myriad-config-test-default.yml"),
-              MyriadConfiguration.class);
+      cfg = mapper.readValue(Thread.currentThread().getContextClassLoader().getResource("myriad-config-test-default.yml"), MyriadConfiguration.class);
     } catch (IOException e1) {
       LOGGER.error("IOException", e1);
       return;
@@ -69,11 +66,10 @@ public class MyriadTestModule extends AbstractModule {
     if (cfg == null) {
       return;
     }
-    
+
     bind(MyriadConfiguration.class).toInstance(cfg);
 
-    MapBinder<String, TaskFactory> mapBinder
-    = MapBinder.newMapBinder(binder(), String.class, TaskFactory.class);
+    MapBinder<String, TaskFactory> mapBinder = MapBinder.newMapBinder(binder(), String.class, TaskFactory.class);
     mapBinder.addBinding(NodeManagerConfiguration.NM_TASK_PREFIX).to(NMTaskFactoryImpl.class).in(Scopes.SINGLETON);
     Map<String, ServiceConfiguration> auxServicesConfigs = cfg.getServiceConfigurations();
     for (Map.Entry<String, ServiceConfiguration> entry : auxServicesConfigs.entrySet()) {
@@ -94,16 +90,14 @@ public class MyriadTestModule extends AbstractModule {
   @Provides
   @Singleton
   ExecutorCommandLineGenerator providesCLIGenerator(MyriadConfiguration cfg) {
-      ExecutorCommandLineGenerator cliGenerator = null;
-      MyriadExecutorConfiguration myriadExecutorConfiguration =
-          cfg.getMyriadExecutorConfiguration();
-      if (myriadExecutorConfiguration.getNodeManagerUri().isPresent()) {
-          cliGenerator = new DownloadNMExecutorCLGenImpl(cfg,
-             myriadExecutorConfiguration.getNodeManagerUri().get());
-      } else {
-          cliGenerator = new NMExecutorCLGenImpl(cfg);
-      }
-      return cliGenerator;
-  }    
+    ExecutorCommandLineGenerator cliGenerator = null;
+    MyriadExecutorConfiguration myriadExecutorConfiguration = cfg.getMyriadExecutorConfiguration();
+    if (myriadExecutorConfiguration.getNodeManagerUri().isPresent()) {
+      cliGenerator = new DownloadNMExecutorCLGenImpl(cfg, myriadExecutorConfiguration.getNodeManagerUri().get());
+    } else {
+      cliGenerator = new NMExecutorCLGenImpl(cfg);
+    }
+    return cliGenerator;
+  }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadBadConfigurationExceptionTest.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadBadConfigurationExceptionTest.java b/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadBadConfigurationExceptionTest.java
index bae4ff2..6c75b38 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadBadConfigurationExceptionTest.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadBadConfigurationExceptionTest.java
@@ -1,20 +1,20 @@
 /**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package com.ebay.myriad.configuration;
 
@@ -26,7 +26,6 @@ import org.junit.Test;
 
 /**
  * Class to test MyriadBadConfigurationException
- *
  */
 public class MyriadBadConfigurationExceptionTest {
 
@@ -42,7 +41,7 @@ public class MyriadBadConfigurationExceptionTest {
   public void myriadExceptionTest() {
     final String testStr = "com.ebay.myriad.configuration.MyriadBadConfigurationException: Bad configuration exception";
     MyriadBadConfigurationException exp = new MyriadBadConfigurationException("Bad configuration exception");
-    
+
     assertEquals(testStr, exp.toString());
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadConfigurationTest.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadConfigurationTest.java b/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadConfigurationTest.java
index b7a4cd9..85d4dfa 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadConfigurationTest.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/configuration/MyriadConfigurationTest.java
@@ -1,20 +1,20 @@
 /**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package com.ebay.myriad.configuration;
 
@@ -31,18 +31,15 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
 
 /**
  * AuxServices/tasks test
- *
  */
 public class MyriadConfigurationTest {
 
   static MyriadConfiguration cfg;
-  
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
-    cfg = mapper.readValue(
-            Thread.currentThread().getContextClassLoader().getResource("myriad-config-test-default.yml"),
-            MyriadConfiguration.class);
+    cfg = mapper.readValue(Thread.currentThread().getContextClassLoader().getResource("myriad-config-test-default.yml"), MyriadConfiguration.class);
 
   }
 
@@ -52,12 +49,12 @@ public class MyriadConfigurationTest {
 
   @Test
   public void additionalPropertiestest() throws Exception {
-    
+
     Map<String, ServiceConfiguration> auxConfigs = cfg.getServiceConfigurations();
-    
+
     assertNotNull(auxConfigs);
     assertEquals(auxConfigs.size(), 2);
-    
+
     for (Map.Entry<String, ServiceConfiguration> entry : auxConfigs.entrySet()) {
       String taskName = entry.getKey();
       ServiceConfiguration config = entry.getValue();

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/SchedulerUtilsSpec.groovy
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/SchedulerUtilsSpec.groovy b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/SchedulerUtilsSpec.groovy
index 0f53f8d..4846c21 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/SchedulerUtilsSpec.groovy
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/SchedulerUtilsSpec.groovy
@@ -39,13 +39,13 @@ class SchedulerUtilsSpec extends Specification {
         returnValue == SchedulerUtils.isUniqueHostname(offer, launchTask, tasks)
 
         where:
-        tasks                                              | launchTask 					| returnValue
-        []                                                 | null							| true
-        null                                               | null							| true
-        createNodeTaskList("hostname")                     | createNodeTask("hostname") 	| false
-        createNodeTaskList("missinghost")                  | createNodeTask("hostname") 	| true
-        createNodeTaskList("missinghost1", "missinghost2") | createNodeTask("missinghost3")	| true
-        createNodeTaskList("missinghost1", "hostname")     | createNodeTask("hostname")		| false
+        tasks                                              | launchTask                     | returnValue
+        []                                                 | null                           | true
+        null                                               | null                           | true
+        createNodeTaskList("hostname")                     | createNodeTask("hostname")     | false
+        createNodeTaskList("missinghost")                  | createNodeTask("hostname")     | true
+        createNodeTaskList("missinghost1", "missinghost2") | createNodeTask("missinghost3") | true
+        createNodeTaskList("missinghost1", "hostname")     | createNodeTask("hostname")     | false
 
     }
 
@@ -82,7 +82,7 @@ class SchedulerUtilsSpec extends Specification {
 
 
     NodeTask createNodeTask(String hostname) {
-        def node = new NodeTask(new ExtendedResourceProfile(new NMProfile("", 1, 1), 1.0,1.0), null)
+        def node = new NodeTask(new ExtendedResourceProfile(new NMProfile("", 1, 1), 1.0, 1.0), null)
         node.hostname = hostname
         node.taskPrefix = "nm"
         node

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TMSTaskFactoryImpl.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TMSTaskFactoryImpl.java b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TMSTaskFactoryImpl.java
index e7b77f1..8a0a0b4 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TMSTaskFactoryImpl.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TMSTaskFactoryImpl.java
@@ -1,20 +1,20 @@
 /**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package com.ebay.myriad.scheduler;
 
@@ -32,7 +32,6 @@ import com.ebay.myriad.state.NodeTask;
 
 /**
  * Test implementation of TaskFactory
- *
  */
 public class TMSTaskFactoryImpl implements TaskFactory {
 
@@ -41,13 +40,12 @@ public class TMSTaskFactoryImpl implements TaskFactory {
 
   @Inject
   public TMSTaskFactoryImpl(MyriadConfiguration cfg, TaskUtils taskUtils) {
-      this.setCfg(cfg);
-      this.setTaskUtils(taskUtils);
+    this.setCfg(cfg);
+    this.setTaskUtils(taskUtils);
   }
 
   @Override
-  public TaskInfo createTask(Offer offer, FrameworkID frameworkId, 
-      TaskID taskId, NodeTask nodeTask) {
+  public TaskInfo createTask(Offer offer, FrameworkID frameworkId, TaskID taskId, NodeTask nodeTask) {
     return null;
   }
 
@@ -68,8 +66,7 @@ public class TMSTaskFactoryImpl implements TaskFactory {
   }
 
   @Override
-  public ExecutorInfo getExecutorInfoForSlave(FrameworkID frameworkId,
-      Offer offer, CommandInfo commandInfo) {
+  public ExecutorInfo getExecutorInfoForSlave(FrameworkID frameworkId, Offer offer, CommandInfo commandInfo) {
     return null;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestMyriadScheduler.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestMyriadScheduler.java b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestMyriadScheduler.java
index c035426..3567c3f 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestMyriadScheduler.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestMyriadScheduler.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -81,11 +81,9 @@ public class TestMyriadScheduler {
 
   public Configuration createConfiguration() {
     Configuration conf = new YarnConfiguration();
-    conf.setClass(YarnConfiguration.RM_SCHEDULER, FairScheduler.class,
-        ResourceScheduler.class);
+    conf.setClass(YarnConfiguration.RM_SCHEDULER, FairScheduler.class, ResourceScheduler.class);
     conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 0);
-    conf.setInt(FairSchedulerConfiguration.RM_SCHEDULER_INCREMENT_ALLOCATION_MB,
-        1024);
+    conf.setInt(FairSchedulerConfiguration.RM_SCHEDULER_INCREMENT_ALLOCATION_MB, 1024);
     conf.setInt(YarnConfiguration.RM_SCHEDULER_MAXIMUM_ALLOCATION_MB, 10240);
     return conf;
   }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestServiceCommandLine.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestServiceCommandLine.java b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestServiceCommandLine.java
index 40e3f48..f785f2e 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestServiceCommandLine.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestServiceCommandLine.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,24 +32,21 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
 
 /**
  * Class to test CommandLine generation
- *
  */
 public class TestServiceCommandLine {
 
   static MyriadConfiguration cfg;
-  
+
   static String toJHSCompare = "echo \"sudo tar -zxpf hadoop-2.5.0.tar.gz && sudo chown hduser . &&" +
       " cp conf /usr/local/hadoop/etc/hadoop/yarn-site.xml; sudo -E -u hduser -H $YARN_HOME/bin/mapred historyserver\";" +
       "sudo tar -zxpf hadoop-2.5.0.tar.gz && sudo chown hduser . && cp conf /usr/local/hadoop/etc/hadoop/yarn-site.xml; sudo -E -u hduser -H $YARN_HOME/bin/mapred historyserver";
-  
+
   static String toCompare = "echo \"sudo tar -zxpf hadoop-2.5.0.tar.gz && sudo chown hduser . && cp conf /usr/local/hadoop/etc/hadoop/yarn-site.xml;";
-  
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
-    cfg = mapper.readValue(
-            Thread.currentThread().getContextClassLoader().getResource("myriad-config-test-default.yml"),
-            MyriadConfiguration.class);
+    cfg = mapper.readValue(Thread.currentThread().getContextClassLoader().getResource("myriad-config-test-default.yml"), MyriadConfiguration.class);
 
   }
 
@@ -62,24 +59,24 @@ public class TestServiceCommandLine {
     ServiceTaskFactoryImpl jhs = new ServiceTaskFactoryImpl(cfg, null);
     String executorCmd = "$YARN_HOME/bin/mapred historyserver";
     ServiceResourceProfile profile = new ServiceResourceProfile("jobhistory", 10.0, 15.0);
-    
+
     CommandInfo cInfo = jhs.createCommandInfo(profile, executorCmd);
-     
+
     assertTrue(cInfo.getValue().startsWith(toCompare));
   }
 
   @Test
   public void testNMCommandLineGeneration() throws Exception {
-    Long [] ports = new Long [] {1L, 2L, 3L, 4L};
+    Long[] ports = new Long[]{1L, 2L, 3L, 4L};
     NMPorts nmPorts = new NMPorts(ports);
-    
+
     ServiceResourceProfile profile = new ExtendedResourceProfile(new NMProfile("nm", 10L, 15L), 3.0, 5.0);
-    
+
     ExecutorCommandLineGenerator clGenerator = new DownloadNMExecutorCLGenImpl(cfg, "hdfs://namenode:port/dist/hadoop-2.5.0.tar.gz");
     NMTaskFactoryImpl nms = new NMTaskFactoryImpl(cfg, null, clGenerator);
-    
+
     CommandInfo cInfo = nms.getCommandInfo(profile, nmPorts);
-    
+
     assertTrue(cInfo.getValue().startsWith(toCompare));
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestTaskUtils.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestTaskUtils.java b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestTaskUtils.java
index ad2542b..f296f63 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestTaskUtils.java
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/TestTaskUtils.java
@@ -1,20 +1,20 @@
 /**
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package com.ebay.myriad.scheduler;
 
 import static org.junit.Assert.*;
@@ -32,18 +32,15 @@ import com.google.gson.GsonBuilder;
 
 /**
  * Tests for TaskUtils
- *
  */
 public class TestTaskUtils {
 
   static MyriadConfiguration cfg;
-  
+
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
     ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
-    cfg = mapper.readValue(
-            Thread.currentThread().getContextClassLoader().getResource("myriad-config-test-default.yml"),
-            MyriadConfiguration.class);
+    cfg = mapper.readValue(Thread.currentThread().getContextClassLoader().getResource("myriad-config-test-default.yml"), MyriadConfiguration.class);
   }
 
   @AfterClass
@@ -53,7 +50,7 @@ public class TestTaskUtils {
   @Test
   public void testGetResource() {
     TaskUtils taskUtils = new TaskUtils(cfg);
-    
+
     NMProfile fooProfile = new NMProfile("abc", 1L, 1000L);
     try {
       taskUtils.getAuxTaskCpus(fooProfile, "foo");
@@ -61,32 +58,32 @@ public class TestTaskUtils {
     } catch (MyriadBadConfigurationException e) {
       // success
     }
-    
+
     try {
       double cpu = taskUtils.getAuxTaskCpus(fooProfile, "jobhistory");
       assertTrue(cpu > 0.0);
     } catch (MyriadBadConfigurationException e) {
       fail("cpu should be defined for jobhistory");
-    }    
+    }
   }
-  
+
   @Test
   public void testServiceResourceProfile() throws Exception {
     // testing custom deserializer
-    
+
     Gson gson = new GsonBuilder().registerTypeAdapter(ServiceResourceProfile.class, new ServiceResourceProfile.CustomDeserializer()).create();
-    
+
 
     ServiceResourceProfile parentProfile = new ServiceResourceProfile("abc", 1.0, 100.0);
 
     String parentStr = gson.toJson(parentProfile);
     ServiceResourceProfile processedProfile = gson.fromJson(parentStr, ServiceResourceProfile.class);
-    
+
     assertTrue(processedProfile.getClass().equals(ServiceResourceProfile.class));
     assertTrue(processedProfile.toString().equalsIgnoreCase(parentStr));
-    
+
     ServiceResourceProfile childProfile = new ExtendedResourceProfile(new NMProfile("bcd", 5L, 15L), 2.0, 7.0);
-    
+
     String childStr = gson.toJson(childProfile);
     ServiceResourceProfile processedChildProfile = gson.fromJson(childStr, ServiceResourceProfile.class);
 
@@ -95,9 +92,9 @@ public class TestTaskUtils {
   }
 
   @Test
-  
+
   public void testStackTrace() {
-    
+
     new Throwable().printStackTrace();
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/constraints/LikeConstraintSpec.groovy
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/constraints/LikeConstraintSpec.groovy b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/constraints/LikeConstraintSpec.groovy
index 0267855..497564e 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/constraints/LikeConstraintSpec.groovy
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/constraints/LikeConstraintSpec.groovy
@@ -32,62 +32,62 @@ import static org.apache.mesos.Protos.Value.Type.TEXT
  */
 class LikeConstraintSpec extends Specification {
 
-  def "is matching host name"() {
-    given:
-    def constraint = new LikeConstraint("hostname", "host-[0-9]*.example.com")
+    def "is matching host name"() {
+        given:
+        def constraint = new LikeConstraint("hostname", "host-[0-9]*.example.com")
 
-    expect:
-    returnValue == constraint.matchesHostName(inputHostName)
+        expect:
+        returnValue == constraint.matchesHostName(inputHostName)
 
-    where:
-    inputHostName         | returnValue
-    null                  | false
-    ""                    | false
-    "blah-blue"           | false
-    "host-12.example.com" | true
-    "host-1.example.com"  | true
-    "host-2.example.com"  | true
-  }
+        where:
+        inputHostName         | returnValue
+        null                  | false
+        ""                    | false
+        "blah-blue"           | false
+        "host-12.example.com" | true
+        "host-1.example.com"  | true
+        "host-2.example.com"  | true
+    }
 
-  def "is matching dfs attribute"() {
-    given:
-    def constraint = new LikeConstraint("dfs", "true")
+    def "is matching dfs attribute"() {
+        given:
+        def constraint = new LikeConstraint("dfs", "true")
 
-    expect:
-    returnValue == constraint.matchesSlaveAttributes(attributes)
+        expect:
+        returnValue == constraint.matchesSlaveAttributes(attributes)
 
-    where:
-    attributes                                                     | returnValue
-    null                                                           | false
-    Lists.newArrayList()                                           | false
-    Lists.newArrayList(getTextAttribute("dfs", ""))                | false
-    Lists.newArrayList(getTextAttribute("dfs", "false"))           | false
-    Lists.newArrayList(getTextAttribute("Distributed FS", "true")) | false
-    Lists.newArrayList(getTextAttribute("dfs", "true"))            | true
-    Lists.newArrayList(getTextAttribute("dfs", "true"),
-        getTextAttribute("random", "random value"))                | true
-  }
+        where:
+        attributes                                                     | returnValue
+        null                                                           | false
+        Lists.newArrayList()                                           | false
+        Lists.newArrayList(getTextAttribute("dfs", ""))                | false
+        Lists.newArrayList(getTextAttribute("dfs", "false"))           | false
+        Lists.newArrayList(getTextAttribute("Distributed FS", "true")) | false
+        Lists.newArrayList(getTextAttribute("dfs", "true"))            | true
+        Lists.newArrayList(getTextAttribute("dfs", "true"),
+                getTextAttribute("random", "random value"))            | true
+    }
 
-  def "equals"() {
-    given:
-    def constraint1 = new LikeConstraint("hostname", "perfnode13[3-4].perf.lab")
-    def constraint2 = new LikeConstraint("hostname", "perfnode13[3-4].perf.lab")
-    def constraint3 = new LikeConstraint("hostname", "perfnode133.perf.lab")
+    def "equals"() {
+        given:
+        def constraint1 = new LikeConstraint("hostname", "perfnode13[3-4].perf.lab")
+        def constraint2 = new LikeConstraint("hostname", "perfnode13[3-4].perf.lab")
+        def constraint3 = new LikeConstraint("hostname", "perfnode133.perf.lab")
 
-    expect:
-    constraint1.equals(constraint2)
-    !constraint1.equals(constraint3)
-    !constraint2.equals(constraint3)
-  }
+        expect:
+        constraint1.equals(constraint2)
+        !constraint1.equals(constraint3)
+        !constraint2.equals(constraint3)
+    }
 
-  private static Protos.Attribute getTextAttribute(String name, String value) {
-    Protos.Attribute.newBuilder()
-        .setName(name)
-        .setType(TEXT)
-        .setText(Text.newBuilder()
-        .setValue(value))
-        .build()
-  }
+    private static Protos.Attribute getTextAttribute(String name, String value) {
+        Protos.Attribute.newBuilder()
+                .setName(name)
+                .setType(TEXT)
+                .setText(Text.newBuilder()
+                .setValue(value))
+                .build()
+    }
 
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/FGSTestBaseSpec.groovy
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/FGSTestBaseSpec.groovy b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/FGSTestBaseSpec.groovy
index 225d144..166d0f6 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/FGSTestBaseSpec.groovy
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/FGSTestBaseSpec.groovy
@@ -48,123 +48,123 @@ import java.util.concurrent.ConcurrentHashMap
  *
  */
 class FGSTestBaseSpec extends Specification {
-  def nodeStore = new NodeStore()
-  def mesosDriver = Mock(SchedulerDriver)
-  def myriadDriver = new MyriadDriver(mesosDriver)
-  def offerLifecycleManager = new OfferLifecycleManager(nodeStore, myriadDriver)
-
-  def cfg = new MyriadConfiguration()
-
-  void setup() {
-    ObjectMapper mapper = new ObjectMapper(new YAMLFactory())
-    cfg = mapper.readValue(
-        Thread.currentThread().getContextClassLoader().getResource("myriad-config-default.yml"),
-        MyriadConfiguration.class)
-  }
+    def nodeStore = new NodeStore()
+    def mesosDriver = Mock(SchedulerDriver)
+    def myriadDriver = new MyriadDriver(mesosDriver)
+    def offerLifecycleManager = new OfferLifecycleManager(nodeStore, myriadDriver)
+
+    def cfg = new MyriadConfiguration()
+
+    void setup() {
+        ObjectMapper mapper = new ObjectMapper(new YAMLFactory())
+        cfg = mapper.readValue(
+                Thread.currentThread().getContextClassLoader().getResource("myriad-config-default.yml"),
+                MyriadConfiguration.class)
+    }
 /******************* Nodes Related ****************/
 
-  def rmNodes = new ConcurrentHashMap<NodeId, RMNode>()
+    def rmNodes = new ConcurrentHashMap<NodeId, RMNode>()
+
+    RMNode getRMNode(int cpu, int mem, String host, Protos.SlaveID slaveId) {
+        RMNode rmNode = MockNodes.newNodeInfo(0, Resources.createResource(mem, cpu), 0, host)
+        if (rmNodes[rmNode.getNodeID()]) {
+            throw new IllegalArgumentException("Node with hostname: " + host + " already exists")
+        }
+        rmNodes.put(rmNode.getNodeID(), rmNode)
+        nodeStore.add(getSchedulerNode(rmNode))
+        def node = nodeStore.getNode(host)
+        node.setSlaveId(slaveId)
+
+        return rmNode
+    }
+
+    SchedulerNode getSchedulerNode(RMNode rmNode) {
+        SchedulerNode schedulerNode = new SchedulerNode(rmNode, false) {
+
+            @Override
+            void reserveResource(SchedulerApplicationAttempt attempt, Priority priority, RMContainer container) {
+            }
+
+            @Override
+            void unreserveResource(SchedulerApplicationAttempt attempt) {
+            }
+        }
+        return schedulerNode
+    }
+
+    /******************* RMContext Related ****************/
 
-  RMNode getRMNode(int cpu, int mem, String host, Protos.SlaveID slaveId) {
-    RMNode rmNode = MockNodes.newNodeInfo(0, Resources.createResource(mem, cpu), 0, host)
-    if (rmNodes[rmNode.getNodeID()]) {
-      throw new IllegalArgumentException("Node with hostname: " + host + " already exists")
+    def publisher = Mock(SystemMetricsPublisher) {}
+    def writer = Mock(RMApplicationHistoryWriter) {}
+    def handler = Mock(EventHandler) {}
+
+    def dispatcher = Mock(Dispatcher) {
+        getEventHandler() >> handler
     }
-    rmNodes.put(rmNode.getNodeID(), rmNode)
-    nodeStore.add(getSchedulerNode(rmNode))
-    def node = nodeStore.getNode(host)
-    node.setSlaveId(slaveId)
 
-    return rmNode
-  }
+    def rmContext = Mock(RMContext) {
+        getDispatcher() >> dispatcher
+        getRMApplicationHistoryWriter() >> writer
+        getSystemMetricsPublisher() >> publisher
+        getRMNodes() >> rmNodes
+    }
 
-  SchedulerNode getSchedulerNode(RMNode rmNode) {
-    SchedulerNode schedulerNode = new SchedulerNode(rmNode, false) {
+    /******************* Offers Related ****************/
+
+    Protos.Offer addOfferToFeed(Protos.SlaveID slaveID, String host, int cpu, int mem) {
+        def offer = Protos.Offer.newBuilder()
+                .setId(Protos.OfferID.newBuilder().setValue("test_offer_id"))
+                .setFrameworkId(Protos.FrameworkID.newBuilder().setValue("test_framework_id"))
+                .setSlaveId(slaveID)
+                .setHostname(host)
+                .addResources(Protos.Resource.newBuilder()
+                .setName("cpus")
+                .setScalar(Protos.Value.Scalar.newBuilder().setValue(cpu))
+                .setType(Protos.Value.Type.SCALAR).build())
+                .addResources(Protos.Resource.newBuilder()
+                .setName("mem")
+                .setScalar(Protos.Value.Scalar.newBuilder().setValue(mem))
+                .setType(Protos.Value.Type.SCALAR).build())
+                .build()
+        offerLifecycleManager.addOffers(offer)
+        return offer
+    }
 
-      @Override
-      void reserveResource(SchedulerApplicationAttempt attempt, Priority priority, RMContainer container) {
-      }
+    /******************* Containers Related ****************/
 
-      @Override
-      void unreserveResource(SchedulerApplicationAttempt attempt) {
-      }
+    class FGSContainer {
+        ContainerId containerId
+        Container container
+        RMContainer rmContainer
+        ContainerStatus containerStatus
     }
-    return schedulerNode
-  }
-
-  /******************* RMContext Related ****************/
-
-  def publisher = Mock(SystemMetricsPublisher) {}
-  def writer = Mock(RMApplicationHistoryWriter) {}
-  def handler = Mock(EventHandler) {}
-
-  def dispatcher = Mock(Dispatcher) {
-    getEventHandler() >> handler
-  }
-
-  def rmContext = Mock(RMContext) {
-    getDispatcher() >> dispatcher
-    getRMApplicationHistoryWriter() >> writer
-    getSystemMetricsPublisher() >> publisher
-    getRMNodes() >> rmNodes
-  }
-
-  /******************* Offers Related ****************/
-
-  Protos.Offer addOfferToFeed(Protos.SlaveID slaveID, String host, int cpu, int mem) {
-    def offer = Protos.Offer.newBuilder()
-        .setId(Protos.OfferID.newBuilder().setValue("test_offer_id"))
-        .setFrameworkId(Protos.FrameworkID.newBuilder().setValue("test_framework_id"))
-        .setSlaveId(slaveID)
-        .setHostname(host)
-        .addResources(Protos.Resource.newBuilder()
-        .setName("cpus")
-        .setScalar(Protos.Value.Scalar.newBuilder().setValue(cpu))
-        .setType(Protos.Value.Type.SCALAR).build())
-        .addResources(Protos.Resource.newBuilder()
-        .setName("mem")
-        .setScalar(Protos.Value.Scalar.newBuilder().setValue(mem))
-        .setType(Protos.Value.Type.SCALAR).build())
-        .build()
-    offerLifecycleManager.addOffers(offer)
-    return offer
-  }
-
-  /******************* Containers Related ****************/
-
-  class FGSContainer {
-    ContainerId containerId
-    Container container
-    RMContainer rmContainer
-    ContainerStatus containerStatus
-  }
-
-  def fgsContainers = new HashMap<>()
-
-  AbstractYarnScheduler yarnScheduler = Mock(AbstractYarnScheduler) {
-    getRMContainer(_ as ContainerId) >> { ContainerId cid -> fgsContainers.get(cid).rmContainer }
-  }
-
-  FGSContainer getFGSContainer(RMNode node, int cid, int cpu, int mem, ContainerState state) {
-    FGSContainer fgsContainer = createFGSContainer(node, cid, cpu, mem, state)
-    if (!fgsContainers[fgsContainer.containerId]) {
-      fgsContainers[fgsContainer.containerId] =  fgsContainer
+
+    def fgsContainers = new HashMap<>()
+
+    AbstractYarnScheduler yarnScheduler = Mock(AbstractYarnScheduler) {
+        getRMContainer(_ as ContainerId) >> { ContainerId cid -> fgsContainers.get(cid).rmContainer }
+    }
+
+    FGSContainer getFGSContainer(RMNode node, int cid, int cpu, int mem, ContainerState state) {
+        FGSContainer fgsContainer = createFGSContainer(node, cid, cpu, mem, state)
+        if (!fgsContainers[fgsContainer.containerId]) {
+            fgsContainers[fgsContainer.containerId] = fgsContainer
+        }
+        return fgsContainer
+    }
+
+    private FGSContainer createFGSContainer(RMNode node, int cid, int cpu, int mem, ContainerState state) {
+        ContainerId containerId = ContainerId.newContainerId(ApplicationAttemptId.newInstance(
+                ApplicationId.newInstance(123456789, 1), 1), cid)
+        FGSContainer fgsContainer = new FGSContainer()
+        fgsContainer.containerId = containerId
+        fgsContainer.container = Container.newInstance(containerId, node.getNodeID(), node.getHttpAddress(),
+                Resources.createResource(mem, cpu), null, null)
+        fgsContainer.rmContainer = new RMContainerImpl(fgsContainer.container, containerId.getApplicationAttemptId(),
+                node.getNodeID(), "user1", rmContext)
+        nodeStore.getNode(node.getNodeID().getHost()).getNode().allocateContainer(fgsContainer.rmContainer)
+        fgsContainer.containerStatus = ContainerStatus.newInstance(containerId, state, "", 0)
+        return fgsContainer
     }
-    return fgsContainer
-  }
-
-  private FGSContainer createFGSContainer(RMNode node, int cid, int cpu, int mem, ContainerState state) {
-    ContainerId containerId = ContainerId.newContainerId(ApplicationAttemptId.newInstance(
-        ApplicationId.newInstance(123456789, 1), 1), cid)
-    FGSContainer fgsContainer = new FGSContainer()
-    fgsContainer.containerId = containerId
-    fgsContainer.container = Container.newInstance(containerId, node.getNodeID(), node.getHttpAddress(),
-        Resources.createResource(mem, cpu), null, null)
-    fgsContainer.rmContainer = new RMContainerImpl(fgsContainer.container, containerId.getApplicationAttemptId(),
-        node.getNodeID(), "user1", rmContext)
-    nodeStore.getNode(node.getNodeID().getHost()).getNode().allocateContainer(fgsContainer.rmContainer)
-    fgsContainer.containerStatus = ContainerStatus.newInstance(containerId, state, "", 0)
-    return fgsContainer
-  }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/NMHeartBeatHandlerSpec.groovy
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/NMHeartBeatHandlerSpec.groovy b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/NMHeartBeatHandlerSpec.groovy
index 49904b2..a37b9bf 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/NMHeartBeatHandlerSpec.groovy
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/NMHeartBeatHandlerSpec.groovy
@@ -36,79 +36,79 @@ import org.slf4j.Logger
  */
 class NMHeartBeatHandlerSpec extends FGSTestBaseSpec {
 
-  def "Node Manager registration"() {
-    given:
-    def hbHandler = getNMHeartBeatHandler()
-    hbHandler.logger = Mock(Logger)
-
-    def nonZeroNM = getRMNode(2, 2048, "test_host1", null)
-    def zeroNM = getRMNode(0, 0, "test_host2", null)
-
-    when:
-    hbHandler.beforeRMNodeEventHandled(getNMRegistrationEvent(nonZeroNM), rmContext)
-
-    then:
-    1 * hbHandler.logger.warn('FineGrainedScaling feature got invoked for a NM with non-zero capacity. ' +
-        'Host: {}, Mem: {}, CPU: {}. Setting the NM\'s capacity to (0G,0CPU)', 'test_host1', 2048, 2)
-    nonZeroNM.getTotalCapability().getMemory() == 0
-    nonZeroNM.getTotalCapability().getVirtualCores() == 0
-
-    when:
-    hbHandler.beforeRMNodeEventHandled(getNMRegistrationEvent(zeroNM), rmContext)
-
-    then:
-    0 * hbHandler.logger.warn(_) // no logger.warn invoked
-    nonZeroNM.getTotalCapability().getMemory() == 0
-    nonZeroNM.getTotalCapability().getVirtualCores() == 0
-  }
-
-  def "Node Manager HeartBeat"() {
-    given:
-    def host = "test_host"
-    def slaveId = Protos.SlaveID.newBuilder().setValue(host + "_slave_id").build()
-    def zeroNM = getRMNode(0, 0, host, slaveId)
-
-    def fgsContainer1 = getFGSContainer(zeroNM, 1, 1, 1024, ContainerState.RUNNING)
-    def fgsContainer2 = getFGSContainer(zeroNM, 2, 1, 1024, ContainerState.COMPLETE)
-    def fgsContainer3 = getFGSContainer(zeroNM, 3, 1, 1024, ContainerState.RUNNING)
-
-    addOfferToFeed(slaveId, host, 2, 2048)
-
-    def yarnNodeCapacityManager = Mock(YarnNodeCapacityManager)
-    def hbHandler = getNMHeartBeatHandler(yarnNodeCapacityManager)
-
-    when:
-    hbHandler.handleStatusUpdate(
-        getHBEvent(
-            zeroNM,
-            fgsContainer1.containerStatus,
-            fgsContainer2.containerStatus,
-            fgsContainer3.containerStatus),
-        rmContext)
-
-    then:
-    nodeStore.getNode(host).getContainerSnapshot().size() == 3
-    1 * yarnNodeCapacityManager.setNodeCapacity(zeroNM, Resources.createResource(4096, 4))
-  }
-
-
-  RMNodeStartedEvent getNMRegistrationEvent(RMNode node) {
-    new RMNodeStartedEvent(node.getNodeID(), null, null)
-  }
-
-  RMNodeStatusEvent getHBEvent(RMNode node, ContainerStatus... statuses) {
-    return new RMNodeStatusEvent(node.getNodeID(), null, Arrays.asList(statuses), null, null)
-  }
-
-  NMHeartBeatHandler getNMHeartBeatHandler() {
-    return getNMHeartBeatHandler(Mock(YarnNodeCapacityManager))
-  }
-
-  NMHeartBeatHandler getNMHeartBeatHandler(YarnNodeCapacityManager yarnNodeCapacityMgr) {
-    def registry = Mock(InterceptorRegistry)
-    def state = Mock(SchedulerState)
-    return new NMHeartBeatHandler(registry, yarnScheduler, myriadDriver,
-        yarnNodeCapacityMgr, offerLifecycleManager, nodeStore, state)
-  }
+    def "Node Manager registration"() {
+        given:
+        def hbHandler = getNMHeartBeatHandler()
+        hbHandler.logger = Mock(Logger)
+
+        def nonZeroNM = getRMNode(2, 2048, "test_host1", null)
+        def zeroNM = getRMNode(0, 0, "test_host2", null)
+
+        when:
+        hbHandler.beforeRMNodeEventHandled(getNMRegistrationEvent(nonZeroNM), rmContext)
+
+        then:
+        1 * hbHandler.logger.warn('FineGrainedScaling feature got invoked for a NM with non-zero capacity. ' +
+                'Host: {}, Mem: {}, CPU: {}. Setting the NM\'s capacity to (0G,0CPU)', 'test_host1', 2048, 2)
+        nonZeroNM.getTotalCapability().getMemory() == 0
+        nonZeroNM.getTotalCapability().getVirtualCores() == 0
+
+        when:
+        hbHandler.beforeRMNodeEventHandled(getNMRegistrationEvent(zeroNM), rmContext)
+
+        then:
+        0 * hbHandler.logger.warn(_) // no logger.warn invoked
+        nonZeroNM.getTotalCapability().getMemory() == 0
+        nonZeroNM.getTotalCapability().getVirtualCores() == 0
+    }
+
+    def "Node Manager HeartBeat"() {
+        given:
+        def host = "test_host"
+        def slaveId = Protos.SlaveID.newBuilder().setValue(host + "_slave_id").build()
+        def zeroNM = getRMNode(0, 0, host, slaveId)
+
+        def fgsContainer1 = getFGSContainer(zeroNM, 1, 1, 1024, ContainerState.RUNNING)
+        def fgsContainer2 = getFGSContainer(zeroNM, 2, 1, 1024, ContainerState.COMPLETE)
+        def fgsContainer3 = getFGSContainer(zeroNM, 3, 1, 1024, ContainerState.RUNNING)
+
+        addOfferToFeed(slaveId, host, 2, 2048)
+
+        def yarnNodeCapacityManager = Mock(YarnNodeCapacityManager)
+        def hbHandler = getNMHeartBeatHandler(yarnNodeCapacityManager)
+
+        when:
+        hbHandler.handleStatusUpdate(
+                getHBEvent(
+                        zeroNM,
+                        fgsContainer1.containerStatus,
+                        fgsContainer2.containerStatus,
+                        fgsContainer3.containerStatus),
+                rmContext)
+
+        then:
+        nodeStore.getNode(host).getContainerSnapshot().size() == 3
+        1 * yarnNodeCapacityManager.setNodeCapacity(zeroNM, Resources.createResource(4096, 4))
+    }
+
+
+    RMNodeStartedEvent getNMRegistrationEvent(RMNode node) {
+        new RMNodeStartedEvent(node.getNodeID(), null, null)
+    }
+
+    RMNodeStatusEvent getHBEvent(RMNode node, ContainerStatus... statuses) {
+        return new RMNodeStatusEvent(node.getNodeID(), null, Arrays.asList(statuses), null, null)
+    }
+
+    NMHeartBeatHandler getNMHeartBeatHandler() {
+        return getNMHeartBeatHandler(Mock(YarnNodeCapacityManager))
+    }
+
+    NMHeartBeatHandler getNMHeartBeatHandler(YarnNodeCapacityManager yarnNodeCapacityMgr) {
+        def registry = Mock(InterceptorRegistry)
+        def state = Mock(SchedulerState)
+        return new NMHeartBeatHandler(registry, yarnScheduler, myriadDriver,
+                yarnNodeCapacityMgr, offerLifecycleManager, nodeStore, state)
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/67ecf063/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/YarnNodeCapacityManagerSpec.groovy
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/YarnNodeCapacityManagerSpec.groovy b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/YarnNodeCapacityManagerSpec.groovy
index fd8bb1b..c63ff9a 100644
--- a/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/YarnNodeCapacityManagerSpec.groovy
+++ b/myriad-scheduler/src/test/java/com/ebay/myriad/scheduler/fgs/YarnNodeCapacityManagerSpec.groovy
@@ -36,102 +36,102 @@ import org.apache.mesos.Protos
  */
 class YarnNodeCapacityManagerSpec extends FGSTestBaseSpec {
 
-  def "No Containers Allocated Due To Mesos Offers"() {
-    given:
-    def yarnNodeCapacityMgr = getYarnNodeCapacityManager()
-
-    def host = "test_host"
-    def slaveId = Protos.SlaveID.newBuilder().setValue(host + "_slave_id").build()
-    def zeroNM = getRMNode(0, 0, host, slaveId)
-
-    // have a mesos offer before HB
-    def offer = addOfferToFeed(slaveId, host, 4, 4096)
-    offerLifecycleManager.markAsConsumed(offer)
-
-    //  2 containers before HB.
-    def fgsContainer1 = getFGSContainer(zeroNM, 1, 1, 1024, ContainerState.RUNNING)
-    def fgsContainer2 = getFGSContainer(zeroNM, 2, 1, 1024, ContainerState.RUNNING)
-    nodeStore.getNode(host).snapshotRunningContainers()
-
-    // Node's capacity set to match the size of 2 containers + mesos offers
-    yarnNodeCapacityMgr.setNodeCapacity(zeroNM, Resources.createResource(6144, 6))
-
-    // no new container allocations
-
-    when:
-    yarnNodeCapacityMgr.handleContainerAllocation(zeroNM)
-
-    then:
-    nodeStore.getNode(host).getNode().getRunningContainers().size() == 2  // 2 containers still running
-    1 * mesosDriver.declineOffer(offer.getId())   // offer rejected, as it's not used to allocate more containers
-    zeroNM.getTotalCapability().getVirtualCores() == 2 // capacity returns back to match size of running containers
-    zeroNM.getTotalCapability().getMemory() == 2048
-    nodeStore.getNode(host).getContainerSnapshot() == null // container snapshot is released
-  }
-
-  def "Containers Allocated Due To Mesos Offers"() {
-    given:
-    def yarnNodeCapacityMgr = getYarnNodeCapacityManager()
-
-    def host = "test_host"
-    def slaveId = Protos.SlaveID.newBuilder().setValue(host + "_slave_id").build()
-    def zeroNM = getRMNode(0, 0, host, slaveId)
-
-    // have a mesos offer before HB
-    def offer = addOfferToFeed(slaveId, host, 4, 4096)
-    offerLifecycleManager.markAsConsumed(offer)
-
-    //  2 containers before HB.
-    def fgsContainer1 = getFGSContainer(zeroNM, 1, 1, 1024, ContainerState.RUNNING)
-    def fgsContainer2 = getFGSContainer(zeroNM, 2, 1, 1024, ContainerState.RUNNING)
-    nodeStore.getNode(host).snapshotRunningContainers()
-
-    // Node's capacity set to match the size of 2 running containers + mesos offers
-    yarnNodeCapacityMgr.setNodeCapacity(zeroNM, Resources.createResource(6144, 6))
-
-    // 2 new containers allocated after HB
-    def fgsContainer3 = getFGSContainer(zeroNM, 3, 1, 1024, ContainerState.NEW)
-    def fgsContainer4 = getFGSContainer(zeroNM, 4, 1, 1024, ContainerState.NEW)
-
-    when:
-    yarnNodeCapacityMgr.handleContainerAllocation(zeroNM)
-
-    then:
-    nodeStore.getNode(host).getNode().getRunningContainers().size() == 4  // 2 running + 2 new
-    1 * mesosDriver.launchTasks(_ as Collection<Protos.OfferID>, _ as List<Protos.TaskInfo>) // for place holder tasks
-    zeroNM.getTotalCapability().getVirtualCores() == 4 // capacity equals size of running + new containers
-    zeroNM.getTotalCapability().getMemory() == 4096
-    nodeStore.getNode(host).getContainerSnapshot() == null // container snapshot is released
-  }
-
-  def "Set Node Capacity"() {
-    given:
-    def zeroNM = getRMNode(0, 0, "test_host", null)
-    def yarnNodeCapacityMgr = getYarnNodeCapacityManager()
-
-    when:
-    yarnNodeCapacityMgr.setNodeCapacity(zeroNM, Resources.createResource(2048, 2))
-
-    then:
-    zeroNM.getTotalCapability().getMemory() == 2048
-    zeroNM.getTotalCapability().getVirtualCores() == 2
-    1 * rmContext.getDispatcher().getEventHandler().handle(_ as NodeResourceUpdateSchedulerEvent)
-  }
-
-  YarnNodeCapacityManager getYarnNodeCapacityManager() {
-    def registry = Mock(InterceptorRegistry)
-    def executorInfo = Protos.ExecutorInfo.newBuilder()
-        .setExecutorId(Protos.ExecutorID.newBuilder().setValue("some_id"))
-        .setCommand(Protos.CommandInfo.newBuilder())
-        .build()
-    def nodeTask = Mock(NodeTask) {
-      getExecutorInfo() >> executorInfo
+    def "No Containers Allocated Due To Mesos Offers"() {
+        given:
+        def yarnNodeCapacityMgr = getYarnNodeCapacityManager()
+
+        def host = "test_host"
+        def slaveId = Protos.SlaveID.newBuilder().setValue(host + "_slave_id").build()
+        def zeroNM = getRMNode(0, 0, host, slaveId)
+
+        // have a mesos offer before HB
+        def offer = addOfferToFeed(slaveId, host, 4, 4096)
+        offerLifecycleManager.markAsConsumed(offer)
+
+        //  2 containers before HB.
+        def fgsContainer1 = getFGSContainer(zeroNM, 1, 1, 1024, ContainerState.RUNNING)
+        def fgsContainer2 = getFGSContainer(zeroNM, 2, 1, 1024, ContainerState.RUNNING)
+        nodeStore.getNode(host).snapshotRunningContainers()
+
+        // Node's capacity set to match the size of 2 containers + mesos offers
+        yarnNodeCapacityMgr.setNodeCapacity(zeroNM, Resources.createResource(6144, 6))
+
+        // no new container allocations
+
+        when:
+        yarnNodeCapacityMgr.handleContainerAllocation(zeroNM)
+
+        then:
+        nodeStore.getNode(host).getNode().getRunningContainers().size() == 2  // 2 containers still running
+        1 * mesosDriver.declineOffer(offer.getId())   // offer rejected, as it's not used to allocate more containers
+        zeroNM.getTotalCapability().getVirtualCores() == 2 // capacity returns back to match size of running containers
+        zeroNM.getTotalCapability().getMemory() == 2048
+        nodeStore.getNode(host).getContainerSnapshot() == null // container snapshot is released
     }
-    def state = Mock(SchedulerState) {
-      getNodeTask(_, NodeManagerConfiguration.NM_TASK_PREFIX) >> nodeTask
+
+    def "Containers Allocated Due To Mesos Offers"() {
+        given:
+        def yarnNodeCapacityMgr = getYarnNodeCapacityManager()
+
+        def host = "test_host"
+        def slaveId = Protos.SlaveID.newBuilder().setValue(host + "_slave_id").build()
+        def zeroNM = getRMNode(0, 0, host, slaveId)
+
+        // have a mesos offer before HB
+        def offer = addOfferToFeed(slaveId, host, 4, 4096)
+        offerLifecycleManager.markAsConsumed(offer)
+
+        //  2 containers before HB.
+        def fgsContainer1 = getFGSContainer(zeroNM, 1, 1, 1024, ContainerState.RUNNING)
+        def fgsContainer2 = getFGSContainer(zeroNM, 2, 1, 1024, ContainerState.RUNNING)
+        nodeStore.getNode(host).snapshotRunningContainers()
+
+        // Node's capacity set to match the size of 2 running containers + mesos offers
+        yarnNodeCapacityMgr.setNodeCapacity(zeroNM, Resources.createResource(6144, 6))
+
+        // 2 new containers allocated after HB
+        def fgsContainer3 = getFGSContainer(zeroNM, 3, 1, 1024, ContainerState.NEW)
+        def fgsContainer4 = getFGSContainer(zeroNM, 4, 1, 1024, ContainerState.NEW)
+
+        when:
+        yarnNodeCapacityMgr.handleContainerAllocation(zeroNM)
+
+        then:
+        nodeStore.getNode(host).getNode().getRunningContainers().size() == 4  // 2 running + 2 new
+        1 * mesosDriver.launchTasks(_ as Collection<Protos.OfferID>, _ as List<Protos.TaskInfo>) // for place holder tasks
+        zeroNM.getTotalCapability().getVirtualCores() == 4 // capacity equals size of running + new containers
+        zeroNM.getTotalCapability().getMemory() == 4096
+        nodeStore.getNode(host).getContainerSnapshot() == null // container snapshot is released
+    }
+
+    def "Set Node Capacity"() {
+        given:
+        def zeroNM = getRMNode(0, 0, "test_host", null)
+        def yarnNodeCapacityMgr = getYarnNodeCapacityManager()
+
+        when:
+        yarnNodeCapacityMgr.setNodeCapacity(zeroNM, Resources.createResource(2048, 2))
+
+        then:
+        zeroNM.getTotalCapability().getMemory() == 2048
+        zeroNM.getTotalCapability().getVirtualCores() == 2
+        1 * rmContext.getDispatcher().getEventHandler().handle(_ as NodeResourceUpdateSchedulerEvent)
     }
-    return new YarnNodeCapacityManager(registry, yarnScheduler, rmContext,
-        myriadDriver, offerLifecycleManager, nodeStore, state)
 
-  }
+    YarnNodeCapacityManager getYarnNodeCapacityManager() {
+        def registry = Mock(InterceptorRegistry)
+        def executorInfo = Protos.ExecutorInfo.newBuilder()
+                .setExecutorId(Protos.ExecutorID.newBuilder().setValue("some_id"))
+                .setCommand(Protos.CommandInfo.newBuilder())
+                .build()
+        def nodeTask = Mock(NodeTask) {
+            getExecutorInfo() >> executorInfo
+        }
+        def state = Mock(SchedulerState) {
+            getNodeTask(_, NodeManagerConfiguration.NM_TASK_PREFIX) >> nodeTask
+        }
+        return new YarnNodeCapacityManager(registry, yarnScheduler, rmContext,
+                myriadDriver, offerLifecycleManager, nodeStore, state)
+
+    }
 }


Mime
View raw message