You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/06/02 17:23:07 UTC

[GitHub] [geode] jinmeiliao commented on a change in pull request #5195: GEODE-8095 create restore redundancy

jinmeiliao commented on a change in pull request #5195:
URL: https://github.com/apache/geode/pull/5195#discussion_r434042129



##########
File path: geode-management/src/main/java/org/apache/geode/management/internal/operation/RestoreRedundancyResponseImpl.java
##########
@@ -0,0 +1,116 @@
+/*
+ * 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.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.geode.management.api.ClusterManagementResult;
+import org.apache.geode.management.runtime.RegionRedundancyStatusSerializable;
+import org.apache.geode.management.runtime.RestoreRedundancyResponse;
+
+public class RestoreRedundancyResponseImpl

Review comment:
       let's just make RestoreReduncyResponse a concrete class. I really don't see much benefit in having an interface.

##########
File path: geode-management/src/main/java/org/apache/geode/management/operation/RestoreRedundancyRequest.java
##########
@@ -0,0 +1,130 @@
+/*
+ * 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.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import org.apache.geode.annotations.Experimental;
+import org.apache.geode.management.api.ClusterManagementOperation;
+import org.apache.geode.management.runtime.RestoreRedundancyResponse;
+
+
+/**
+ * Defines a distributed system request to optimize bucket allocation across members.
+ */
+@Experimental
+public class RestoreRedundancyRequest
+    implements ClusterManagementOperation<RestoreRedundancyResponse> {
+
+  /**
+   * see {@link #getEndpoint()}
+   */
+  public static final String RESTORE_REDUNDANCY_REBALANCE_ENDPOINT =
+      "/operations/restoreRedundancy";
+  public static final String RESTORE_REDUNDANCY_OPERATOR = "restore redundancy";

Review comment:
       I don't think we need this. Operator is whoever initiated this operation. I also think  this should be in the OperationState instead of the Operation request itself (but this could be another issue).

##########
File path: geode-management/src/main/java/org/apache/geode/management/internal/operation/RestoreRedundancyResponseImpl.java
##########
@@ -0,0 +1,116 @@
+/*
+ * 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.operation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.geode.management.api.ClusterManagementResult;
+import org.apache.geode.management.runtime.RegionRedundancyStatusSerializable;
+import org.apache.geode.management.runtime.RestoreRedundancyResponse;
+
+public class RestoreRedundancyResponseImpl

Review comment:
       also you don't have to call it Serializable in the class name, it fact that it implements OperationResult is already Serializable

##########
File path: geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
##########
@@ -457,6 +457,12 @@ org/apache/geode/management/internal/functions/CacheRealizationFunction,false
 org/apache/geode/management/internal/functions/CliFunctionResult$StatusState,false
 org/apache/geode/management/internal/functions/GetMemberInformationFunction,true,1404642539058875565
 org/apache/geode/management/internal/functions/RebalanceFunction,true,1
+org/apache/geode/management/internal/functions/RestoreRedundancyFunction,true,1
+org/apache/geode/management/runtime/RestoreRedundancyResponse,true,1

Review comment:
       I believe some of these belongs to sanctioned-geode-management-serializables.txt




----------------------------------------------------------------
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:
users@infra.apache.org