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 04:07:56 UTC

[GitHub] [geode] mhansonp opened a new pull request #5195: Geode 8095 create restore redundancy

mhansonp opened a new pull request #5195:
URL: https://github.com/apache/geode/pull/5195


   First cut of REST restore redundancy
   More tests need to be added, but current testing is pretty solid
   because it is largely based on previous work done by others.
   


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mhansonp commented on a change in pull request #5195:
URL: https://github.com/apache/geode/pull/5195#discussion_r434049788



##########
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.
   
   I agree. It adds a layer of isolation that is not necessary.
   




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
jinmeiliao commented on pull request #5195:
URL: https://github.com/apache/geode/pull/5195#issuecomment-638245111


   also I would expect a bulk of the work is already done by the restoreredundancy command, so we are just reusing their code instead of adding a bunch of new code.


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
jinmeiliao commented on a change in pull request #5195:
URL: https://github.com/apache/geode/pull/5195#discussion_r434108906



##########
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:
       > I used serializable in the name because the class is basically a copy of an existing one with the serializability being a distinguishing feature. This is one of those points of question where, should I just modify the RegionRedundancyStatus class to make it serializable?
   
   that one is already DataSerializable, so you shouldn't have to make it Serializable. I think you can just use whatever they had used as the result before, just move them to the management module. If the object are used in locator/server function calls, then they must have been Serializable/DataSerializable already.




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
mhansonp commented on a change in pull request #5195:
URL: https://github.com/apache/geode/pull/5195#discussion_r434049469



##########
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:
       I used serializable in the name because the class is basically a copy of an existing one with the serializability being a distinguishing feature. This is one of those points of question where, should I just modify the RegionRedundancyStatus class to make it serializable?
   




----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
mhansonp commented on a change in pull request #5195:
URL: https://github.com/apache/geode/pull/5195#discussion_r434050411



##########
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:
       Great catch. This is one of the changes that I am just not sure about. I put in a placeholder values that allow it to work, but I need to really consider the actual values.




----------------------------------------------------------------
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



[GitHub] [geode] mhansonp closed pull request #5195: GEODE-8095 create restore redundancy

Posted by GitBox <gi...@apache.org>.
mhansonp closed pull request #5195:
URL: https://github.com/apache/geode/pull/5195


   


----------------------------------------------------------------
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



[GitHub] [geode] mhansonp commented on pull request #5195: GEODE-8095 create restore redundancy

Posted by GitBox <gi...@apache.org>.
mhansonp commented on pull request #5195:
URL: https://github.com/apache/geode/pull/5195#issuecomment-639888115


   Taking a different path.


----------------------------------------------------------------
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