You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/07/29 06:48:55 UTC

[GitHub] [inlong] healchow opened a new pull request, #5274: [INLONG-5269][Manager] Workflow supports rapid scaling of MQ resources

healchow opened a new pull request, #5274:
URL: https://github.com/apache/inlong/pull/5274

   ### Prepare a Pull Request
   
   - Fixes #5269
   
   ### Motivation
   
   Workflow supports rapid scaling of MQ resources.
   
   ### Modifications
   
   1. Change the NORMAL_MODE to STANDARD_MODE for the inlong group.
   2. Move the listener classes into the listener package.
   3. Use factory design pattern, abstract the operation of MessageQueue, and remove XxxPulsarTaskListener and XxxTubeTaskListener.
   
   ### Verifying this change
   
   - [X] This change is already covered by existing tests, such as:
       WorkflowServiceImplTest
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (JavaDocs)


-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] healchow commented on a diff in pull request #5274: [INLONG-5269][Manager] Workflow supports rapid scaling of MQ resources

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #5274:
URL: https://github.com/apache/inlong/pull/5274#discussion_r933135759


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/QueueResourceOperatorFactory.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.inlong.manager.service.resource.queue;
+
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.enums.MQType;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * Factory for {@link QueueResourceOperator}.
+ */
+@Service
+public class QueueResourceOperatorFactory {
+
+    @Autowired
+    private List<QueueResourceOperator> operatorList;
+
+    /**
+     * Get a message queue resource operator instance via the given mqType
+     */
+    public QueueResourceOperator getInstance(MQType mqType) {
+        Optional<QueueResourceOperator> instance = operatorList.stream()
+                .filter(inst -> inst.accept(mqType))
+                .findFirst();
+        if (!instance.isPresent()) {
+            throw new BusinessException(ErrorCodeEnum.MQ_TYPE_NOT_SUPPORT,
+                    String.format(ErrorCodeEnum.MQ_TYPE_NOT_SUPPORT.getMessage(), mqType));

Review Comment:
   done.



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] healchow commented on a diff in pull request #5274: [INLONG-5269][Manager] Workflow supports rapid scaling of MQ resources

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #5274:
URL: https://github.com/apache/inlong/pull/5274#discussion_r933136431


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/pulsar/PulsarResourceOperator.java:
##########
@@ -0,0 +1,246 @@
+/*
+ * 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.inlong.manager.service.resource.queue.pulsar;
+
+import com.google.common.base.Objects;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.common.consts.InlongConstants;
+import org.apache.inlong.manager.common.enums.ClusterType;
+import org.apache.inlong.manager.common.enums.GroupStatus;
+import org.apache.inlong.manager.common.enums.MQType;
+import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
+import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
+import org.apache.inlong.manager.common.pojo.group.pulsar.InlongPulsarInfo;
+import org.apache.inlong.manager.common.pojo.pulsar.PulsarTopicBean;
+import org.apache.inlong.manager.common.pojo.stream.InlongStreamBriefInfo;
+import org.apache.inlong.manager.common.pojo.stream.InlongStreamInfo;
+import org.apache.inlong.manager.common.util.Preconditions;
+import org.apache.inlong.manager.service.cluster.InlongClusterService;
+import org.apache.inlong.manager.service.core.ConsumptionService;
+import org.apache.inlong.manager.service.core.InlongStreamService;
+import org.apache.inlong.manager.service.resource.queue.QueueResourceOperator;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Operator for create Pulsar Tenant, Namespace, Topic and Subscription
+ */
+@Slf4j
+@Service
+public class PulsarResourceOperator implements QueueResourceOperator {
+
+    @Autowired
+    private InlongStreamService streamService;
+    @Autowired
+    private InlongClusterService clusterService;
+    @Autowired
+    private ConsumptionService consumptionService;
+    @Autowired
+    private PulsarOperator pulsarOperator;
+
+    @Override
+    public boolean accept(MQType mqType) {
+        return MQType.PULSAR == mqType || MQType.TDMQ_PULSAR == mqType;
+    }
+
+    @Override
+    public void createQueueForGroup(InlongGroupInfo groupInfo, String operator) {
+        Preconditions.checkNotNull(groupInfo, "inlong group info cannot be null");
+        Preconditions.checkNotNull(operator, "operator cannot be null");
+        String groupId = groupInfo.getInlongGroupId();

Review Comment:
   Okay, already added a blank line after the verification codes.



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] haibo-duan commented on a diff in pull request #5274: [INLONG-5269][Manager] Workflow supports rapid scaling of MQ resources

Posted by GitBox <gi...@apache.org>.
haibo-duan commented on code in PR #5274:
URL: https://github.com/apache/inlong/pull/5274#discussion_r933393133


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/mysql/MySQLResourceOperator.java:
##########
@@ -1,137 +1,137 @@
-/*
- * 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.inlong.manager.service.resource.mysql;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.inlong.manager.common.consts.InlongConstants;
-import org.apache.inlong.manager.common.enums.SinkStatus;
-import org.apache.inlong.manager.common.enums.SinkType;
-import org.apache.inlong.manager.common.exceptions.WorkflowException;
-import org.apache.inlong.manager.common.pojo.sink.SinkInfo;
-import org.apache.inlong.manager.common.pojo.sink.mysql.MySQLColumnInfo;
-import org.apache.inlong.manager.common.pojo.sink.mysql.MySQLSinkDTO;
-import org.apache.inlong.manager.common.pojo.sink.mysql.MySQLTableInfo;
-import org.apache.inlong.manager.dao.entity.StreamSinkFieldEntity;
-import org.apache.inlong.manager.dao.mapper.StreamSinkFieldEntityMapper;
-import org.apache.inlong.manager.service.resource.SinkResourceOperator;
-import org.apache.inlong.manager.service.sink.StreamSinkService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.sql.Connection;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * MySQL's resource operator.
- */
-@Service
-public class MySQLResourceOperator implements SinkResourceOperator {
-
-    private static final Logger LOG = LoggerFactory.getLogger(MySQLResourceOperator.class);
-
-    @Autowired
-    private StreamSinkService sinkService;
-
-    @Autowired
-    private StreamSinkFieldEntityMapper fieldEntityMapper;
-
-    @Override
-    public Boolean accept(SinkType sinkType) {
-        return SinkType.MYSQL == sinkType;
-    }
-
-    @Override
-    public void createSinkResource(SinkInfo sinkInfo) {
-        LOG.info("begin to create MySQL resources sinkId={}", sinkInfo.getId());
-        if (SinkStatus.CONFIG_SUCCESSFUL.getCode().equals(sinkInfo.getStatus())) {
-            LOG.warn("MySQL resource [" + sinkInfo.getId() + "] already success, skip to create");
-            return;
-        } else if (InlongConstants.DISABLE_CREATE_RESOURCE.equals(sinkInfo.getEnableCreateResource())) {
-            LOG.warn("create resource was disabled, skip to create for [" + sinkInfo.getId() + "]");
-            return;
-        }
-        this.createTable(sinkInfo);
-    }
-
-    /**
-     * Create MySQL table by SinkInfo.
-     *
-     * @param sinkInfo {@link SinkInfo}
-     */
-    private void createTable(SinkInfo sinkInfo) {
-        LOG.info("begin to create MySQL table for sinkId={}", sinkInfo.getId());
-        List<StreamSinkFieldEntity> fieldList = fieldEntityMapper.selectBySinkId(sinkInfo.getId());
-        if (CollectionUtils.isEmpty(fieldList)) {
-            LOG.warn("no MySQL fields found, skip to create table for sinkId={}", sinkInfo.getId());
-        }
-        // set columns
-        List<MySQLColumnInfo> columnList = new ArrayList<>();
-        for (StreamSinkFieldEntity field : fieldList) {
-            MySQLColumnInfo columnInfo = new MySQLColumnInfo();
-            columnInfo.setName(field.getFieldName());
-            columnInfo.setType(field.getFieldType());
-            columnInfo.setComment(field.getFieldComment());
-            columnList.add(columnInfo);
-        }
-
-        MySQLSinkDTO mySQLSink = MySQLSinkDTO.getFromJson(sinkInfo.getExtParams());
-        MySQLTableInfo tableInfo = MySQLSinkDTO.getTableInfo(mySQLSink, columnList);
-        String url = mySQLSink.getJdbcUrl();
-        String user = mySQLSink.getUsername();
-        String password = mySQLSink.getPassword();
-
-        String dbName = tableInfo.getDbName();
-        String tableName = tableInfo.getTableName();
-        Connection conn = null;
-        try {
-            conn = MySQLJdbcUtils.getConnection(url, user, password);
-            // 1. create database if not exists
-            MySQLJdbcUtils.createDb(conn, dbName);
-            // 2. table not exists, create it
-            MySQLJdbcUtils.createTable(conn, tableInfo);
-            // 3. table exists, add columns - skip the exists columns
-            MySQLJdbcUtils.addColumns(conn, dbName, tableName, columnList);
-            // 4. update the sink status to success
-            String info = "success to create MySQL resource";
-            sinkService.updateStatus(sinkInfo.getId(), SinkStatus.CONFIG_SUCCESSFUL.getCode(), info);
-            LOG.info(info + " for sinkInfo={}", sinkInfo);
-            // 5. close connection.
-            conn.close();
-        } catch (Throwable e) {
-            String errMsg = "create MySQL table failed: " + e.getMessage();
-            LOG.error(errMsg, e);
-            sinkService.updateStatus(sinkInfo.getId(), SinkStatus.CONFIG_FAILED.getCode(), errMsg);
-            throw new WorkflowException(errMsg);
-        } finally {
-            try {
-                if (null != conn) {
-                    conn.close();
-                    conn = null;
-                }
-            } catch (Throwable e) {
-                String errMsg = "close MySQL connection failed: " + e.getMessage();
-                throw new WorkflowException(errMsg);
-            }
-        }
-        LOG.info("success create MySQL table for data sink [" + sinkInfo.getId() + "]");
-    }
-
-}
+/*
+ * 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.inlong.manager.service.resource.sink.mysql;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.inlong.manager.common.consts.InlongConstants;
+import org.apache.inlong.manager.common.enums.SinkStatus;
+import org.apache.inlong.manager.common.enums.SinkType;
+import org.apache.inlong.manager.common.exceptions.WorkflowException;
+import org.apache.inlong.manager.common.pojo.sink.SinkInfo;
+import org.apache.inlong.manager.common.pojo.sink.mysql.MySQLColumnInfo;
+import org.apache.inlong.manager.common.pojo.sink.mysql.MySQLSinkDTO;
+import org.apache.inlong.manager.common.pojo.sink.mysql.MySQLTableInfo;
+import org.apache.inlong.manager.dao.entity.StreamSinkFieldEntity;
+import org.apache.inlong.manager.dao.mapper.StreamSinkFieldEntityMapper;
+import org.apache.inlong.manager.service.resource.sink.SinkResourceOperator;
+import org.apache.inlong.manager.service.sink.StreamSinkService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.sql.Connection;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * MySQL's resource operator.
+ */
+@Service
+public class MySQLResourceOperator implements SinkResourceOperator {
+
+    private static final Logger LOG = LoggerFactory.getLogger(MySQLResourceOperator.class);
+
+    @Autowired
+    private StreamSinkService sinkService;
+
+    @Autowired
+    private StreamSinkFieldEntityMapper fieldEntityMapper;
+
+    @Override
+    public Boolean accept(SinkType sinkType) {
+        return SinkType.MYSQL == sinkType;
+    }
+
+    @Override
+    public void createSinkResource(SinkInfo sinkInfo) {
+        LOG.info("begin to create MySQL resources sinkId={}", sinkInfo.getId());
+        if (SinkStatus.CONFIG_SUCCESSFUL.getCode().equals(sinkInfo.getStatus())) {
+            LOG.warn("MySQL resource [" + sinkInfo.getId() + "] already success, skip to create");
+            return;
+        } else if (InlongConstants.DISABLE_CREATE_RESOURCE.equals(sinkInfo.getEnableCreateResource())) {
+            LOG.warn("create resource was disabled, skip to create for [" + sinkInfo.getId() + "]");
+            return;
+        }
+        this.createTable(sinkInfo);
+    }
+
+    /**
+     * Create MySQL table by SinkInfo.
+     *
+     * @param sinkInfo {@link SinkInfo}
+     */
+    private void createTable(SinkInfo sinkInfo) {
+        LOG.info("begin to create MySQL table for sinkId={}", sinkInfo.getId());
+        List<StreamSinkFieldEntity> fieldList = fieldEntityMapper.selectBySinkId(sinkInfo.getId());
+        if (CollectionUtils.isEmpty(fieldList)) {
+            LOG.warn("no MySQL fields found, skip to create table for sinkId={}", sinkInfo.getId());
+        }
+        // set columns
+        List<MySQLColumnInfo> columnList = new ArrayList<>();
+        for (StreamSinkFieldEntity field : fieldList) {
+            MySQLColumnInfo columnInfo = new MySQLColumnInfo();
+            columnInfo.setName(field.getFieldName());
+            columnInfo.setType(field.getFieldType());
+            columnInfo.setComment(field.getFieldComment());
+            columnList.add(columnInfo);
+        }
+
+        MySQLSinkDTO mySQLSink = MySQLSinkDTO.getFromJson(sinkInfo.getExtParams());
+        MySQLTableInfo tableInfo = MySQLSinkDTO.getTableInfo(mySQLSink, columnList);
+        String url = mySQLSink.getJdbcUrl();
+        String user = mySQLSink.getUsername();
+        String password = mySQLSink.getPassword();
+
+        String dbName = tableInfo.getDbName();
+        String tableName = tableInfo.getTableName();
+        Connection conn = null;
+        try {
+            conn = MySQLJdbcUtils.getConnection(url, user, password);

Review Comment:
   It is better to replace the finally block with the try-with-resource statement.



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] leosanqing commented on a diff in pull request #5274: [INLONG-5269][Manager] Workflow supports rapid scaling of MQ resources

Posted by GitBox <gi...@apache.org>.
leosanqing commented on code in PR #5274:
URL: https://github.com/apache/inlong/pull/5274#discussion_r933046387


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/QueueResourceOperatorFactory.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.inlong.manager.service.resource.queue;
+
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.enums.MQType;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * Factory for {@link QueueResourceOperator}.
+ */
+@Service
+public class QueueResourceOperatorFactory {
+
+    @Autowired
+    private List<QueueResourceOperator> operatorList;
+
+    /**
+     * Get a message queue resource operator instance via the given mqType
+     */
+    public QueueResourceOperator getInstance(MQType mqType) {
+        Optional<QueueResourceOperator> instance = operatorList.stream()
+                .filter(inst -> inst.accept(mqType))
+                .findFirst();
+        if (!instance.isPresent()) {
+            throw new BusinessException(ErrorCodeEnum.MQ_TYPE_NOT_SUPPORT,
+                    String.format(ErrorCodeEnum.MQ_TYPE_NOT_SUPPORT.getMessage(), mqType));

Review Comment:
   Could be combined like this
   ```
   return operatorList.stream()
                   .filter(inst -> inst.accept(mqType))
                   .findFirst()
                   .orElseThrow(() -> new BusinessException(ErrorCodeEnum.MQ_TYPE_NOT_SUPPORT,
                           String.format(ErrorCodeEnum.MQ_TYPE_NOT_SUPPORT.getMessage(), mqType)));
   ```



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] leosanqing commented on a diff in pull request #5274: [INLONG-5269][Manager] Workflow supports rapid scaling of MQ resources

Posted by GitBox <gi...@apache.org>.
leosanqing commented on code in PR #5274:
URL: https://github.com/apache/inlong/pull/5274#discussion_r933053769


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/pulsar/PulsarResourceOperator.java:
##########
@@ -0,0 +1,246 @@
+/*
+ * 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.inlong.manager.service.resource.queue.pulsar;
+
+import com.google.common.base.Objects;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.manager.common.consts.InlongConstants;
+import org.apache.inlong.manager.common.enums.ClusterType;
+import org.apache.inlong.manager.common.enums.GroupStatus;
+import org.apache.inlong.manager.common.enums.MQType;
+import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
+import org.apache.inlong.manager.common.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.common.pojo.cluster.pulsar.PulsarClusterInfo;
+import org.apache.inlong.manager.common.pojo.group.InlongGroupInfo;
+import org.apache.inlong.manager.common.pojo.group.pulsar.InlongPulsarInfo;
+import org.apache.inlong.manager.common.pojo.pulsar.PulsarTopicBean;
+import org.apache.inlong.manager.common.pojo.stream.InlongStreamBriefInfo;
+import org.apache.inlong.manager.common.pojo.stream.InlongStreamInfo;
+import org.apache.inlong.manager.common.util.Preconditions;
+import org.apache.inlong.manager.service.cluster.InlongClusterService;
+import org.apache.inlong.manager.service.core.ConsumptionService;
+import org.apache.inlong.manager.service.core.InlongStreamService;
+import org.apache.inlong.manager.service.resource.queue.QueueResourceOperator;
+import org.apache.pulsar.client.admin.PulsarAdmin;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * Operator for create Pulsar Tenant, Namespace, Topic and Subscription
+ */
+@Slf4j
+@Service
+public class PulsarResourceOperator implements QueueResourceOperator {
+
+    @Autowired
+    private InlongStreamService streamService;
+    @Autowired
+    private InlongClusterService clusterService;
+    @Autowired
+    private ConsumptionService consumptionService;
+    @Autowired
+    private PulsarOperator pulsarOperator;
+
+    @Override
+    public boolean accept(MQType mqType) {
+        return MQType.PULSAR == mqType || MQType.TDMQ_PULSAR == mqType;
+    }
+
+    @Override
+    public void createQueueForGroup(InlongGroupInfo groupInfo, String operator) {
+        Preconditions.checkNotNull(groupInfo, "inlong group info cannot be null");
+        Preconditions.checkNotNull(operator, "operator cannot be null");
+        String groupId = groupInfo.getInlongGroupId();

Review Comment:
   I think a blank line between the verification code and the business code will be more readable。
   
   The same below



-- 
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: commits-unsubscribe@inlong.apache.org

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


[GitHub] [inlong] dockerzhang merged pull request #5274: [INLONG-5269][Manager] Workflow supports rapid scaling of MQ resources

Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #5274:
URL: https://github.com/apache/inlong/pull/5274


-- 
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: commits-unsubscribe@inlong.apache.org

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