sodonnel commented on a change in pull request #262: HDDS-2459 - Change the ReplicationManager to consider decommission and maintenance states URL: https://github.com/apache/hadoop-ozone/pull/262#discussion_r351391851
########## File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/states/TestContainerReplicaCount.java ########## @@ -0,0 +1,327 @@ +/** + * 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 org.apache.hadoop.hdds.scm.container.states; + +import org.apache.hadoop.hdds.conf.OzoneConfiguration; +import org.apache.hadoop.hdds.protocol.DatanodeDetails; +import org.apache.hadoop.hdds.protocol.proto + .StorageContainerDatanodeProtocolProtos.ContainerReplicaProto; +import org.apache.hadoop.hdds.scm.TestUtils; +import org.apache.hadoop.hdds.scm.container.ContainerID; +import org.apache.hadoop.hdds.scm.container.ContainerReplica; +import org.apache.hadoop.hdds.scm.container.ContainerReplicaCount; +import org.junit.Before; +import org.junit.Test; +import java.util.*; +import static junit.framework.TestCase.assertEquals; +import static org.apache.hadoop.hdds.protocol.proto + .StorageContainerDatanodeProtocolProtos.ContainerReplicaProto.State.CLOSED; +import static org.apache.hadoop.hdds.protocol.proto + .StorageContainerDatanodeProtocolProtos.ContainerReplicaProto.State + .DECOMMISSIONED; +import static org.apache.hadoop.hdds.protocol.proto + .StorageContainerDatanodeProtocolProtos.ContainerReplicaProto.State + .MAINTENANCE; + +/** + * Class used to test the ContainerReplicaCount class. + */ +public class TestContainerReplicaCount { + + private OzoneConfiguration conf; + private List<DatanodeDetails> dns; + private Set<ContainerReplica> replica; + private ContainerReplicaCount rcount; + + + public TestContainerReplicaCount() { + } + + @Before + public void setup() { + conf = new OzoneConfiguration(); + replica = new HashSet<>(); + dns = new LinkedList<>(); + } + + @Test + public void testThreeHealthyReplica() { + registerNodes(CLOSED, CLOSED, CLOSED); Review comment: I have changed this in the most recent commit and all the instance variables are now gone. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
