[15/74] [abbrv] hadoop git commit: YARN-7050. Post cleanup after YARN-6903, removal of org.apache.slider package. Contributed by Jian He
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/appmaster/state/RoleHistory.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/appmaster/state/RoleHistory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java deleted file mode 100644 index 15333e4..000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java +++ /dev/null @@ -1,1123 +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.appmaster.state; - -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Preconditions; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.yarn.api.records.Container; -import org.apache.hadoop.yarn.api.records.NodeReport; -import org.apache.hadoop.yarn.api.records.NodeState; -import org.apache.hadoop.yarn.api.records.Resource; -import org.apache.slider.api.types.NodeInformation; -import org.apache.slider.common.tools.SliderUtils; -import org.apache.slider.core.exceptions.BadConfigException; -import org.apache.slider.providers.ProviderRole; -import org.apache.slider.server.appmaster.management.BoolMetric; -import org.apache.slider.server.appmaster.management.Timestamp; -import org.apache.slider.server.appmaster.operations.AbstractRMOperation; -import org.apache.slider.server.appmaster.operations.UpdateBlacklistOperation; -import org.apache.slider.server.avro.LoadedRoleHistory; -import org.apache.slider.server.avro.NodeEntryRecord; -import org.apache.slider.server.avro.RoleHistoryHeader; -import org.apache.slider.server.avro.RoleHistoryWriter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; - -/** - * The Role History. - * - * Synchronization policy: all public operations are synchronized. - * Protected methods are in place for testing -no guarantees are made. - * - * Inner classes have no synchronization guarantees; they should be manipulated - * in these classes and not externally. - * - * Note that as well as some methods marked visible for testing, there - * is the option for the time generator method, {@link #now()} to - * be overridden so that a repeatable time series can be used. - * - */ -public class RoleHistory { - protected static final Logger log = -LoggerFactory.getLogger(RoleHistory.class); - private final List providerRoles; - /** the roles in here are shared with App State */ - private final MaproleStatusMap = new HashMap<>(); - private final AbstractClusterServices recordFactory; - - private long startTime; - - /** Time when saved */ - private final Timestamp saveTime = new Timestamp(0); - - /** If the history was loaded, the time at which the history was saved. - * That is: the time the data was valid */ - private final Timestamp thawedDataTime = new Timestamp(0); - - private NodeMap nodemap; - private int roleSize; - private final BoolMetric dirty = new BoolMetric(false); - private FileSystem filesystem; - private Path historyPath; - private RoleHistoryWriter historyWriter = new RoleHistoryWriter(); - - /** - * When were the nodes updated in a {@link #onNodesUpdated(List)} call? - * If zero: never. - */ - private final Timestamp nodesUpdatedTime = new Timestamp(0); - private final BoolMetric nodeUpdateReceived = new BoolMetric(false); - - private OutstandingRequestTracker
[15/74] [abbrv] hadoop git commit: YARN-7050. Post cleanup after YARN-6903, removal of org.apache.slider package. Contributed by Jian He
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/appmaster/state/RoleHistory.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/appmaster/state/RoleHistory.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java deleted file mode 100644 index 15333e4..000 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-slider/hadoop-yarn-slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java +++ /dev/null @@ -1,1123 +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.appmaster.state; - -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Preconditions; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.Path; -import org.apache.hadoop.yarn.api.records.Container; -import org.apache.hadoop.yarn.api.records.NodeReport; -import org.apache.hadoop.yarn.api.records.NodeState; -import org.apache.hadoop.yarn.api.records.Resource; -import org.apache.slider.api.types.NodeInformation; -import org.apache.slider.common.tools.SliderUtils; -import org.apache.slider.core.exceptions.BadConfigException; -import org.apache.slider.providers.ProviderRole; -import org.apache.slider.server.appmaster.management.BoolMetric; -import org.apache.slider.server.appmaster.management.Timestamp; -import org.apache.slider.server.appmaster.operations.AbstractRMOperation; -import org.apache.slider.server.appmaster.operations.UpdateBlacklistOperation; -import org.apache.slider.server.avro.LoadedRoleHistory; -import org.apache.slider.server.avro.NodeEntryRecord; -import org.apache.slider.server.avro.RoleHistoryHeader; -import org.apache.slider.server.avro.RoleHistoryWriter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; - -/** - * The Role History. - * - * Synchronization policy: all public operations are synchronized. - * Protected methods are in place for testing -no guarantees are made. - * - * Inner classes have no synchronization guarantees; they should be manipulated - * in these classes and not externally. - * - * Note that as well as some methods marked visible for testing, there - * is the option for the time generator method, {@link #now()} to - * be overridden so that a repeatable time series can be used. - * - */ -public class RoleHistory { - protected static final Logger log = -LoggerFactory.getLogger(RoleHistory.class); - private final List providerRoles; - /** the roles in here are shared with App State */ - private final MaproleStatusMap = new HashMap<>(); - private final AbstractClusterServices recordFactory; - - private long startTime; - - /** Time when saved */ - private final Timestamp saveTime = new Timestamp(0); - - /** If the history was loaded, the time at which the history was saved. - * That is: the time the data was valid */ - private final Timestamp thawedDataTime = new Timestamp(0); - - private NodeMap nodemap; - private int roleSize; - private final BoolMetric dirty = new BoolMetric(false); - private FileSystem filesystem; - private Path historyPath; - private RoleHistoryWriter historyWriter = new RoleHistoryWriter(); - - /** - * When were the nodes updated in a {@link #onNodesUpdated(List)} call? - * If zero: never. - */ - private final Timestamp nodesUpdatedTime = new Timestamp(0); - private final BoolMetric nodeUpdateReceived = new BoolMetric(false); - - private OutstandingRequestTracker