[geode] branch support/1.13 updated: GEODE-8095: Changes to make GEODE Respond to Restore Redundancy REST Command (#5300) (#5327)
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new 9255163 GEODE-8095: Changes to make GEODE Respond to Restore Redundancy REST Command (#5300) (#5327) 9255163 is described below commit 9255163a026d5571a89ba6aad950b75539261414 Author: mhansonp AuthorDate: Tue Jun 30 10:35:55 2020 -0700 GEODE-8095: Changes to make GEODE Respond to Restore Redundancy REST Command (#5300) (#5327) * GEODE-8095: Changes to make GEODE Respond to Restore Redundancy (cherry picked from commit f5c5e2cc7860c132074a16351ca4db847f64d6f7) Co-authored-by: Jinmei Liao --- .../rest/RestoreRedundancyManagementDUnitTest.java | 345 + .../internal/operation/OperationManager.java | 2 + ...rializableRestoreRedundancyResultsImplTest.java | 5 +- ...RedundancyRequestControllerIntegrationTest.java | 174 +++ .../RestoreRedundancyOperationController.java | 74 + 5 files changed, 596 insertions(+), 4 deletions(-) diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RestoreRedundancyManagementDUnitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RestoreRedundancyManagementDUnitTest.java new file mode 100644 index 000..3464fe7 --- /dev/null +++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RestoreRedundancyManagementDUnitTest.java @@ -0,0 +1,345 @@ +/* + * 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.geode.management.internal.rest; + +import static org.apache.geode.cache.PartitionAttributesFactory.GLOBAL_MAX_BUCKETS_DEFAULT; +import static org.apache.geode.cache.Region.SEPARATOR; +import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.Matchers.lessThanOrEqualTo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ExecutionException; +import java.util.stream.IntStream; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import org.apache.geode.cache.Cache; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.RegionShortcut; +import org.apache.geode.internal.cache.InternalCache; +import org.apache.geode.internal.cache.PartitionAttributesImpl; +import org.apache.geode.internal.cache.PartitionedRegion; +import org.apache.geode.management.api.ClusterManagementOperationResult; +import org.apache.geode.management.api.ClusterManagementService; +import org.apache.geode.management.client.ClusterManagementServiceBuilder; +import org.apache.geode.management.operation.RestoreRedundancyRequest; +import org.apache.geode.management.runtime.RegionRedundancyStatus; +import org.apache.geode.management.runtime.RestoreRedundancyResults; +import org.apache.geode.test.dunit.rules.ClusterStartupRule; +import org.apache.geode.test.dunit.rules.MemberVM; +import org.apache.geode.test.junit.rules.MemberStarterRule; + +/** + * This class borrows very heavily from the RestoreRedundancyCommandDUnitTest + * + */ + +public class RestoreRedundancyManagementDUnitTest { + + @Rule + public ClusterStartupRule cluster = new ClusterStartupRule(); + + private MemberVM locator; + private List servers; + private static final int SERVERS_TO_START = 3; + private static final String HIGH_REDUNDANCY_REGION_NAME = "highRedundancy"; + private static final int HIGH_REDUNDANCY_COPIES = SERVERS_TO_START - 1; + private static final String LOW_REDUNDANCY_REGION_NAME = "lowRedundancy"; + private static final String PARENT_REGION_NAME = "colocatedParent"; + private static final String CHILD_REGION_NAME = "colocatedChild"; + private static final int SINGLE_REDUNDANT_COPY = 1; + private static final String NO_CONFIGURED_REDUNDANCY_REGION_NAME = "noConfiguredRedundancy"; + + private ClusterManagementServic
[geode] branch support/1.13 updated: GEODE-8095: Changes to make GEODE Respond to Restore Redundancy REST Command (#5300) (#5327)
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch support/1.13 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.13 by this push: new 9255163 GEODE-8095: Changes to make GEODE Respond to Restore Redundancy REST Command (#5300) (#5327) 9255163 is described below commit 9255163a026d5571a89ba6aad950b75539261414 Author: mhansonp AuthorDate: Tue Jun 30 10:35:55 2020 -0700 GEODE-8095: Changes to make GEODE Respond to Restore Redundancy REST Command (#5300) (#5327) * GEODE-8095: Changes to make GEODE Respond to Restore Redundancy (cherry picked from commit f5c5e2cc7860c132074a16351ca4db847f64d6f7) Co-authored-by: Jinmei Liao --- .../rest/RestoreRedundancyManagementDUnitTest.java | 345 + .../internal/operation/OperationManager.java | 2 + ...rializableRestoreRedundancyResultsImplTest.java | 5 +- ...RedundancyRequestControllerIntegrationTest.java | 174 +++ .../RestoreRedundancyOperationController.java | 74 + 5 files changed, 596 insertions(+), 4 deletions(-) diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RestoreRedundancyManagementDUnitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RestoreRedundancyManagementDUnitTest.java new file mode 100644 index 000..3464fe7 --- /dev/null +++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RestoreRedundancyManagementDUnitTest.java @@ -0,0 +1,345 @@ +/* + * 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.geode.management.internal.rest; + +import static org.apache.geode.cache.PartitionAttributesFactory.GLOBAL_MAX_BUCKETS_DEFAULT; +import static org.apache.geode.cache.Region.SEPARATOR; +import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.Matchers.lessThanOrEqualTo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ExecutionException; +import java.util.stream.IntStream; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import org.apache.geode.cache.Cache; +import org.apache.geode.cache.Region; +import org.apache.geode.cache.RegionShortcut; +import org.apache.geode.internal.cache.InternalCache; +import org.apache.geode.internal.cache.PartitionAttributesImpl; +import org.apache.geode.internal.cache.PartitionedRegion; +import org.apache.geode.management.api.ClusterManagementOperationResult; +import org.apache.geode.management.api.ClusterManagementService; +import org.apache.geode.management.client.ClusterManagementServiceBuilder; +import org.apache.geode.management.operation.RestoreRedundancyRequest; +import org.apache.geode.management.runtime.RegionRedundancyStatus; +import org.apache.geode.management.runtime.RestoreRedundancyResults; +import org.apache.geode.test.dunit.rules.ClusterStartupRule; +import org.apache.geode.test.dunit.rules.MemberVM; +import org.apache.geode.test.junit.rules.MemberStarterRule; + +/** + * This class borrows very heavily from the RestoreRedundancyCommandDUnitTest + * + */ + +public class RestoreRedundancyManagementDUnitTest { + + @Rule + public ClusterStartupRule cluster = new ClusterStartupRule(); + + private MemberVM locator; + private List servers; + private static final int SERVERS_TO_START = 3; + private static final String HIGH_REDUNDANCY_REGION_NAME = "highRedundancy"; + private static final int HIGH_REDUNDANCY_COPIES = SERVERS_TO_START - 1; + private static final String LOW_REDUNDANCY_REGION_NAME = "lowRedundancy"; + private static final String PARENT_REGION_NAME = "colocatedParent"; + private static final String CHILD_REGION_NAME = "colocatedChild"; + private static final int SINGLE_REDUNDANT_COPY = 1; + private static final String NO_CONFIGURED_REDUNDANCY_REGION_NAME = "noConfiguredRedundancy"; + + private ClusterManagementServic