-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ResourceCluster] Add basic host routes to v1 API. #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
public class ResourceClustersPayloads { | ||
public static final String CLUSTER_ID = "mantisResourceClusterUT1"; | ||
|
||
public static final String RESOURCE_CLUSTER_CREATE = "{\"clusterId\":\"mantisResourceClusterUT1\",\"clusterSpec\":" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a personal preference than anything, but these may be painful to modify for testing if the data structure changes in any sort of meaningful way. Some kind of structure that gets serialized, or even a well formatted ".json" file that is read in would be easier to edit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Moved to a resource JSON file.
import io.mantisrx.control.plane.resource.cluster.proto.ScaleResourceResponse; | ||
import java.util.concurrent.CompletionStage; | ||
|
||
public interface ResourceClusterRouteHandler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have missed some team discussion on this but do we have an official stance on interface names I ResourceClusterRouteHandler
vs ResourceClusterRouteHandler
? I don't have a strong opinion either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was brought up a few times in some of the previous PR comments from @sundargates IIRC and I am following his pattern in the new OSS mantis code at this point to be consistent.
.mapAsync(1, rc -> updateRegisteredClusters(rc)) | ||
.mapAsync(1, notUsed -> getRegisteredResourceClustersWritable()) | ||
.runWith(Sink.last(), system); | ||
log.info("Return future on deregisterCluster: {}", clusterId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Might be more appropriate to use trace
or debug
level here.
I’ll make sure to follow that pattern in my code too to maintain
consistency. :)
…On Mon, Apr 25, 2022 at 9:56 AM Andy Zhang ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/master/api/akka/route/handlers/ResourceClusterRouteHandler.java
<#197 (comment)>:
> + * limitations under the License.
+ */
+
+package io.mantisrx.master.api.akka.route.handlers;
+
+import io.mantisrx.control.plane.resource.cluster.proto.GetResourceClusterSpecRequest;
+import io.mantisrx.control.plane.resource.cluster.proto.ListResourceClusterRequest;
+import io.mantisrx.control.plane.resource.cluster.proto.ProvisionResourceClusterRequest;
+import io.mantisrx.control.plane.resource.cluster.proto.ResourceClusterAPIProto.DeleteResourceClusterResponse;
+import io.mantisrx.control.plane.resource.cluster.proto.ResourceClusterAPIProto.GetResourceClusterResponse;
+import io.mantisrx.control.plane.resource.cluster.proto.ResourceClusterAPIProto.ListResourceClustersResponse;
+import io.mantisrx.control.plane.resource.cluster.proto.ScaleResourceRequest;
+import io.mantisrx.control.plane.resource.cluster.proto.ScaleResourceResponse;
+import java.util.concurrent.CompletionStage;
+
+public interface ResourceClusterRouteHandler {
This was brought up a few times in some of the previous PR comments from
@sundargates <https://github.com/sundargates> IIRC and I am following his
pattern in the new OSS mantis code at this point to be consistent.
—
Reply to this email directly, view it on GitHub
<#197 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACUD7Z57LPWIUK3PFTVKTTVG3FEVANCNFSM5UC6W5QQ>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
Context
Add API for ResouceClustersHostActor public facing operations.
Checklist
./gradlew build
compiles code correctly./gradlew test
passes all testsCONTRIBUTING.md