You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "RocMarshal (via GitHub)" <gi...@apache.org> on 2023/03/16 05:05:29 UTC

[GitHub] [incubator-streampark] RocMarshal commented on a diff in pull request #2432: [Feature][Issue-2324/Issue-2416] Add backend declaration & implementation for Yarn queue management feature.

RocMarshal commented on code in PR #2432:
URL: https://github.com/apache/incubator-streampark/pull/2432#discussion_r1138126845


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/YarnQueueController.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.streampark.console.core.controller;
+
+import org.apache.streampark.console.base.domain.RestRequest;
+import org.apache.streampark.console.base.domain.RestResponse;
+import org.apache.streampark.console.core.annotation.ApiAccess;
+import org.apache.streampark.console.core.entity.YarnQueue;
+import org.apache.streampark.console.core.service.YarnQueueService;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("flink/yarnQueue")
+public class YarnQueueController {
+
+  @Autowired private YarnQueueService yarnQueueService;
+
+  /**
+   * * List the queues in the specified team by the paging & optional search hint message.
+   *
+   * @param restRequest page request information.
+   * @param yarnQueue optional fields used to search.
+   * @return RestResponse with IPage<{@link YarnQueue}> object.
+   */
+  @ApiAccess
+  @PostMapping("list")
+  public RestResponse list(RestRequest restRequest, YarnQueue yarnQueue) {
+    IPage<YarnQueue> queuePage = yarnQueueService.findYarnQueues(yarnQueue, restRequest);
+    return RestResponse.success(queuePage);
+  }
+
+  /**
+   * Check for the yarn queue if exists in the team or the queue name and label format is invalid.
+   * status msg 0 Success 1 The queue already existed in the team 2 The queue name and label format
+   * is invalid.
+   */

Review Comment:
   It looks like a difference  of comments between controller and service.



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

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org