Skip to content

Commit

Permalink
[INLONG-4551][TubeMQ] Batch delete consumer groups from blacklist (ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
bluewang authored and vernedeng committed Jul 4, 2022
1 parent a8df31d commit 0571a49
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.inlong.tubemq.manager.controller.TubeMQResult;
import org.apache.inlong.tubemq.manager.controller.group.request.AddBlackGroupReq;
import org.apache.inlong.tubemq.manager.controller.group.request.BatchDeleteGroupReq;
import org.apache.inlong.tubemq.manager.controller.group.request.DeleteBlackGroupReq;
import org.apache.inlong.tubemq.manager.controller.group.request.DeleteOffsetReq;
import org.apache.inlong.tubemq.manager.controller.group.request.FilterCondGroupReq;
Expand Down Expand Up @@ -75,6 +76,8 @@ public TubeMQResult groupMethodProxy(@RequestParam String method, @RequestBody S
return batchAddGroup(gson.fromJson(req, BatchAddGroupAuthReq.class));
case TubeConst.DELETE:
return masterService.baseRequestMaster(gson.fromJson(req, DeleteGroupReq.class));
case TubeConst.BATCH_DELETE:
return masterService.baseRequestMaster(gson.fromJson(req, BatchDeleteGroupReq.class));
case TubeConst.REBALANCE_CONSUMER_GROUP:
return topicService.rebalanceGroup(gson.fromJson(req, RebalanceGroupReq.class));
case TubeConst.REBALANCE_CONSUMER:
Expand Down Expand Up @@ -142,6 +145,8 @@ TubeMQResult blackGroupProxy(
return masterService.baseRequestMaster(gson.fromJson(req, AddBlackGroupReq.class));
case TubeConst.DELETE:
return masterService.baseRequestMaster(gson.fromJson(req, DeleteBlackGroupReq.class));
case TubeConst.BATCH_DELETE:
return masterService.baseRequestMaster(gson.fromJson(req, BatchDeleteGroupReq.class));
default:
return TubeMQResult.errorResult(TubeMQErrorConst.NO_SUCH_METHOD);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.tubemq.manager.controller.group.request;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.inlong.tubemq.manager.controller.node.request.BaseReq;
import org.apache.inlong.tubemq.manager.controller.topic.request.GroupAuthItem;

import java.util.List;

/**
* Batch delete group info
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class BatchDeleteGroupReq extends BaseReq {
private List<GroupAuthItem> groupNameJsonSet;
private String confModAuthToken;
private String modifyUser;
}
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public TubeMQResult queryOffset(QueryOffsetReq req) {
generateOffsetInfo(offsetPerBroker, topicInfo, res);
}

result.setData(gson.toJson(allBrokersOffsetRes));
result.setData(allBrokersOffsetRes);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class TubeConst {
public static final String QUERY_CAN_WRITE = "queryCanWrite";
public static final String FILTER_CONDITION = "filterCondition";
public static final String FLOW_CONTROL = "flowControl";
public static final String BATCH_DELETE = "batchDelete";


/**
Expand Down

0 comments on commit 0571a49

Please sign in to comment.