You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tubemq.apache.org by go...@apache.org on 2020/04/06 06:57:04 UTC
[incubator-tubemq] branch master updated: [TUBEMQ-57] fix some
typos & todo (#44)
This is an automated email from the ASF dual-hosted git repository.
gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tubemq.git
The following commit(s) were added to refs/heads/master by this push:
new 46534b5 [TUBEMQ-57] fix some typos & todo (#44)
46534b5 is described below
commit 46534b51894c8311f29645fc7cdac1e95144aa3c
Author: Tboy <gu...@immomo.com>
AuthorDate: Mon Apr 6 14:56:58 2020 +0800
[TUBEMQ-57] fix some typos & todo (#44)
---
.../server/broker/web/BrokerAdminServlet.java | 6 +-
.../server/common/utils/WebParameterUtils.java | 60 ++++-----
.../server/master/web/action/screen/Webapi.java | 16 +--
.../web/handler/WebAdminFlowRuleHandler.java | 34 +++---
.../web/handler/WebAdminGroupCtrlHandler.java | 100 +++++++--------
.../web/handler/WebAdminTopicAuthHandler.java | 10 +-
.../web/handler/WebBrokerDefConfHandler.java | 72 +++++------
.../web/handler/WebBrokerTopicConfHandler.java | 136 ++++++++++-----------
8 files changed, 215 insertions(+), 219 deletions(-)
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/broker/web/BrokerAdminServlet.java b/tubemq-server/src/main/java/org/apache/tubemq/server/broker/web/BrokerAdminServlet.java
index df557e6..5dc1136 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/broker/web/BrokerAdminServlet.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/broker/web/BrokerAdminServlet.java
@@ -282,7 +282,7 @@ public class BrokerAdminServlet extends HttpServlet {
*/
private StringBuilder adminGetMemStoreStatisInfo(HttpServletRequest req) throws Exception {
StringBuilder sBuilder = new StringBuilder(1024);
- Set<String> bathTopicNames = new HashSet<String>();
+ Set<String> batchTopicNames = new HashSet<String>();
String inputTopicName = req.getParameter("topicName");
if (TStringUtils.isNotBlank(inputTopicName)) {
inputTopicName = String.valueOf(inputTopicName).trim();
@@ -308,7 +308,7 @@ public class BrokerAdminServlet extends HttpServlet {
.append(" can only contain characters,numbers,and underscores!\"}");
return sBuilder;
}
- bathTopicNames.add(topicName);
+ batchTopicNames.add(topicName);
}
}
boolean requireRefresh =
@@ -320,7 +320,7 @@ public class BrokerAdminServlet extends HttpServlet {
int recordId = 0, index = 0;
for (Map.Entry<String, ConcurrentHashMap<Integer, MessageStore>> entry : messageTopicStores.entrySet()) {
if (TStringUtils.isBlank(entry.getKey())
- || (!bathTopicNames.isEmpty() && !bathTopicNames.contains(entry.getKey()))) {
+ || (!batchTopicNames.isEmpty() && !batchTopicNames.contains(entry.getKey()))) {
continue;
}
String topicName = entry.getKey();
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/common/utils/WebParameterUtils.java b/tubemq-server/src/main/java/org/apache/tubemq/server/common/utils/WebParameterUtils.java
index 841c6a6..b98a4f9 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/common/utils/WebParameterUtils.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/common/utils/WebParameterUtils.java
@@ -512,7 +512,7 @@ public class WebParameterUtils {
boolean checkResToken,
Set<String> resTokens,
final StringBuilder sb) throws Exception {
- Set<String> bathOpGroupNames = new HashSet<String>();
+ Set<String> batchOpGroupNames = new HashSet<String>();
if (TStringUtils.isNotBlank(inputGroupName)) {
inputGroupName = escDoubleQuotes(inputGroupName.trim());
}
@@ -520,11 +520,11 @@ public class WebParameterUtils {
if (checkEmpty) {
throw new Exception("Illegal value: required groupName parameter");
}
- return bathOpGroupNames;
+ return batchOpGroupNames;
}
String[] strGroupNames = inputGroupName.split(TokenConstants.ARRAY_SEP);
if (strGroupNames.length > TServerConstants.CFG_BATCH_RECORD_OPERATE_MAX_COUNT) {
- throw new Exception(sb.append("Illegal value: groupName's bath count over max count ")
+ throw new Exception(sb.append("Illegal value: groupName's batch count over max count ")
.append(TServerConstants.CFG_BATCH_RECORD_OPERATE_MAX_COUNT).toString());
}
for (int i = 0; i < strGroupNames.length; i++) {
@@ -551,14 +551,14 @@ public class WebParameterUtils {
.append("in groupName parameter must begin with a letter, can only contain ")
.append("characters,numbers,hyphen,and underscores").toString());
}
- bathOpGroupNames.add(groupName);
+ batchOpGroupNames.add(groupName);
}
- if (bathOpGroupNames.isEmpty()) {
+ if (batchOpGroupNames.isEmpty()) {
if (checkEmpty) {
throw new Exception("Illegal value: Null value of groupName parameter");
}
}
- return bathOpGroupNames;
+ return batchOpGroupNames;
}
public static Set<String> getBatchTopicNames(String inputTopicName,
@@ -566,7 +566,7 @@ public class WebParameterUtils {
boolean checkRange,
Set<String> checkedTopicList,
final StringBuilder sb) throws Exception {
- Set<String> bathOpTopicNames = new HashSet<String>();
+ Set<String> batchOpTopicNames = new HashSet<String>();
if (TStringUtils.isNotBlank(inputTopicName)) {
inputTopicName = escDoubleQuotes(inputTopicName.trim());
}
@@ -574,11 +574,11 @@ public class WebParameterUtils {
if (checkEmpty) {
throw new Exception("Illegal value: required topicName parameter");
}
- return bathOpTopicNames;
+ return batchOpTopicNames;
}
String[] strTopicNames = inputTopicName.split(TokenConstants.ARRAY_SEP);
if (strTopicNames.length > TServerConstants.CFG_BATCH_RECORD_OPERATE_MAX_COUNT) {
- throw new Exception(sb.append("Illegal value: topicName's bath count over max count ")
+ throw new Exception(sb.append("Illegal value: topicName's batch count over max count ")
.append(TServerConstants.CFG_BATCH_RECORD_OPERATE_MAX_COUNT).toString());
}
for (int i = 0; i < strTopicNames.length; i++) {
@@ -603,19 +603,19 @@ public class WebParameterUtils {
.append(") not configure in master's topic configure, please configure first!").toString());
}
}
- bathOpTopicNames.add(topicName);
+ batchOpTopicNames.add(topicName);
}
- if (bathOpTopicNames.isEmpty()) {
+ if (batchOpTopicNames.isEmpty()) {
if (checkEmpty) {
throw new Exception("Illegal value: Null value of topicName parameter");
}
}
- return bathOpTopicNames;
+ return batchOpTopicNames;
}
public static Set<String> getBatchBrokerIpSet(String inStrBrokerIps,
boolean checkEmpty) throws Exception {
- Set<String> bathBrokerIps = new HashSet<String>();
+ Set<String> batchBrokerIps = new HashSet<String>();
if (TStringUtils.isNotBlank(inStrBrokerIps)) {
inStrBrokerIps = escDoubleQuotes(inStrBrokerIps.trim());
}
@@ -623,7 +623,7 @@ public class WebParameterUtils {
if (checkEmpty) {
throw new Exception("Illegal value: required brokerIp parameter");
}
- return bathBrokerIps;
+ return batchBrokerIps;
}
String[] strBrokerIps = inStrBrokerIps.split(TokenConstants.ARRAY_SEP);
for (int i = 0; i < strBrokerIps.length; i++) {
@@ -633,22 +633,22 @@ public class WebParameterUtils {
String brokerIp =
validAddressParameter("brokerIp", strBrokerIps[i],
TBaseConstants.META_MAX_BROKER_IP_LENGTH, true, "");
- if (bathBrokerIps.contains(brokerIp)) {
+ if (batchBrokerIps.contains(brokerIp)) {
continue;
}
- bathBrokerIps.add(brokerIp);
+ batchBrokerIps.add(brokerIp);
}
- if (bathBrokerIps.isEmpty()) {
+ if (batchBrokerIps.isEmpty()) {
if (checkEmpty) {
throw new Exception("Illegal value: Null value of brokerIp parameter");
}
}
- return bathBrokerIps;
+ return batchBrokerIps;
}
public static Set<Integer> getBatchBrokerIdSet(String inStrBrokerIds,
boolean checkEmpty) throws Exception {
- Set<Integer> bathBrokerIdSet = new HashSet<Integer>();
+ Set<Integer> batchBrokerIdSet = new HashSet<Integer>();
if (TStringUtils.isNotBlank(inStrBrokerIds)) {
inStrBrokerIds = escDoubleQuotes(inStrBrokerIds.trim());
}
@@ -656,12 +656,12 @@ public class WebParameterUtils {
if (checkEmpty) {
throw new Exception("Illegal value: required brokerId parameter");
}
- return bathBrokerIdSet;
+ return batchBrokerIdSet;
}
String[] strBrokerIds = inStrBrokerIds.split(TokenConstants.ARRAY_SEP);
if (strBrokerIds.length > TServerConstants.CFG_BATCH_BROKER_OPERATE_MAX_COUNT) {
throw new Exception(new StringBuilder(512)
- .append("Illegal value: bath numbers of brokerId's value over max count ")
+ .append("Illegal value: batch numbers of brokerId's value over max count ")
.append(TServerConstants.CFG_BATCH_BROKER_OPERATE_MAX_COUNT).toString());
}
for (int i = 0; i < strBrokerIds.length; i++) {
@@ -670,21 +670,21 @@ public class WebParameterUtils {
}
int brokerId =
validIntDataParameter("brokerId", strBrokerIds[i], true, 0, 1);
- bathBrokerIdSet.add(brokerId);
+ batchBrokerIdSet.add(brokerId);
}
- if (bathBrokerIdSet.isEmpty()) {
+ if (batchBrokerIdSet.isEmpty()) {
if (checkEmpty) {
throw new Exception("Illegal value: Null value of brokerId parameter");
}
}
- return bathBrokerIdSet;
+ return batchBrokerIdSet;
}
public static Set<BdbBrokerConfEntity> getBatchBrokerIdSet(String inStrBrokerIds,
BrokerConfManage webMaster,
boolean checkEmpty,
final StringBuilder sb) throws Exception {
- Set<BdbBrokerConfEntity> bathBrokerIdSet = new HashSet<BdbBrokerConfEntity>();
+ Set<BdbBrokerConfEntity> batchBrokerIdSet = new HashSet<BdbBrokerConfEntity>();
if (TStringUtils.isNotBlank(inStrBrokerIds)) {
inStrBrokerIds = escDoubleQuotes(inStrBrokerIds.trim());
}
@@ -692,12 +692,12 @@ public class WebParameterUtils {
if (checkEmpty) {
throw new Exception("Illegal value: required brokerId parameter");
}
- return bathBrokerIdSet;
+ return batchBrokerIdSet;
}
String[] strBrokerIds = inStrBrokerIds.split(TokenConstants.ARRAY_SEP);
if (strBrokerIds.length > TServerConstants.CFG_BATCH_BROKER_OPERATE_MAX_COUNT) {
throw new Exception(sb
- .append("Illegal value: bath numbers of brokerId's value over max count ")
+ .append("Illegal value: batch numbers of brokerId's value over max count ")
.append(TServerConstants.CFG_BATCH_BROKER_OPERATE_MAX_COUNT).toString());
}
for (int i = 0; i < strBrokerIds.length; i++) {
@@ -713,14 +713,14 @@ public class WebParameterUtils {
.append("Illegal value: not found broker default configure record by brokerId=")
.append(brokerId).toString());
}
- bathBrokerIdSet.add(brokerConfEntity);
+ batchBrokerIdSet.add(brokerConfEntity);
}
- if (bathBrokerIdSet.isEmpty()) {
+ if (batchBrokerIdSet.isEmpty()) {
if (checkEmpty) {
throw new Exception("Illegal value: Null value of brokerId parameter");
}
}
- return bathBrokerIdSet;
+ return batchBrokerIdSet;
}
/**
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/action/screen/Webapi.java b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/action/screen/Webapi.java
index 48e6130..60ae2e3 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/action/screen/Webapi.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/action/screen/Webapi.java
@@ -192,7 +192,7 @@ public class Webapi implements Action {
if ("admin_add_broker_configure".equals(method)) {
strBuffer = webBrokerDefConfHandler.adminAddBrokerDefConfEntityInfo(req);
} else if ("admin_bath_add_broker_configure".equals(method)) {
- strBuffer = webBrokerDefConfHandler.adminBathAddBrokerDefConfEntityInfo(req);
+ strBuffer = webBrokerDefConfHandler.adminBatchAddBrokerDefConfEntityInfo(req);
} else if ("admin_online_broker_configure".equals(method)) {
strBuffer = webBrokerDefConfHandler.adminOnlineBrokerConf(req);
} else if ("admin_update_broker_configure".equals(method)) {
@@ -210,7 +210,7 @@ public class Webapi implements Action {
} else if ("admin_add_new_topic_record".equals(method)) {
strBuffer = webTopicConfHandler.adminAddTopicEntityInfo(req);
} else if ("admin_bath_add_new_topic_record".equals(method)) {
- strBuffer = webTopicConfHandler.adminBathAddTopicEntityInfo(req);
+ strBuffer = webTopicConfHandler.adminBatchAddTopicEntityInfo(req);
} else if ("admin_modify_topic_info".equals(method)) {
strBuffer = webTopicConfHandler.adminModifyTopicEntityInfo(req);
} else if ("admin_delete_topic_info".equals(method)) {
@@ -238,7 +238,7 @@ public class Webapi implements Action {
} else if ("admin_add_black_consumergroup_info".equals(method)) {
strBuffer = webGroupCtrlHandler.adminAddBlackGroupInfo(req);
} else if ("admin_bath_add_black_consumergroup_info".equals(method)) {
- strBuffer = webGroupCtrlHandler.adminBathAddBlackGroupInfo(req);
+ strBuffer = webGroupCtrlHandler.adminBatchAddBlackGroupInfo(req);
} else if ("admin_delete_black_consumergroup_info".equals(method)) {
strBuffer = webGroupCtrlHandler.adminDeleteBlackGroupInfo(req);
} else if ("admin_add_authorized_consumergroup_info".equals(method)) {
@@ -246,23 +246,23 @@ public class Webapi implements Action {
} else if ("admin_delete_allowed_consumer_group_info".equals(method)) {
strBuffer = webGroupCtrlHandler.adminDeleteConsumerGroupInfo(req);
} else if ("admin_bath_add_topic_authorize_control".equals(method)) {
- strBuffer = webTopicAuthHandler.adminBathAddTopicAuthControl(req);
+ strBuffer = webTopicAuthHandler.adminBatchAddTopicAuthControl(req);
} else if ("admin_bath_add_authorized_consumergroup_info".equals(method)) {
- strBuffer = webGroupCtrlHandler.adminBathAddConsumerGroupInfo(req);
+ strBuffer = webGroupCtrlHandler.adminBatchAddConsumerGroupInfo(req);
} else if ("admin_add_group_filtercond_info".equals(method)) {
strBuffer = webGroupCtrlHandler.adminAddGroupFilterCondInfo(req);
} else if ("admin_bath_add_group_filtercond_info".equals(method)) {
- strBuffer = webGroupCtrlHandler.adminBathAddGroupFilterCondInfo(req);
+ strBuffer = webGroupCtrlHandler.adminBatchAddGroupFilterCondInfo(req);
} else if ("admin_mod_group_filtercond_info".equals(method)) {
strBuffer = webGroupCtrlHandler.adminModGroupFilterCondInfo(req);
} else if ("admin_bath_mod_group_filtercond_info".equals(method)) {
- strBuffer = webGroupCtrlHandler.adminBathModGroupFilterCondInfo(req);
+ strBuffer = webGroupCtrlHandler.adminBatchModGroupFilterCondInfo(req);
} else if ("admin_del_group_filtercond_info".equals(method)) {
strBuffer = webGroupCtrlHandler.adminDeleteGroupFilterCondInfo(req);
} else if ("admin_add_consume_group_setting".equals(method)) {
strBuffer = webGroupCtrlHandler.adminAddConsumeGroupSettingInfo(req);
} else if ("admin_bath_add_consume_group_setting".equals(method)) {
- strBuffer = webGroupCtrlHandler.adminBathAddConsumeGroupSetting(req);
+ strBuffer = webGroupCtrlHandler.adminBatchAddConsumeGroupSetting(req);
} else if ("admin_upd_consume_group_setting".equals(method)) {
strBuffer = webGroupCtrlHandler.adminUpdConsumeGroupSetting(req);
} else if ("admin_del_consume_group_setting".equals(method)) {
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminFlowRuleHandler.java b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminFlowRuleHandler.java
index 695d6d8..149994f 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminFlowRuleHandler.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminFlowRuleHandler.java
@@ -89,9 +89,9 @@ public class WebAdminFlowRuleHandler {
WebParameterUtils.validBooleanDataParameter("needSSDProc",
req.getParameter("needSSDProc"),
false, false);
- Set<String> bathGroupName = new HashSet<String>();
+ Set<String> batchGroupNames = new HashSet<String>();
if (opType == 1) {
- bathGroupName.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
+ batchGroupNames.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
} else {
// get groupname info if rule is set to consume group
boolean checkResToken = opType > 1;
@@ -99,7 +99,7 @@ public class WebAdminFlowRuleHandler {
if (checkResToken) {
resTokenSet.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
}
- bathGroupName =
+ batchGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, checkResToken, resTokenSet, strBuffer);
}
@@ -107,7 +107,7 @@ public class WebAdminFlowRuleHandler {
int ruleCnt =
checkAndGetFlowRules(req.getParameter("flowCtrlInfo"), opType, strBuffer);
// add flow control to bdb
- for (String groupName : bathGroupName) {
+ for (String groupName : batchGroupNames) {
if (groupName.equals(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL)) {
brokerConfManage.confAddBdbGroupFlowCtrl(
new BdbGroupFlowCtrlEntity(strBuffer.toString(),
@@ -152,20 +152,20 @@ public class WebAdminFlowRuleHandler {
WebParameterUtils.validDateParameter("createDate",
req.getParameter("createDate"),
TBaseConstants.META_MAX_DATEVALUE_LENGTH, false, new Date());
- Set<String> bathGroupName = new HashSet<String>();
+ Set<String> batchGroupNames = new HashSet<String>();
if (opType == 1) {
- bathGroupName.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
+ batchGroupNames.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
} else {
boolean checkResToken = opType > 1;
Set<String> resTokenSet = new HashSet<String>();
if (checkResToken) {
resTokenSet.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
}
- bathGroupName =
+ batchGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, checkResToken, resTokenSet, strBuffer);
}
- brokerConfManage.confDeleteBdbGroupFlowCtrl(bathGroupName);
+ brokerConfManage.confDeleteBdbGroupFlowCtrl(batchGroupNames);
strBuffer.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"OK\"}");
} catch (Exception e) {
strBuffer.delete(0, strBuffer.length());
@@ -198,17 +198,17 @@ public class WebAdminFlowRuleHandler {
WebParameterUtils.validDateParameter("createDate",
req.getParameter("createDate"),
TBaseConstants.META_MAX_DATEVALUE_LENGTH, false, new Date());
- Set<String> bathGroupName = new HashSet<String>();
+ Set<String> batchGroupNames = new HashSet<String>();
// check optype
if (opType == 1) {
- bathGroupName.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
+ batchGroupNames.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
} else {
boolean checkResToken = opType > 1;
Set<String> resTokenSet = new HashSet<String>();
if (checkResToken) {
resTokenSet.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
}
- bathGroupName =
+ batchGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, checkResToken, resTokenSet, strBuffer);
}
@@ -216,7 +216,7 @@ public class WebAdminFlowRuleHandler {
checkAndGetFlowRules(req.getParameter("flowCtrlInfo"), opType, strBuffer);
String newFlowCtrlInfo = strBuffer.toString();
strBuffer.delete(0, strBuffer.length());
- for (String groupName : bathGroupName) {
+ for (String groupName : batchGroupNames) {
// check if record changed
BdbGroupFlowCtrlEntity oldEntity =
brokerConfManage.getBdbGroupFlowCtrl(groupName);
@@ -307,16 +307,16 @@ public class WebAdminFlowRuleHandler {
.setQryPriorityId(WebParameterUtils.validIntDataParameter("qryPriorityId",
req.getParameter("qryPriorityId"),
false, TBaseConstants.META_VALUE_UNDEFINED, 0));
- Set<String> bathGroupName = new HashSet<String>();
+ Set<String> batchGroupNames = new HashSet<String>();
if (opType == 1) {
- bathGroupName.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
+ batchGroupNames.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
} else {
boolean checkResToken = opType > 1;
Set<String> resTokenSet = new HashSet<String>();
if (checkResToken) {
resTokenSet.add(TServerConstants.TOKEN_DEFAULT_FLOW_CONTROL);
}
- bathGroupName =
+ batchGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
false, checkResToken, resTokenSet, strBuffer);
}
@@ -326,9 +326,9 @@ public class WebAdminFlowRuleHandler {
List<BdbGroupFlowCtrlEntity> webGroupFlowCtrlEntities =
brokerConfManage.confGetBdbGroupFlowCtrl(bdbGroupFlowCtrlEntity);
for (BdbGroupFlowCtrlEntity entity : webGroupFlowCtrlEntities) {
- if (!bathGroupName.isEmpty()) {
+ if (!batchGroupNames.isEmpty()) {
boolean found = false;
- for (String tmpGroupName : bathGroupName) {
+ for (String tmpGroupName : batchGroupNames) {
if (entity.getGroupName().equals(tmpGroupName)) {
found = true;
break;
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminGroupCtrlHandler.java b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminGroupCtrlHandler.java
index 7bd13d2..32aa41b 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminGroupCtrlHandler.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminGroupCtrlHandler.java
@@ -146,7 +146,7 @@ public class WebAdminGroupCtrlHandler {
* @return
* @throws Exception
*/
- public StringBuilder adminBathAddGroupFilterCondInfo(HttpServletRequest req) throws Exception {
+ public StringBuilder adminBatchAddGroupFilterCondInfo(HttpServletRequest req) throws Exception {
StringBuilder sBuilder = new StringBuilder(512);
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
@@ -346,7 +346,7 @@ public class WebAdminGroupCtrlHandler {
* @return
* @throws Exception
*/
- public StringBuilder adminBathModGroupFilterCondInfo(HttpServletRequest req) throws Exception {
+ public StringBuilder adminBatchModGroupFilterCondInfo(HttpServletRequest req) throws Exception {
StringBuilder sBuilder = new StringBuilder(512);
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
@@ -368,8 +368,8 @@ public class WebAdminGroupCtrlHandler {
if ((jsonArray == null) || (jsonArray.isEmpty())) {
throw new Exception("Null value of filterCondJsonSet, please set the value first!");
}
- Set<String> bathRecords = new HashSet<String>();
- List<BdbGroupFilterCondEntity> modifyFilterCondEntitys = new ArrayList<>();
+ Set<String> batchRecords = new HashSet<String>();
+ List<BdbGroupFilterCondEntity> modifyFilterCondEntities = new ArrayList<>();
for (int j = 0; j < jsonArray.size(); j++) {
Map<String, String> groupObject = jsonArray.get(j);
try {
@@ -395,7 +395,7 @@ public class WebAdminGroupCtrlHandler {
String recordKey = sBuilder.append(groupName)
.append("-").append(topicName).toString();
sBuilder.delete(0, sBuilder.length());
- if (bathRecords.contains(recordKey)) {
+ if (batchRecords.contains(recordKey)) {
continue;
}
boolean foundChange = false;
@@ -428,8 +428,8 @@ public class WebAdminGroupCtrlHandler {
if (!foundChange) {
continue;
}
- bathRecords.add(recordKey);
- modifyFilterCondEntitys.add(newFilterCondEntity);
+ batchRecords.add(recordKey);
+ modifyFilterCondEntities.add(newFilterCondEntity);
} catch (Exception ee) {
sBuilder.delete(0, sBuilder.length());
throw new Exception(sBuilder.append("Process data exception, data is :")
@@ -438,7 +438,7 @@ public class WebAdminGroupCtrlHandler {
.append(ee.getMessage()).toString());
}
}
- for (BdbGroupFilterCondEntity tmpFilterCondEntity : modifyFilterCondEntitys) {
+ for (BdbGroupFilterCondEntity tmpFilterCondEntity : modifyFilterCondEntities) {
try {
brokerConfManage.confModGroupFilterCondConfig(tmpFilterCondEntity);
} catch (Throwable ee) {
@@ -466,14 +466,14 @@ public class WebAdminGroupCtrlHandler {
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
req.getParameter("confModAuthToken"));
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, false, null, sBuilder);
- Set<String> bathOpGroupNames =
+ Set<String> batchOpGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
false, false, null, sBuilder);
- if (bathOpGroupNames.isEmpty()) {
- for (String tmpTopicName : bathOpTopicNames) {
+ if (batchOpGroupNames.isEmpty()) {
+ for (String tmpTopicName : batchOpTopicNames) {
BdbGroupFilterCondEntity webFilterCondEntity =
new BdbGroupFilterCondEntity();
webFilterCondEntity.setTopicName(tmpTopicName);
@@ -485,8 +485,8 @@ public class WebAdminGroupCtrlHandler {
}
}
} else {
- for (String tmpTopicName : bathOpTopicNames) {
- for (String tmpGroupName : bathOpGroupNames) {
+ for (String tmpTopicName : batchOpTopicNames) {
+ for (String tmpGroupName : batchOpGroupNames) {
BdbGroupFilterCondEntity webFilterCondEntity =
new BdbGroupFilterCondEntity();
webFilterCondEntity.setTopicName(tmpTopicName);
@@ -540,7 +540,7 @@ public class WebAdminGroupCtrlHandler {
WebParameterUtils.validIntDataParameter("reJoinWait",
req.getParameter("reJoinWait"),
false, 0, 0);
- Set<String> bathOpConsumerIds = new HashSet<String>();
+ Set<String> batchOpConsumerIds = new HashSet<String>();
String inputConsumerId = req.getParameter("consumerId");
if (TStringUtils.isNotBlank(inputConsumerId)) {
inputConsumerId = String.valueOf(inputConsumerId).trim();
@@ -563,12 +563,12 @@ public class WebAdminGroupCtrlHandler {
.append("in consumerId parameter must begin with a letter, " +
"can only contain characters,numbers,dot,scores,and underscores").toString());
}
- if (!bathOpConsumerIds.contains(consumerId)) {
- bathOpConsumerIds.add(consumerId);
+ if (!batchOpConsumerIds.contains(consumerId)) {
+ batchOpConsumerIds.add(consumerId);
}
}
}
- if (bathOpConsumerIds.isEmpty()) {
+ if (batchOpConsumerIds.isEmpty()) {
throw new Exception("Null value of required consumerId parameter");
}
ConsumerInfoHolder consumerInfoHolder =
@@ -580,7 +580,7 @@ public class WebAdminGroupCtrlHandler {
.append(groupName).append(") not online! \"}");
} else {
Map<String, NodeRebInfo> nodeRebInfoMap = consumerBandInfo.getRebalanceMap();
- for (String consumerId : bathOpConsumerIds) {
+ for (String consumerId : batchOpConsumerIds) {
if (nodeRebInfoMap.containsKey(consumerId)) {
return sBuilder
.append("{\"result\":false,\"errCode\":400,\"errMsg\":\"Duplicated set for consumerId(")
@@ -590,11 +590,11 @@ public class WebAdminGroupCtrlHandler {
}
logger.info(sBuilder.append("[Re-balance] Add rebalance consumer: group=")
.append(groupName).append(", consumerIds=")
- .append(bathOpConsumerIds.toString())
+ .append(batchOpConsumerIds.toString())
.append(", reJoinWait=").append(reJoinWait)
.append(", creater=").append(modifyUser).toString());
sBuilder.delete(0, sBuilder.length());
- consumerInfoHolder.addRebConsumerInfo(groupName, bathOpConsumerIds, reJoinWait);
+ consumerInfoHolder.addRebConsumerInfo(groupName, batchOpConsumerIds, reJoinWait);
sBuilder.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"OK\"}");
}
} catch (Exception e) {
@@ -715,13 +715,13 @@ public class WebAdminGroupCtrlHandler {
false, new Date());
Set<String> configuredTopicSet =
brokerConfManage.getTotalConfiguredTopicNames();
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, true, configuredTopicSet, sBuilder);
- Set<String> bathOpGroupNames =
+ Set<String> batchOpGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, false, null, sBuilder);
- for (String tmpTopicName : bathOpTopicNames) {
+ for (String tmpTopicName : batchOpTopicNames) {
BdbTopicAuthControlEntity topicAuthControlEntity =
brokerConfManage.getBdbEnableAuthControlByTopicName(tmpTopicName);
if (topicAuthControlEntity == null) {
@@ -733,7 +733,7 @@ public class WebAdminGroupCtrlHandler {
//
}
}
- for (String tmpGroupName : bathOpGroupNames) {
+ for (String tmpGroupName : batchOpGroupNames) {
BdbConsumerGroupEntity webConsumerGroupEntity =
new BdbConsumerGroupEntity(tmpTopicName,
tmpGroupName, createUser, createDate);
@@ -756,7 +756,7 @@ public class WebAdminGroupCtrlHandler {
* @return
* @throws Exception
*/
- public StringBuilder adminBathAddConsumerGroupInfo(HttpServletRequest req) throws Exception {
+ public StringBuilder adminBatchAddConsumerGroupInfo(HttpServletRequest req) throws Exception {
StringBuilder sBuilder = new StringBuilder(512);
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
@@ -920,14 +920,14 @@ public class WebAdminGroupCtrlHandler {
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
req.getParameter("confModAuthToken"));
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, false, null, sBuilder);
- Set<String> bathOpGroupNames =
+ Set<String> batchOpGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
false, false, null, sBuilder);
- if (bathOpGroupNames.isEmpty()) {
- for (String tmpTopicName : bathOpTopicNames) {
+ if (batchOpGroupNames.isEmpty()) {
+ for (String tmpTopicName : batchOpTopicNames) {
BdbGroupFilterCondEntity webFilterCondEntity =
new BdbGroupFilterCondEntity();
webFilterCondEntity.setTopicName(tmpTopicName);
@@ -943,8 +943,8 @@ public class WebAdminGroupCtrlHandler {
brokerConfManage.confDelBdbAllowedConsumerGroupSet(webConsumerGroupEntity);
}
} else {
- for (String tmpTopicName : bathOpTopicNames) {
- for (String tmpGroupName : bathOpGroupNames) {
+ for (String tmpTopicName : batchOpTopicNames) {
+ for (String tmpGroupName : batchOpGroupNames) {
BdbGroupFilterCondEntity webFilterCondEntity =
new BdbGroupFilterCondEntity();
webFilterCondEntity.setTopicName(tmpTopicName);
@@ -994,14 +994,14 @@ public class WebAdminGroupCtrlHandler {
req.getParameter("createDate"),
TBaseConstants.META_MAX_DATEVALUE_LENGTH,
false, new Date());
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, true, brokerConfManage.getTotalConfiguredTopicNames(), sBuilder);
- Set<String> bathOpGroupNames =
+ Set<String> batchOpGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, false, null, sBuilder);
- for (String tmpGroupName : bathOpGroupNames) {
- for (String tmpTopicName : bathOpTopicNames) {
+ for (String tmpGroupName : batchOpGroupNames) {
+ for (String tmpTopicName : batchOpTopicNames) {
BdbBlackGroupEntity webBlackGroupEntity =
new BdbBlackGroupEntity(tmpTopicName,
tmpGroupName, createUser, createDate);
@@ -1024,7 +1024,7 @@ public class WebAdminGroupCtrlHandler {
* @return
* @throws Exception
*/
- public StringBuilder adminBathAddBlackGroupInfo(HttpServletRequest req) throws Exception {
+ public StringBuilder adminBatchAddBlackGroupInfo(HttpServletRequest req) throws Exception {
StringBuilder sBuilder = new StringBuilder(512);
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
@@ -1175,22 +1175,22 @@ public class WebAdminGroupCtrlHandler {
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
req.getParameter("confModAuthToken"));
- Set<String> bathOpGroupNames =
+ Set<String> batchOpGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, false, null, sBuilder);
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
false, false, null, sBuilder);
- if (bathOpTopicNames.isEmpty()) {
- for (String tmpGroupName : bathOpGroupNames) {
+ if (batchOpTopicNames.isEmpty()) {
+ for (String tmpGroupName : batchOpGroupNames) {
BdbBlackGroupEntity webBlackGroupEntity =
new BdbBlackGroupEntity();
webBlackGroupEntity.setBlackGroupName(tmpGroupName);
brokerConfManage.confDeleteBdbBlackConsumerGroupSet(webBlackGroupEntity);
}
} else {
- for (String tmpGroupName : bathOpGroupNames) {
- for (String tmpTopicName : bathOpTopicNames) {
+ for (String tmpGroupName : batchOpGroupNames) {
+ for (String tmpTopicName : batchOpTopicNames) {
BdbBlackGroupEntity webBlackGroupEntity =
new BdbBlackGroupEntity();
webBlackGroupEntity.setBlackGroupName(tmpGroupName);
@@ -1238,10 +1238,10 @@ public class WebAdminGroupCtrlHandler {
WebParameterUtils.validIntDataParameter("allowedBClientRate",
req.getParameter("allowedBClientRate"),
false, 0, 0);
- Set<String> bathOpGroupNames =
+ Set<String> batchOpGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, false, null, sBuilder);
- for (String tmpGroupName : bathOpGroupNames) {
+ for (String tmpGroupName : batchOpGroupNames) {
BdbConsumeGroupSettingEntity webConsumeGroupSettingEntity =
new BdbConsumeGroupSettingEntity(tmpGroupName,
enableBind, allowedBClientRate, "", createUser, createDate);
@@ -1263,7 +1263,7 @@ public class WebAdminGroupCtrlHandler {
* @return
* @throws Exception
*/
- public StringBuilder adminBathAddConsumeGroupSetting(HttpServletRequest req) throws Exception {
+ public StringBuilder adminBatchAddConsumeGroupSetting(HttpServletRequest req) throws Exception {
StringBuilder sBuilder = new StringBuilder(512);
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
@@ -1441,10 +1441,10 @@ public class WebAdminGroupCtrlHandler {
&& allowedBClientRate == -2) {
throw new Exception("Not require update content in request parameter!");
}
- Set<String> bathOpGroupNames =
+ Set<String> batchOpGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, false, null, sBuilder);
- for (String tmpGroupName : bathOpGroupNames) {
+ for (String tmpGroupName : batchOpGroupNames) {
try {
boolean isChanged = false;
BdbConsumeGroupSettingEntity oldEntity =
@@ -1494,10 +1494,10 @@ public class WebAdminGroupCtrlHandler {
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
req.getParameter("confModAuthToken"));
- Set<String> bathOpGroupNames =
+ Set<String> batchOpGroupNames =
WebParameterUtils.getBatchGroupNames(req.getParameter("groupName"),
true, false, null, sBuilder);
- brokerConfManage.confDeleteBdbConsumeGroupSetting(bathOpGroupNames, sBuilder);
+ brokerConfManage.confDeleteBdbConsumeGroupSetting(batchOpGroupNames, sBuilder);
sBuilder.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"OK\"}");
} catch (Exception e) {
sBuilder.delete(0, sBuilder.length());
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminTopicAuthHandler.java b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminTopicAuthHandler.java
index b9fad07..d4d849d 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminTopicAuthHandler.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebAdminTopicAuthHandler.java
@@ -81,10 +81,10 @@ public class WebAdminTopicAuthHandler {
false, false);
Set<String> configuredTopicSet =
brokerConfManage.getTotalConfiguredTopicNames();
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, true, configuredTopicSet, sBuilder);
- for (String topicName : bathOpTopicNames) {
+ for (String topicName : batchOpTopicNames) {
brokerConfManage.confSetBdbTopicAuthControl(
new BdbTopicAuthControlEntity(topicName,
isEnable, createUser, createDate));
@@ -105,7 +105,7 @@ public class WebAdminTopicAuthHandler {
* @return
* @throws Exception
*/
- public StringBuilder adminBathAddTopicAuthControl(HttpServletRequest req) throws Exception {
+ public StringBuilder adminBatchAddTopicAuthControl(HttpServletRequest req) throws Exception {
StringBuilder sBuilder = new StringBuilder(512);
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
@@ -203,10 +203,10 @@ public class WebAdminTopicAuthHandler {
req.getParameter("createUser"),
TBaseConstants.META_MAX_USERNAME_LENGTH,
true, "");
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, false, null, sBuilder);
- for (String tmpTopicName : bathOpTopicNames) {
+ for (String tmpTopicName : batchOpTopicNames) {
BdbGroupFilterCondEntity webFilterCondEntity =
new BdbGroupFilterCondEntity();
webFilterCondEntity.setTopicName(tmpTopicName);
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebBrokerDefConfHandler.java b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebBrokerDefConfHandler.java
index 6d1d632..2da06bf 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebBrokerDefConfHandler.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebBrokerDefConfHandler.java
@@ -310,7 +310,7 @@ public class WebBrokerDefConfHandler {
* @return
* @throws Exception
*/
- public StringBuilder adminBathAddBrokerDefConfEntityInfo(HttpServletRequest req) throws Exception {
+ public StringBuilder adminBatchAddBrokerDefConfEntityInfo(HttpServletRequest req) throws Exception {
// #lizard forgives
StringBuilder strBuffer = new StringBuilder(512);
try {
@@ -502,7 +502,7 @@ public class WebBrokerDefConfHandler {
req.getParameter("modifyDate"),
TBaseConstants.META_MAX_DATEVALUE_LENGTH,
false, new Date());
- Set<BdbBrokerConfEntity> bathBrokerEntitys =
+ Set<BdbBrokerConfEntity> batchBrokerEntities =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"),
brokerConfManage, true, strBuffer);
int manageStatus = TStatusConstants.STATUS_MANAGE_ONLINE;
@@ -510,7 +510,7 @@ public class WebBrokerDefConfHandler {
master.getBrokerHolder().getBrokerInfoMap();
Set<BdbBrokerConfEntity> newBrokerEntitySet =
new HashSet<BdbBrokerConfEntity>();
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitys) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntities) {
if (oldEntity == null) {
continue;
}
@@ -590,7 +590,7 @@ public class WebBrokerDefConfHandler {
&& (TStringUtils.isBlank(strIsAcceptSubscribe))) {
throw new Exception("Required isAcceptPublish or isAcceptSubscribe parameter");
}
- Set<BdbBrokerConfEntity> bathBrokerEntitySet = WebParameterUtils.getBatchBrokerIdSet(
+ Set<BdbBrokerConfEntity> batchBrokerEntitySet = WebParameterUtils.getBatchBrokerIdSet(
req.getParameter("brokerId"), brokerConfManage, true, strBuffer);
Map<Integer, BrokerInfo> oldBrokerInfoMap =
master.getBrokerHolder().getBrokerInfoMap();
@@ -601,7 +601,7 @@ public class WebBrokerDefConfHandler {
// If yes, check if the current status complies with the change.
// If it complies, record the change.
Set<BdbBrokerConfEntity> newBrokerEntitySet = new HashSet<BdbBrokerConfEntity>();
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitySet) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntitySet) {
if (oldEntity == null) {
continue;
}
@@ -749,11 +749,11 @@ public class WebBrokerDefConfHandler {
req.getParameter("modifyDate"),
TBaseConstants.META_MAX_DATEVALUE_LENGTH,
false, new Date());
- Set<Integer> bathBrokerIds = new HashSet<Integer>();
- Set<BdbBrokerConfEntity> bathBrokerEntitySet = WebParameterUtils.getBatchBrokerIdSet(
+ Set<Integer> batchBrokerIds = new HashSet<Integer>();
+ Set<BdbBrokerConfEntity> batchBrokerEntitySet = WebParameterUtils.getBatchBrokerIdSet(
req.getParameter("brokerId"), brokerConfManage, true, strBuffer);
- for (BdbBrokerConfEntity entity : bathBrokerEntitySet) {
- bathBrokerIds.add(entity.getBrokerId());
+ for (BdbBrokerConfEntity entity : batchBrokerEntitySet) {
+ batchBrokerIds.add(entity.getBrokerId());
}
String relReason =
WebParameterUtils.validStringParameter("relReason",
@@ -761,7 +761,7 @@ public class WebBrokerDefConfHandler {
TBaseConstants.META_MAX_OPREASON_LENGTH,
false, "API call to release auto-forbidden brokers");
BrokerInfoHolder brokerInfoHolder = master.getBrokerHolder();
- brokerInfoHolder.relAutoForbiddenBrokerInfo(bathBrokerIds, relReason);
+ brokerInfoHolder.relAutoForbiddenBrokerInfo(batchBrokerIds, relReason);
strBuffer.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"OK\"}");
} catch (Exception e) {
strBuffer.delete(0, strBuffer.length());
@@ -789,12 +789,12 @@ public class WebBrokerDefConfHandler {
req.getParameter("modifyUser"), TBaseConstants.META_MAX_USERNAME_LENGTH, true, "");
Date modifyDate = WebParameterUtils.validDateParameter("modifyDate",
req.getParameter("modifyDate"), TBaseConstants.META_MAX_DATEVALUE_LENGTH, false, new Date());
- Set<BdbBrokerConfEntity> bathBrokerEntitySet = WebParameterUtils.getBatchBrokerIdSet(
+ Set<BdbBrokerConfEntity> batchBrokerEntitySet = WebParameterUtils.getBatchBrokerIdSet(
req.getParameter("brokerId"), brokerConfManage, true, strBuffer);
Set<BdbBrokerConfEntity> modifyBdbEntitySet = new HashSet<BdbBrokerConfEntity>();
// Check the entities one by one, to see if there are changes.
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitySet) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntitySet) {
if (oldEntity == null) {
continue;
}
@@ -956,10 +956,10 @@ public class WebBrokerDefConfHandler {
req.getParameter("modifyDate"),
TBaseConstants.META_MAX_DATEVALUE_LENGTH,
false, new Date());
- Set<BdbBrokerConfEntity> bathBrokerEntitys =
+ Set<BdbBrokerConfEntity> batchBrokerEntities =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"),
brokerConfManage, true, strBuffer);
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitys) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntities) {
if (oldEntity == null) {
continue;
}
@@ -973,7 +973,7 @@ public class WebBrokerDefConfHandler {
throw new Exception(strBuffer.toString());
}
}
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitys) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntities) {
if (!WebParameterUtils.checkBrokerInOnlineStatus(oldEntity) || WebParameterUtils
.checkBrokerInProcessing(oldEntity.getBrokerId(), brokerConfManage, null)) {
continue;
@@ -1020,12 +1020,12 @@ public class WebBrokerDefConfHandler {
TBaseConstants.META_MAX_DATEVALUE_LENGTH,
false, new Date());
int manageStatus = TStatusConstants.STATUS_MANAGE_OFFLINE;
- Set<BdbBrokerConfEntity> bathBrokerEntitys =
+ Set<BdbBrokerConfEntity> batchBrokerEntities =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"),
brokerConfManage, true, strBuffer);
Set<BdbBrokerConfEntity> newBrokerEntitys =
new HashSet<BdbBrokerConfEntity>();
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitys) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntities) {
if (oldEntity == null) {
continue;
}
@@ -1106,10 +1106,10 @@ public class WebBrokerDefConfHandler {
WebParameterUtils.validBooleanDataParameter("isReservedData",
req.getParameter("isReservedData"),
false, false);
- Set<BdbBrokerConfEntity> bathBrokerEntitys =
+ Set<BdbBrokerConfEntity> batchBrokerEntities =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"),
brokerConfManage, true, strBuffer);
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitys) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntities) {
if (oldEntity == null) {
continue;
}
@@ -1148,7 +1148,7 @@ public class WebBrokerDefConfHandler {
throw new Exception(strBuffer.toString());
}
}
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitys) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntities) {
if (oldEntity == null
|| WebParameterUtils.checkBrokerInOnlineStatus(oldEntity)
|| WebParameterUtils.checkBrokerInOfflining(oldEntity.getBrokerId(),
@@ -1215,9 +1215,9 @@ public class WebBrokerDefConfHandler {
boolean withDetail =
WebParameterUtils.validBooleanDataParameter("withDetail",
req.getParameter("withDetail"), false, false);
- Set<String> bathBrokerIps =
+ Set<String> batchBrokerIps =
WebParameterUtils.getBatchBrokerIpSet(req.getParameter("brokerIp"), false);
- Set<Integer> bathBrokerIds =
+ Set<Integer> batchBrokerIds =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"), false);
boolean onlyAbnormal =
WebParameterUtils.validBooleanDataParameter("onlyAbnormal",
@@ -1238,8 +1238,8 @@ public class WebBrokerDefConfHandler {
brokerInfoHolder.getAutoForbiddenBrokerMapInfo();
strBuffer.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"OK\",\"data\":[");
for (BdbBrokerConfEntity entity : brokerConfEntityList) {
- if (((!bathBrokerIds.isEmpty()) && (!bathBrokerIds.contains(entity.getBrokerId())))
- || ((!bathBrokerIps.isEmpty()) && (!bathBrokerIps.contains(entity.getBrokerIp())))) {
+ if (((!batchBrokerIds.isEmpty()) && (!batchBrokerIds.contains(entity.getBrokerId())))
+ || ((!batchBrokerIps.isEmpty()) && (!batchBrokerIps.contains(entity.getBrokerIp())))) {
continue;
}
BrokerInfoHolder.BrokerAbnInfo brokerAbnInfo =
@@ -1444,16 +1444,16 @@ public class WebBrokerDefConfHandler {
WebParameterUtils.validIntDataParameter("brokerTLSPort",
req.getParameter("brokerTLSPort"), false, TBaseConstants.META_VALUE_UNDEFINED, 0);
Boolean isInclude = null;
- Set<String> bathTopicNames =
+ Set<String> batchTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"), false, false, null, strBuffer);
- if (!bathTopicNames.isEmpty()) {
+ if (!batchTopicNames.isEmpty()) {
isInclude =
WebParameterUtils.validBooleanDataParameter("isInclude",
req.getParameter("isInclude"), false, true);
}
- Set<Integer> bathBrokerIds = WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"), false);
- if (bathBrokerIds.size() == 1) {
- for (Integer brokerId : bathBrokerIds) {
+ Set<Integer> batchBrokerIds = WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"), false);
+ if (batchBrokerIds.size() == 1) {
+ for (Integer brokerId : batchBrokerIds) {
brokerConfEntity.setBrokerId(brokerId);
}
}
@@ -1469,7 +1469,7 @@ public class WebBrokerDefConfHandler {
int recordMemCacheMsgSizeInMB = entity.getDftMemCacheMsgSizeInMB();
int recordMemCacheFlushIntvl = entity.getDftMemCacheFlushIntvl();
int recordTLSPort = entity.getBrokerTLSPort();
- if (((!bathBrokerIds.isEmpty()) && (!bathBrokerIds.contains(entity.getBrokerId())))
+ if (((!batchBrokerIds.isEmpty()) && (!batchBrokerIds.contains(entity.getBrokerId())))
|| ((numTopicStores >= 0) && (numTopicStores != recordNumTopicStores))
|| ((memCacheMsgCntInK >= 0) && (memCacheMsgCntInK != recordMemCacheMsgCntInK))
|| ((memCacheMsgSizeInMB >= 0) && (memCacheMsgSizeInMB != recordMemCacheMsgSizeInMB))
@@ -1479,7 +1479,7 @@ public class WebBrokerDefConfHandler {
}
ConcurrentHashMap<String, BdbTopicConfEntity> bdbTopicConfEntityMap =
brokerConfManage.getBrokerTopicConfEntitySet(entity.getBrokerId());
- if (!isValidRecord(bathTopicNames, topicStatusId, isInclude, bdbTopicConfEntityMap)) {
+ if (!isValidRecord(batchTopicNames, topicStatusId, isInclude, bdbTopicConfEntityMap)) {
continue;
}
if (count++ > 0) {
@@ -1526,16 +1526,16 @@ public class WebBrokerDefConfHandler {
/**
* Check if the record is valid
*
- * @param bathTopicNames
+ * @param batchTopicNames
* @param topicStatusId
* @param isInclude
* @param bdbTopicConfEntityMap
* @return
*/
- private boolean isValidRecord(final Set<String> bathTopicNames, int topicStatusId, Boolean isInclude,
+ private boolean isValidRecord(final Set<String> batchTopicNames, int topicStatusId, Boolean isInclude,
ConcurrentHashMap<String, BdbTopicConfEntity> bdbTopicConfEntityMap) {
// 首先检查指定了topic并且要求进行topic区分,并且broker有topic记录时,按照业务指定的topic区分要求进行过滤
- if (!bathTopicNames.isEmpty() && isInclude != null) {
+ if (!batchTopicNames.isEmpty() && isInclude != null) {
if ((bdbTopicConfEntityMap == null) || (bdbTopicConfEntityMap.isEmpty())) {
if (isInclude) {
return false;
@@ -1544,7 +1544,7 @@ public class WebBrokerDefConfHandler {
boolean filterInclude = false;
Set<String> curTopics = bdbTopicConfEntityMap.keySet();
if (isInclude) {
- for (String inTopic : bathTopicNames) {
+ for (String inTopic : batchTopicNames) {
if (curTopics.contains(inTopic)) {
filterInclude = true;
break;
@@ -1552,7 +1552,7 @@ public class WebBrokerDefConfHandler {
}
} else {
filterInclude = true;
- for (String inTopic : bathTopicNames) {
+ for (String inTopic : batchTopicNames) {
if (curTopics.contains(inTopic)) {
filterInclude = false;
break;
diff --git a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebBrokerTopicConfHandler.java b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebBrokerTopicConfHandler.java
index d681bca..27e3111 100644
--- a/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebBrokerTopicConfHandler.java
+++ b/tubemq-server/src/main/java/org/apache/tubemq/server/master/web/handler/WebBrokerTopicConfHandler.java
@@ -90,27 +90,27 @@ public class WebBrokerTopicConfHandler {
WebParameterUtils.validDateParameter("modifyDate", req.getParameter("modifyDate"),
TBaseConstants.META_MAX_DATEVALUE_LENGTH, false, createDate);
// topic names
- Set<String> bathAddTopicNames =
+ Set<String> batchAddTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, false, null, strBuffer);
// broker IDs
- Set<BdbBrokerConfEntity> bathBrokerEntitySet =
+ Set<BdbBrokerConfEntity> batchBrokerEntitySet =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"), brokerConfManage, true,
strBuffer);
- List<BdbTopicConfEntity> bathAddBdbTopicEntitys = new ArrayList<BdbTopicConfEntity>();
- List<BdbTopicAuthControlEntity> bathAddBdbTopicAuthControls = new ArrayList<BdbTopicAuthControlEntity>();
+ List<BdbTopicConfEntity> batchAddBdbTopicEntities = new ArrayList<BdbTopicConfEntity>();
+ List<BdbTopicAuthControlEntity> batchAddBdbTopicAuthControls = new ArrayList<BdbTopicAuthControlEntity>();
// for each topic
- for (String topicName : bathAddTopicNames) {
+ for (String topicName : batchAddTopicNames) {
BdbTopicAuthControlEntity tmpTopicAuthControl =
brokerConfManage.getBdbEnableAuthControlByTopicName(topicName);
if (tmpTopicAuthControl == null) {
- bathAddBdbTopicAuthControls
+ batchAddBdbTopicAuthControls
.add(new BdbTopicAuthControlEntity(topicName,
false, createUser, createDate));
}
}
// for each broker
- for (BdbBrokerConfEntity oldEntity : bathBrokerEntitySet) {
+ for (BdbBrokerConfEntity oldEntity : batchBrokerEntitySet) {
if (oldEntity == null) {
continue;
}
@@ -120,7 +120,7 @@ public class WebBrokerTopicConfHandler {
ConcurrentHashMap<String, BdbTopicConfEntity> brokerTopicEntityMap =
brokerConfManage.getBrokerTopicConfEntitySet(oldEntity.getBrokerId());
if (brokerTopicEntityMap != null) {
- for (String itemTopicName : bathAddTopicNames) {
+ for (String itemTopicName : batchAddTopicNames) {
BdbTopicConfEntity tmpTopicConfEntity = brokerTopicEntityMap.get(itemTopicName);
if (tmpTopicConfEntity != null) {
if (tmpTopicConfEntity.isValidTopicStatus()) {
@@ -136,7 +136,6 @@ public class WebBrokerTopicConfHandler {
}
}
final int defNumTopicStores = oldEntity.getNumTopicStores();
- final int defunFlushDataHold = oldEntity.getDftUnFlushDataHold(); /* TODO: not used, could remove? */
final int defmemCacheMsgCntInK = oldEntity.getDftMemCacheMsgCntInK();
final int defmemCacheMsgSizeInMB = oldEntity.getDftMemCacheMsgSizeInMB();
final int defmemCacheFlushIntvl = oldEntity.getDftMemCacheFlushIntvl();
@@ -197,15 +196,15 @@ public class WebBrokerTopicConfHandler {
.append(TokenConstants.SEGMENT_SEP).append(TokenConstants.TOKEN_MCACHE_FLUSH_INTVL)
.append(TokenConstants.EQ).append(memCacheFlushIntvl).toString();
strBuffer.delete(0, strBuffer.length());
- for (String itemTopicName : bathAddTopicNames) {
- bathAddBdbTopicEntitys.add(new BdbTopicConfEntity(oldEntity.getBrokerId(),
+ for (String itemTopicName : batchAddTopicNames) {
+ batchAddBdbTopicEntities.add(new BdbTopicConfEntity(oldEntity.getBrokerId(),
oldEntity.getBrokerIp(), oldEntity.getBrokerPort(), itemTopicName,
numPartitions, unflushThreshold, unflushInterval, deleteWhen,
deletePolicy, acceptPublish, acceptSubscribe, numTopicStores,
attributes, createUser, createDate, modifyUser, modifyDate));
}
}
- inAddTopicConfigInfo(bathAddBdbTopicEntitys, bathAddBdbTopicAuthControls);
+ inAddTopicConfigInfo(batchAddBdbTopicEntities, batchAddBdbTopicAuthControls);
strBuffer.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"OK\"}");
} catch (Exception e) {
strBuffer.delete(0, strBuffer.length());
@@ -222,7 +221,7 @@ public class WebBrokerTopicConfHandler {
* @return
* @throws Exception
*/
- public StringBuilder adminBathAddTopicEntityInfo(HttpServletRequest req) throws Exception {
+ public StringBuilder adminBatchAddTopicEntityInfo(HttpServletRequest req) throws Exception {
StringBuilder strBuffer = new StringBuilder(512);
try {
WebParameterUtils.reqAuthorizenCheck(master, brokerConfManage,
@@ -239,10 +238,10 @@ public class WebBrokerTopicConfHandler {
if ((topicJsonArray == null) || (topicJsonArray.isEmpty())) {
throw new Exception("Null value of topicJsonSet, please set the value first!");
}
- Set<String> bathAddTopicNames = new HashSet<String>();
- Set<String> bathAddItemKeys = new HashSet<String>();
- List<BdbTopicAuthControlEntity> bathTopicAuthInfos = new ArrayList<BdbTopicAuthControlEntity>();
- List<BdbTopicConfEntity> bathAddBdbTopicEntitys = new ArrayList<BdbTopicConfEntity>();
+ Set<String> batchAddTopicNames = new HashSet<String>();
+ Set<String> batchAddItemKeys = new HashSet<String>();
+ List<BdbTopicAuthControlEntity> batchTopicAuthInfos = new ArrayList<BdbTopicAuthControlEntity>();
+ List<BdbTopicConfEntity> batchAddBdbTopicEntities = new ArrayList<BdbTopicConfEntity>();
for (int count = 0; count < topicJsonArray.size(); count++) {
Map<String, String> jsonObject = topicJsonArray.get(count);
try {
@@ -261,7 +260,7 @@ public class WebBrokerTopicConfHandler {
TBaseConstants.META_MAX_TOPICNAME_LENGTH, true, "");
String inputKey = strBuffer.append(brokerId).append("-").append(topicName).toString();
strBuffer.delete(0, strBuffer.length());
- if (bathAddItemKeys.contains(inputKey)) {
+ if (batchAddItemKeys.contains(inputKey)) {
continue;
}
if (WebParameterUtils.checkBrokerInProcessing(brokerId, brokerConfManage, strBuffer)) {
@@ -354,22 +353,22 @@ public class WebBrokerTopicConfHandler {
.append(TokenConstants.SEGMENT_SEP).append(TokenConstants.TOKEN_MCACHE_FLUSH_INTVL)
.append(TokenConstants.EQ).append(memCacheFlushIntvl).toString();
strBuffer.delete(0, strBuffer.length());
- bathAddItemKeys.add(inputKey);
- bathAddBdbTopicEntitys.add(new BdbTopicConfEntity(brokerConfEntity.getBrokerId(),
+ batchAddItemKeys.add(inputKey);
+ batchAddBdbTopicEntities.add(new BdbTopicConfEntity(brokerConfEntity.getBrokerId(),
brokerConfEntity.getBrokerIp(), brokerConfEntity.getBrokerPort(),
topicName, numPartitions, unflushThreshold, unflushInterval,
deleteWhen, deletePolicy, acceptPublish, acceptSubscribe,
numTopicStores, attributes, itemCreateUser, itemCreateDate,
itemCreateUser, itemCreateDate));
- if (!bathAddTopicNames.contains(topicName)) {
+ if (!batchAddTopicNames.contains(topicName)) {
BdbTopicAuthControlEntity tmpTopicAuthControl =
brokerConfManage.getBdbEnableAuthControlByTopicName(topicName);
if (tmpTopicAuthControl == null) {
- bathTopicAuthInfos.add(
+ batchTopicAuthInfos.add(
new BdbTopicAuthControlEntity(topicName, false, createUser, createDate));
}
}
- bathAddTopicNames.add(topicName);
+ batchAddTopicNames.add(topicName);
} catch (Exception ee) {
strBuffer.delete(0, strBuffer.length());
throw new Exception(strBuffer.append("Process data exception, data is :")
@@ -377,7 +376,7 @@ public class WebBrokerTopicConfHandler {
.append(ee.getMessage()).toString());
}
}
- inAddTopicConfigInfo(bathAddBdbTopicEntitys, bathTopicAuthInfos);
+ inAddTopicConfigInfo(batchAddBdbTopicEntities, batchTopicAuthInfos);
strBuffer.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"OK\"}");
} catch (Exception e) {
strBuffer.delete(0, strBuffer.length());
@@ -390,15 +389,15 @@ public class WebBrokerTopicConfHandler {
/**
* Private method to add topic config info
*
- * @param bathAddBdbTopicEntitys
- * @param bathTopicAuthInfos
+ * @param batchAddBdbTopicEntities
+ * @param batchTopicAuthInfos
* @throws Exception
*/
- private void inAddTopicConfigInfo(List<BdbTopicConfEntity> bathAddBdbTopicEntitys,
- List<BdbTopicAuthControlEntity> bathTopicAuthInfos) throws Exception {
+ private void inAddTopicConfigInfo(List<BdbTopicConfEntity> batchAddBdbTopicEntities,
+ List<BdbTopicAuthControlEntity> batchTopicAuthInfos) throws Exception {
boolean inserted = false;
try {
- for (BdbTopicConfEntity itemBdbTopicEntity : bathAddBdbTopicEntitys) { // for each topic
+ for (BdbTopicConfEntity itemBdbTopicEntity : batchAddBdbTopicEntities) { // for each topic
BdbBrokerConfEntity brokerConfEntity =
brokerConfManage.getBrokerDefaultConfigStoreInfo(itemBdbTopicEntity.getBrokerId());
// if broker conf is not set, or the broker is busy with processing events,
@@ -408,11 +407,10 @@ public class WebBrokerTopicConfHandler {
null)) {
continue;
}
- // TODO: could move into "if (result)" clause?
- BrokerSyncStatusInfo brokerSyncStatusInfo =
- brokerConfManage.getBrokerRunSyncStatusInfo(itemBdbTopicEntity.getBrokerId());
boolean result = brokerConfManage.confAddTopicConfig(itemBdbTopicEntity);
if (result) { // if it succeeds in adding topic config
+ BrokerSyncStatusInfo brokerSyncStatusInfo =
+ brokerConfManage.getBrokerRunSyncStatusInfo(itemBdbTopicEntity.getBrokerId());
// set Fast start = false
if (brokerSyncStatusInfo != null) {
brokerSyncStatusInfo.setFastStart(false);
@@ -430,7 +428,7 @@ public class WebBrokerTopicConfHandler {
// update topic authorization control
if (inserted) {
for (BdbTopicAuthControlEntity topicAuthControlEntity
- : bathTopicAuthInfos) {
+ : batchTopicAuthInfos) {
BdbTopicAuthControlEntity tmpTopicAuthControl =
brokerConfManage.getBdbEnableAuthControlByTopicName(topicAuthControlEntity.getTopicName());
if (tmpTopicAuthControl == null) {
@@ -440,7 +438,6 @@ public class WebBrokerTopicConfHandler {
}
} catch (Exception ee) {
logger.warn("Fun.inAddTopicConfigInfo throw exception", ee);
- //
}
}
@@ -503,17 +500,17 @@ public class WebBrokerTopicConfHandler {
.setMemCacheFlushIntvl(WebParameterUtils.validIntDataParameter("memCacheFlushIntvl",
req.getParameter("memCacheFlushIntvl"),
false, TBaseConstants.META_VALUE_UNDEFINED, 4000));
- Set<Integer> bathBrokerIds =
+ Set<Integer> batchBrokerIds =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"), false);
- if (bathBrokerIds.size() == 1) {
- for (Integer brokerId : bathBrokerIds) {
+ if (batchBrokerIds.size() == 1) {
+ for (Integer brokerId : batchBrokerIds) {
webTopicEntity.setBrokerId(brokerId);
}
}
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"), false, false, null, strBuffer);
- if (bathOpTopicNames.size() == 1) {
- for (String topicName : bathOpTopicNames) {
+ if (batchOpTopicNames.size() == 1) {
+ for (String topicName : batchOpTopicNames) {
webTopicEntity.setTopicName(topicName);
}
}
@@ -525,7 +522,7 @@ public class WebBrokerTopicConfHandler {
strBuffer.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"OK\",\"data\":[");
int totalCount = 0;
for (Map.Entry<String, List<BdbTopicConfEntity>> entry : queryResultMap.entrySet()) {
- if ((!bathOpTopicNames.isEmpty()) && (!bathOpTopicNames.contains(entry.getKey()))) {
+ if ((!batchOpTopicNames.isEmpty()) && (!batchOpTopicNames.contains(entry.getKey()))) {
continue;
}
if (totalCount++ > 0) {
@@ -540,7 +537,7 @@ public class WebBrokerTopicConfHandler {
strBuffer.append("{\"topicName\":\"").append(entry.getKey()).append("\",\"topicInfo\":[");
int count = 0;
for (BdbTopicConfEntity entity : entry.getValue()) {
- if ((!bathBrokerIds.isEmpty()) && (!bathBrokerIds.contains(entity.getBrokerId()))) {
+ if ((!batchBrokerIds.isEmpty()) && (!batchBrokerIds.contains(entity.getBrokerId()))) {
continue;
}
if (count++ > 0) {
@@ -707,8 +704,7 @@ public class WebBrokerTopicConfHandler {
* @throws Exception
*/
// #lizard forgives
- // TODO: shoud be private?
- public StringBuilder innModifyTopicStatusEntityInfo(HttpServletRequest req,
+ private StringBuilder innModifyTopicStatusEntityInfo(HttpServletRequest req,
int topicStatusId) throws Exception {
StringBuilder strBuffer = new StringBuilder(512);
try {
@@ -720,19 +716,19 @@ public class WebBrokerTopicConfHandler {
WebParameterUtils.validStringParameter("modifyUser",
req.getParameter("modifyUser"),
TBaseConstants.META_MAX_USERNAME_LENGTH, true, "");
- Set<String> bathRmvTopicNames =
+ Set<String> batchRmvTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, false, null, strBuffer);
- Set<BdbBrokerConfEntity> bathInputTopicEntitySet =
+ Set<BdbBrokerConfEntity> batchInputTopicEntitySet =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"),
brokerConfManage, true, strBuffer);
Set<Integer> changedBrokerSet = new HashSet<Integer>();
- Set<BdbTopicConfEntity> bathRmvBdbTopicEntitySet =
+ Set<BdbTopicConfEntity> batchRmvBdbTopicEntitySet =
new HashSet<BdbTopicConfEntity>();
// For the broker to perform, check its status
// and check the config of the topic to see if the action could be performed
- for (BdbBrokerConfEntity brokerConfEntity : bathInputTopicEntitySet) {
+ for (BdbBrokerConfEntity brokerConfEntity : batchInputTopicEntitySet) {
if (brokerConfEntity == null) { // skip brokers whose config is not set
continue;
}
@@ -752,7 +748,7 @@ public class WebBrokerTopicConfHandler {
.append(brokerConfEntity.getBrokerId())
.append(", please confirm the configure first!").toString());
}
- for (String itemTopicName : bathRmvTopicNames) { // for each topic to remove
+ for (String itemTopicName : batchRmvTopicNames) { // for each topic to remove
BdbTopicConfEntity bdbTopicConfEntity =
brokerTopicEntityMap.get(itemTopicName);
if (bdbTopicConfEntity == null) { // topic entity does not exist on the broker
@@ -783,13 +779,13 @@ public class WebBrokerTopicConfHandler {
brokerConfEntity.getBrokerIp(),
brokerConfEntity.getBrokerPort(),
itemTopicName);
- bathRmvBdbTopicEntitySet.add(queryEntity);
+ batchRmvBdbTopicEntitySet.add(queryEntity);
}
}
// Perform the action and check again
try {
- for (BdbTopicConfEntity itemTopicEntity : bathRmvBdbTopicEntitySet) {
+ for (BdbTopicConfEntity itemTopicEntity : batchRmvBdbTopicEntitySet) {
BdbBrokerConfEntity brokerConfEntity =
brokerConfManage.getBrokerDefaultConfigStoreInfo(itemTopicEntity.getBrokerId());
if (brokerConfEntity == null) { // skip those brokers whose config is not set
@@ -865,13 +861,13 @@ public class WebBrokerTopicConfHandler {
String modifyUser =
WebParameterUtils.validStringParameter("modifyUser", req.getParameter("modifyUser"),
TBaseConstants.META_MAX_USERNAME_LENGTH, true, "");
- Set<String> bathRmvTopicNames =
+ Set<String> batchRmvTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"), true, false, null, strBuffer);
- Set<BdbBrokerConfEntity> bathBrokerEntitySet =
+ Set<BdbBrokerConfEntity> batchBrokerEntitySet =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"), brokerConfManage, true,
strBuffer);
- List<BdbTopicConfEntity> bathRmvBdbTopicEntitys = new ArrayList<BdbTopicConfEntity>();
- for (BdbBrokerConfEntity brokerConfEntity : bathBrokerEntitySet) {
+ List<BdbTopicConfEntity> batchRmvBdbTopicEntities = new ArrayList<BdbTopicConfEntity>();
+ for (BdbBrokerConfEntity brokerConfEntity : batchBrokerEntitySet) {
if (brokerConfEntity == null) {
continue;
}
@@ -889,7 +885,7 @@ public class WebBrokerTopicConfHandler {
.append(brokerConfEntity.getBrokerId())
.append(", please confirm the configure first!").toString());
}
- for (String itemTopicName : bathRmvTopicNames) {
+ for (String itemTopicName : batchRmvTopicNames) {
BdbTopicConfEntity bdbTopicConfEntity = brokerTopicEntityMap.get(itemTopicName);
if (bdbTopicConfEntity == null) {
throw new Exception(strBuffer.append("Not found the topic ").append(itemTopicName)
@@ -913,12 +909,12 @@ public class WebBrokerTopicConfHandler {
BdbTopicConfEntity queryEntity = new BdbTopicConfEntity();
queryEntity.setBrokerAndTopicInfo(brokerConfEntity.getBrokerId(),
brokerConfEntity.getBrokerIp(), brokerConfEntity.getBrokerPort(), itemTopicName);
- bathRmvBdbTopicEntitys.add(queryEntity);
+ batchRmvBdbTopicEntities.add(queryEntity);
}
}
try {
Set<Integer> changedBrokerSet = new HashSet<Integer>();
- for (BdbTopicConfEntity itemTopicEntity : bathRmvBdbTopicEntitys) {
+ for (BdbTopicConfEntity itemTopicEntity : batchRmvBdbTopicEntities) {
BdbBrokerConfEntity brokerConfEntity =
brokerConfManage.getBrokerDefaultConfigStoreInfo(itemTopicEntity.getBrokerId());
if (brokerConfEntity == null) {
@@ -1029,13 +1025,13 @@ public class WebBrokerTopicConfHandler {
BdbTopicConfEntity webTopicEntity = new BdbTopicConfEntity();
try {
boolean hasCond = false;
- Set<String> bathOpTopicNames =
+ Set<String> batchOpTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
false, false, null, strBuffer);
- if (!bathOpTopicNames.isEmpty()) {
+ if (!batchOpTopicNames.isEmpty()) {
hasCond = true;
- if (bathOpTopicNames.size() == 1) {
- for (String topicName : bathOpTopicNames) {
+ if (batchOpTopicNames.size() == 1) {
+ for (String topicName : batchOpTopicNames) {
webTopicEntity.setTopicName(topicName);
}
}
@@ -1180,10 +1176,10 @@ public class WebBrokerTopicConfHandler {
Date modifyDate =
WebParameterUtils.validDateParameter("modifyDate", req.getParameter("modifyDate"),
TBaseConstants.META_MAX_DATEVALUE_LENGTH, false, new Date());
- Set<String> bathModTopicNames =
+ Set<String> batchModTopicNames =
WebParameterUtils.getBatchTopicNames(req.getParameter("topicName"),
true, false, null, strBuffer);
- Set<BdbBrokerConfEntity> bathBrokerEntitySet =
+ Set<BdbBrokerConfEntity> batchBrokerEntitySet =
WebParameterUtils.getBatchBrokerIdSet(req.getParameter("brokerId"),
brokerConfManage, true, strBuffer);
String deleteWhen =
@@ -1215,8 +1211,8 @@ public class WebBrokerTopicConfHandler {
WebParameterUtils.validIntDataParameter("memCacheFlushIntvl",
req.getParameter("memCacheFlushIntvl"), false, TBaseConstants.META_VALUE_UNDEFINED, 4000);
int unFlushDataHold = unflushThreshold;
- List<BdbTopicConfEntity> bathModBdbTopicEntitys = new ArrayList<BdbTopicConfEntity>();
- for (BdbBrokerConfEntity tgtEntity : bathBrokerEntitySet) {
+ List<BdbTopicConfEntity> batchModBdbTopicEntities = new ArrayList<BdbTopicConfEntity>();
+ for (BdbBrokerConfEntity tgtEntity : batchBrokerEntitySet) {
if (tgtEntity == null) {
continue;
}
@@ -1230,7 +1226,7 @@ public class WebBrokerTopicConfHandler {
.append(tgtEntity.getBrokerId()).append(", please confirm the configure first!")
.toString());
}
- for (String itemTopicName : bathModTopicNames) {
+ for (String itemTopicName : batchModTopicNames) {
BdbTopicConfEntity oldEntity = brokerTopicEntityMap.get(itemTopicName);
if (oldEntity == null) {
throw new Exception(strBuffer.append("Not found the topic ")
@@ -1337,14 +1333,14 @@ public class WebBrokerTopicConfHandler {
if (!foundChange) {
continue;
}
- bathModBdbTopicEntitys.add(newEntity);
+ batchModBdbTopicEntities.add(newEntity);
}
}
- if (bathModBdbTopicEntitys.isEmpty()) {
+ if (batchModBdbTopicEntities.isEmpty()) {
throw new Exception("Not found data changed, please confirm the topic configure!");
}
try {
- for (BdbTopicConfEntity itemTopicEntity : bathModBdbTopicEntitys) {
+ for (BdbTopicConfEntity itemTopicEntity : batchModBdbTopicEntities) {
BdbBrokerConfEntity brokerConfEntity =
brokerConfManage.getBrokerDefaultConfigStoreInfo(itemTopicEntity.getBrokerId());
if (brokerConfEntity == null) {