Skip to content

Commit

Permalink
[INLONG-3090][Manager] Add TDMQ_PULSAR type in manager (#3091)
Browse files Browse the repository at this point in the history
  • Loading branch information
kipshi committed Mar 12, 2022
1 parent 0ec4e30 commit baa8802
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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.client.api;

import io.swagger.annotations.ApiModelProperty;
import org.apache.inlong.manager.common.enums.MqType;

public class TdmqPulsarBaseConf extends PulsarBaseConf {

@ApiModelProperty("Message queue type")
private MqType type = MqType.TDMQ_PULSAR;
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public static MqBaseConf parseMqBaseConf(InlongGroupResponse inlongGroupResponse
case NONE:
return MqBaseConf.BLANK_MQ_CONF;
case PULSAR:
case TDMQ_PULSAR:
return parsePulsarConf(inlongGroupResponse);
case TUBE:
return parseTubeConf(inlongGroupResponse);
Expand Down Expand Up @@ -204,7 +205,7 @@ public static InlongGroupInfo createGroupInfo(InlongGroupConf groupConf) {
groupInfo.setInCharges(groupConf.getOperator());
groupInfo.setExtList(Lists.newArrayList());
groupInfo.setCreator(groupConf.getOperator());
if (mqType == MqType.PULSAR) {
if (mqType == MqType.PULSAR || mqType == MqType.TDMQ_PULSAR) {
PulsarBaseConf pulsarBaseConf = (PulsarBaseConf) mqConf;
groupInfo.setMqResourceObj(pulsarBaseConf.getNamespace());
InlongGroupPulsarInfo pulsarInfo = createPulsarInfo(pulsarBaseConf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
public enum MqType {
PULSAR,
TUBE,
TDMQ_PULSAR,
NONE;

public static MqType forType(String type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
@ApiModel("Extended inlong group info of different MQs")
@JsonTypeInfo(use = Id.NAME, visible = true, property = "middlewareType", defaultImpl = InlongGroupMqExtBase.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = InlongGroupPulsarInfo.class, name = Constant.MIDDLEWARE_PULSAR)
@JsonSubTypes.Type(value = InlongGroupPulsarInfo.class, name = Constant.MIDDLEWARE_PULSAR),
@JsonSubTypes.Type(value = InlongGroupPulsarInfo.class, name = Constant.MIDDLEWARE_TDMQ_PULSAR)
})
public class InlongGroupMqExtBase {

Expand Down

0 comments on commit baa8802

Please sign in to comment.