[11/74] [abbrv] hadoop git commit: YARN-7050. Post cleanup after YARN-6903, removal of org.apache.slider package. Contributed by Jian He

2017-08-30 Thread jianhe
http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b3aff2f/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/services/workflow/WorkflowCompositeService.java
--
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/services/workflow/WorkflowCompositeService.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/services/workflow/WorkflowCompositeService.java
deleted file mode 100644
index 9c653f3..000
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/services/workflow/WorkflowCompositeService.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.slider.server.services.workflow;
-
-import com.google.common.base.Preconditions;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.service.CompositeService;
-import org.apache.hadoop.service.Service;
-import org.apache.hadoop.service.ServiceStateChangeListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-/**
- * An extended composite service which stops itself if any child service
- * fails, or when all its children have successfully stopped without failure.
- *
- * Lifecycle
- * 
- *   If any child exits with a failure: this service stops, propagating
- *   the exception.
- *   When all child services has stopped, this service stops itself
- * 
- *
- */
-public class WorkflowCompositeService extends CompositeService
-implements ServiceParent, ServiceStateChangeListener {
-
-  private static final Logger LOG =
-LoggerFactory.getLogger(WorkflowCompositeService.class);
-
-  /**
-   * Deadlock-avoiding overridden config for slider services; see SLIDER-1052
-   */
-  private volatile Configuration configuration;
-
-  /**
-   * Construct an instance
-   * @param name name of this service instance
-   */
-  public WorkflowCompositeService(String name) {
-super(name);
-  }
-
-  @Override
-  public Configuration getConfig() {
-return configuration;
-  }
-
-  @Override
-  protected void setConfig(Configuration conf) {
-super.setConfig(conf);
-configuration = conf;
-  }
-
-  /**
-   * Construct an instance with the default name.
-   */
-  public WorkflowCompositeService() {
-this("WorkflowCompositeService");
-  }
-
-  /**
-   * Varargs constructor
-   * @param name name of this service instance
-   * @param children children
-   */
-  public WorkflowCompositeService(String name, Service... children) {
-this(name);
-for (Service child : children) {
-  addService(child);
-}
-  }
-
-  /**
-   * Construct with a list of children
-   * @param name name of this service instance
-   * @param children children to add
-   */
-  public WorkflowCompositeService(String name, List children) {
-this(name);
-for (Service child : children) {
-  addService(child);
-}
-  }
-
-  /**
-   * Add a service, and register it
-   * @param service the {@link Service} to be added.
-   * Important: do not add a service to a parent during your own 
serviceInit/start,
-   * in Hadoop 2.2; you will trigger a ConcurrentModificationException.
-   */
-  @Override
-  public synchronized void addService(Service service) {
-Preconditions.checkArgument(service != null, "null service argument");
-service.registerServiceListener(this);
-super.addService(service);
-  }
-
-  /**
-   * When this service is started, any service stopping with a failure
-   * exception is converted immediately into a failure of this service, 
-   * storing the failure and stopping ourselves.
-   * @param child the service that has changed.
-   */
-  @Override
-  public void stateChanged(Service child) {
-//if that child stopped while we are running:
-if (isInState(STATE.STARTED) && child.isInState(STATE.STOPPED)) {
-  // a child service h

[11/74] [abbrv] hadoop git commit: YARN-7050. Post cleanup after YARN-6903, removal of org.apache.slider package. Contributed by Jian He

2017-08-29 Thread jianhe
http://git-wip-us.apache.org/repos/asf/hadoop/blob/43277ffd/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/services/workflow/WorkflowCompositeService.java
--
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/services/workflow/WorkflowCompositeService.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/services/workflow/WorkflowCompositeService.java
deleted file mode 100644
index 9c653f3..000
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/services/workflow/WorkflowCompositeService.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.slider.server.services.workflow;
-
-import com.google.common.base.Preconditions;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.service.CompositeService;
-import org.apache.hadoop.service.Service;
-import org.apache.hadoop.service.ServiceStateChangeListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.List;
-
-/**
- * An extended composite service which stops itself if any child service
- * fails, or when all its children have successfully stopped without failure.
- *
- * Lifecycle
- * 
- *   If any child exits with a failure: this service stops, propagating
- *   the exception.
- *   When all child services has stopped, this service stops itself
- * 
- *
- */
-public class WorkflowCompositeService extends CompositeService
-implements ServiceParent, ServiceStateChangeListener {
-
-  private static final Logger LOG =
-LoggerFactory.getLogger(WorkflowCompositeService.class);
-
-  /**
-   * Deadlock-avoiding overridden config for slider services; see SLIDER-1052
-   */
-  private volatile Configuration configuration;
-
-  /**
-   * Construct an instance
-   * @param name name of this service instance
-   */
-  public WorkflowCompositeService(String name) {
-super(name);
-  }
-
-  @Override
-  public Configuration getConfig() {
-return configuration;
-  }
-
-  @Override
-  protected void setConfig(Configuration conf) {
-super.setConfig(conf);
-configuration = conf;
-  }
-
-  /**
-   * Construct an instance with the default name.
-   */
-  public WorkflowCompositeService() {
-this("WorkflowCompositeService");
-  }
-
-  /**
-   * Varargs constructor
-   * @param name name of this service instance
-   * @param children children
-   */
-  public WorkflowCompositeService(String name, Service... children) {
-this(name);
-for (Service child : children) {
-  addService(child);
-}
-  }
-
-  /**
-   * Construct with a list of children
-   * @param name name of this service instance
-   * @param children children to add
-   */
-  public WorkflowCompositeService(String name, List children) {
-this(name);
-for (Service child : children) {
-  addService(child);
-}
-  }
-
-  /**
-   * Add a service, and register it
-   * @param service the {@link Service} to be added.
-   * Important: do not add a service to a parent during your own 
serviceInit/start,
-   * in Hadoop 2.2; you will trigger a ConcurrentModificationException.
-   */
-  @Override
-  public synchronized void addService(Service service) {
-Preconditions.checkArgument(service != null, "null service argument");
-service.registerServiceListener(this);
-super.addService(service);
-  }
-
-  /**
-   * When this service is started, any service stopping with a failure
-   * exception is converted immediately into a failure of this service, 
-   * storing the failure and stopping ourselves.
-   * @param child the service that has changed.
-   */
-  @Override
-  public void stateChanged(Service child) {
-//if that child stopped while we are running:
-if (isInState(STATE.STARTED) && child.isInState(STATE.STOPPED)) {
-  // a child service h