Skip to content

Commit

Permalink
[ISSUE apache#6292] fix typos (apache#6293)
Browse files Browse the repository at this point in the history
* fix typos

* fix typos

* fix typos
  • Loading branch information
hardyfish authored and miles-ton committed Mar 16, 2023
1 parent ed40c28 commit 3acae8a
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public interface AccessValidator {
*
* @return
*/
boolean deleteAccessConfig(String accesskey);
boolean deleteAccessConfig(String accessKey);

/**
* Get the access resource config version information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public boolean updateAccessConfig(PlainAccessConfig plainAccessConfig) {
}

@Override
public boolean deleteAccessConfig(String accesskey) {
return aclPlugEngine.deleteAccessConfig(accesskey);
public boolean deleteAccessConfig(String accessKey) {
return aclPlugEngine.deleteAccessConfig(accessKey);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,27 +439,27 @@ public Map<String, Object> createAclAccessConfigMap(Map<String, Object> existedA
return newAccountsMap;
}

public boolean deleteAccessConfig(String accesskey) {
if (StringUtils.isEmpty(accesskey)) {
log.error("Parameter value accesskey is null or empty String,Please check your parameter");
public boolean deleteAccessConfig(String accessKey) {
if (StringUtils.isEmpty(accessKey)) {
log.error("Parameter value accessKey is null or empty String,Please check your parameter");
return false;
}

if (accessKeyTable.containsKey(accesskey)) {
String aclFileName = accessKeyTable.get(accesskey);
if (accessKeyTable.containsKey(accessKey)) {
String aclFileName = accessKeyTable.get(accessKey);
Map<String, Object> aclAccessConfigMap = AclUtils.getYamlDataObject(aclFileName,
Map.class);
if (aclAccessConfigMap == null || aclAccessConfigMap.isEmpty()) {
log.warn("No data found in {} when deleting access config of {}", aclFileName, accesskey);
log.warn("No data found in {} when deleting access config of {}", aclFileName, accessKey);
return true;
}
List<Map<String, Object>> accounts = (List<Map<String, Object>>) aclAccessConfigMap.get("accounts");
Iterator<Map<String, Object>> itemIterator = accounts.iterator();
while (itemIterator.hasNext()) {
if (itemIterator.next().get(AclConstants.CONFIG_ACCESS_KEY).equals(accesskey)) {
if (itemIterator.next().get(AclConstants.CONFIG_ACCESS_KEY).equals(accessKey)) {
// Delete the related acl config element
itemIterator.remove();
accessKeyTable.remove(accesskey);
accessKeyTable.remove(accessKey);
aclAccessConfigMap.put(AclConstants.CONFIG_ACCOUNTS, accounts);
return AclUtils.writeDataObject(aclFileName, updateAclConfigFileVersion(aclFileName, aclAccessConfigMap));
}
Expand Down Expand Up @@ -618,7 +618,7 @@ public void validate(PlainAccessResource plainAccessResource) {
throw new AclException(String.format("No acl config for %s", plainAccessResource.getAccessKey()));
}

// Check the white addr for accesskey
// Check the white addr for accessKey
String aclFileName = accessKeyTable.get(plainAccessResource.getAccessKey());
PlainAccessResource ownedAccess = aclPlainAccessResourceMap.get(aclFileName).get(plainAccessResource.getAccessKey());
if (null == ownedAccess) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,14 @@ private synchronized RemotingCommand updateAndCreateAccessConfig(ChannelHandlerC
response.setRemark(null);
NettyRemotingAbstract.writeResponse(ctx.channel(), request, response);
} else {
String errorMsg = "The accesskey[" + requestHeader.getAccessKey() + "] corresponding to accessConfig has been updated failed.";
String errorMsg = "The accessKey[" + requestHeader.getAccessKey() + "] corresponding to accessConfig has been updated failed.";
LOGGER.warn(errorMsg);
response.setCode(ResponseCode.UPDATE_AND_CREATE_ACL_CONFIG_FAILED);
response.setRemark(errorMsg);
return response;
}
} catch (Exception e) {
LOGGER.error("Failed to generate a proper update accessvalidator response", e);
LOGGER.error("Failed to generate a proper update accessValidator response", e);
response.setCode(ResponseCode.UPDATE_AND_CREATE_ACL_CONFIG_FAILED);
response.setRemark(e.getMessage());
return response;
Expand All @@ -592,15 +592,15 @@ private synchronized RemotingCommand deleteAccessConfig(ChannelHandlerContext ct
response.setRemark(null);
NettyRemotingAbstract.writeResponse(ctx.channel(), request, response);
} else {
String errorMsg = "The accesskey[" + requestHeader.getAccessKey() + "] corresponding to accessConfig has been deleted failed.";
String errorMsg = "The accessKey[" + requestHeader.getAccessKey() + "] corresponding to accessConfig has been deleted failed.";
LOGGER.warn(errorMsg);
response.setCode(ResponseCode.DELETE_ACL_CONFIG_FAILED);
response.setRemark(errorMsg);
return response;
}

} catch (Exception e) {
LOGGER.error("Failed to generate a proper delete accessvalidator response", e);
LOGGER.error("Failed to generate a proper delete accessValidator response", e);
response.setCode(ResponseCode.DELETE_ACL_CONFIG_FAILED);
response.setRemark(e.getMessage());
return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public boolean parseDelayLevel() {
return true;
}

private MessageExtBrokerInner messageTimeup(MessageExt msgExt) {
private MessageExtBrokerInner messageTimeUp(MessageExt msgExt) {
MessageExtBrokerInner msgInner = new MessageExtBrokerInner();
msgInner.setBody(msgExt.getBody());
msgInner.setFlag(msgExt.getFlag());
Expand Down Expand Up @@ -381,7 +381,7 @@ public void run() {
}
} catch (Exception e) {
// XXX: warn and notify me
log.error("ScheduleMessageService, executeOnTimeup exception", e);
log.error("ScheduleMessageService, executeOnTimeUp exception", e);
this.scheduleNextTimerTask(this.offset, DELAY_FOR_A_PERIOD);
}
}
Expand Down Expand Up @@ -460,7 +460,7 @@ public void executeOnTimeUp() {
continue;
}

MessageExtBrokerInner msgInner = ScheduleMessageService.this.messageTimeup(msgExt);
MessageExtBrokerInner msgInner = ScheduleMessageService.this.messageTimeUp(msgExt);
if (TopicValidator.RMQ_SYS_TRANS_HALF_TOPIC.equals(msgInner.getTopic())) {
log.error("[BUG] the real topic of schedule msg is {}, discard the msg. msg={}",
msgInner.getTopic(), msgInner);
Expand All @@ -480,7 +480,7 @@ public void executeOnTimeUp() {
}
}
} catch (Exception e) {
log.error("ScheduleMessageService, messageTimeup execute error, offset = {}", nextOffset, e);
log.error("ScheduleMessageService, messageTimeUp execute error, offset = {}", nextOffset, e);
} finally {
bufferCQ.release();
}
Expand Down Expand Up @@ -780,7 +780,7 @@ public void doResend() {
return;
}

MessageExtBrokerInner msgInner = ScheduleMessageService.this.messageTimeup(msgExt);
MessageExtBrokerInner msgInner = ScheduleMessageService.this.messageTimeUp(msgExt);
PutMessageResult result = ScheduleMessageService.this.brokerController.getEscapeBridge().putMessage(msgInner);
this.handleResult(result);
if (result != null && result.getPutMessageStatus() == PutMessageStatus.PUT_OK) {
Expand Down
8 changes: 4 additions & 4 deletions client/src/main/java/org/apache/rocketmq/client/MQAdmin.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
*/
public interface MQAdmin {
/**
* Creates an topic
* @param key accesskey
* Creates a topic
* @param key accessKey
* @param newTopic topic name
* @param queueNum topic's queue number
* @param attributes
Expand All @@ -39,8 +39,8 @@ void createTopic(final String key, final String newTopic, final int queueNum, Ma
throws MQClientException;

/**
* Creates an topic
* @param key accesskey
* Creates a topic
* @param key accessKey
* @param newTopic topic name
* @param queueNum topic's queue number
* @param topicSysFlag topic system flag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ public TransactionSendResult sendMessageInTransaction(Message msg,
/**
* This method will be removed in a certain version after April 5, 2020, so please do not use this method.
*
* @param key accesskey
* @param key accessKey
* @param newTopic topic name
* @param queueNum topic's queue number
* @param attributes
Expand All @@ -785,7 +785,7 @@ public void createTopic(String key, String newTopic, int queueNum, Map<String, S
* Create a topic on broker. This method will be removed in a certain version after April 5, 2020, so please do not
* use this method.
*
* @param key accesskey
* @param key accessKey
* @param newTopic topic name
* @param queueNum topic's queue number
* @param topicSysFlag topic system flag
Expand Down
4 changes: 2 additions & 2 deletions docs/cn/acl/RocketMQ_Multiple_ACL_Files_设计.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ ACL配置文件的数量aclFilesNum、所有ACL配置文件绝对路径fileList
再根据该路径更新aclPlainAccessResourceMap中缓存的数据,最后将该ACL配置文件中的数据写回原文件;如果不包含则会将数据写到"rocketmq.acl.plain.file"配置文件中,
然后更新accessKeyTable和aclPlainAccessResourceMap,最后最后将该ACL配置文件中的数据写回原文件。

(3)deleteAccessConfig(String accesskey)
(3)deleteAccessConfig(String accessKey)

将该方法原有的逻辑修改为:判断accessKeyTable中是否存在accesskey,如果不存在则返回false,否则将其删除并将修改后的数据写回原文件。
将该方法原有的逻辑修改为:判断accessKeyTable中是否存在accessKey,如果不存在则返回false,否则将其删除并将修改后的数据写回原文件。

(4)getAllAclConfig()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ public class TimerMessageStore {
public static final String TIMER_ENQUEUE_MS = MessageConst.PROPERTY_TIMER_ENQUEUE_MS;
public static final String TIMER_DEQUEUE_MS = MessageConst.PROPERTY_TIMER_DEQUEUE_MS;
public static final String TIMER_ROLL_TIMES = MessageConst.PROPERTY_TIMER_ROLL_TIMES;
public static final String TIMER_DELETE_UNIQKEY = MessageConst.PROPERTY_TIMER_DEL_UNIQKEY;
public static final String TIMER_DELETE_UNIQUE_KEY = MessageConst.PROPERTY_TIMER_DEL_UNIQKEY;
public static final Random RANDOM = new Random();
public static final int PUT_OK = 0, PUT_NEED_RETRY = 1, PUT_NO_RETRY = 2;
public static final int DAY_SECS = 24 * 3600;
// The total days in the timer wheel when precision is 1000ms.
// If the broker shutdown last more than the configured days, will cause message loss
public static final int TIMER_WHELL_TTL_DAY = 7;
public static final int TIMER_WHEEL_TTL_DAY = 7;
public static final int TIMER_BLANK_SLOTS = 60;
public static final int MAGIC_DEFAULT = 1;
public static final int MAGIC_ROLL = 1 << 1;
Expand Down Expand Up @@ -152,7 +152,7 @@ public TimerMessageStore(final MessageStore messageStore, final MessageStoreConf
this.timerLogFileSize = storeConfig.getMappedFileSizeTimerLog();
this.precisionMs = storeConfig.getTimerPrecisionMs();
// TimerWheel contains the fixed number of slots regardless of precision.
this.slotsTotal = TIMER_WHELL_TTL_DAY * DAY_SECS;
this.slotsTotal = TIMER_WHEEL_TTL_DAY * DAY_SECS;
this.timerWheel = new TimerWheel(getTimerWheelPath(storeConfig.getStorePathRootDir()),
this.slotsTotal, precisionMs);
this.timerLog = new TimerLog(getTimerLogPath(storeConfig.getStorePathRootDir()), timerLogFileSize);
Expand Down Expand Up @@ -274,8 +274,8 @@ public void recover() {
if (currReadTimeMs < nextReadTimeMs) {
currReadTimeMs = nextReadTimeMs;
}
//the timer wheel may contain physical offset bigger than timerlog
//This will only happen when the timerlog is damaged
//the timer wheel may contain physical offset bigger than timerLog
//This will only happen when the timerLog is damaged
//hard to test
long minFirst = timerWheel.checkPhyPos(currReadTimeMs, processOffset);
if (debug) {
Expand Down Expand Up @@ -353,10 +353,10 @@ public long reviseQueueOffset(long processOffset) {
}
}

//recover timerlog and revise timerwheel
//recover timerLog and revise timerWheel
//return process offset
private long recoverAndRevise(long beginOffset, boolean checkTimerLog) {
LOGGER.info("Begin to recover timerlog offset:{} check:{}", beginOffset, checkTimerLog);
LOGGER.info("Begin to recover timerLog offset:{} check:{}", beginOffset, checkTimerLog);
MappedFile lastFile = timerLog.getMappedFileQueue().getLastMappedFile();
if (null == lastFile) {
return 0;
Expand Down Expand Up @@ -398,7 +398,7 @@ private long recoverAndRevise(long beginOffset, boolean checkTimerLog) {
timerWheel.reviseSlot(delayTime, TimerWheel.IGNORE, sbr.getStartOffset() + position, true);
}
} catch (Exception e) {
LOGGER.error("Recover timerlog error", e);
LOGGER.error("Recover timerLog error", e);
stopCheck = true;
break;
}
Expand Down Expand Up @@ -445,7 +445,7 @@ public void start() {
int checkOffset = timerLog.getOffsetForLastUnit();
timerLog.getMappedFileQueue().deleteExpiredFileByOffsetForTimerLog(minPy, checkOffset, TimerLog.UNIT_SIZE);
} catch (Exception e) {
LOGGER.error("Error in cleaning timerlog", e);
LOGGER.error("Error in cleaning timerLog", e);
}
}
}, 30, 30, TimeUnit.SECONDS);
Expand All @@ -470,7 +470,7 @@ public void start() {
}
}
} catch (Exception e) {
LOGGER.error("Error in cleaning timerlog", e);
LOGGER.error("Error in cleaning timerLog", e);
}
}
}, 45, 45, TimeUnit.MINUTES);
Expand Down Expand Up @@ -692,7 +692,7 @@ public boolean doEnqueue(long offsetPy, int sizePy, long delayedTime, MessageExt
delayedTime = tmpWriteTimeMs + timerRollWindowSlots * precisionMs;
}
}
boolean isDelete = messageExt.getProperty(TIMER_DELETE_UNIQKEY) != null;
boolean isDelete = messageExt.getProperty(TIMER_DELETE_UNIQUE_KEY) != null;
if (isDelete) {
magic = magic | MAGIC_DELETE;
}
Expand Down Expand Up @@ -909,7 +909,7 @@ public int dequeue() throws Exception {
}
}
if (deleteMsgStack.size() == 0 && normalMsgStack.size() == 0) {
LOGGER.warn("dequeue time:{} but read nothing from timerlog", currReadTimeMs);
LOGGER.warn("dequeue time:{} but read nothing from timerLog", currReadTimeMs);
}
for (SelectMappedBufferResult sbr : sbrs) {
if (null != sbr) {
Expand Down Expand Up @@ -1000,7 +1000,7 @@ private MessageExt getMessageByCommitOffset(long offsetPy, int sizePy) {
msgExt = MessageDecoder.decode(bufferLocal.get(), true, false, false);
}
if (null == msgExt) {
LOGGER.warn("Fail to read msg from commitlog offsetPy:{} sizePy:{}", offsetPy, sizePy);
LOGGER.warn("Fail to read msg from commitLog offsetPy:{} sizePy:{}", offsetPy, sizePy);
} else {
return msgExt;
}
Expand Down Expand Up @@ -1144,14 +1144,14 @@ public void checkAndReviseMetrics() {
//check the hash collision between small ons and big ons
for (Map.Entry<String, TimerMetrics.Metric> bjgEntry : bigOnes.entrySet()) {
if (smallHashs.containsKey(hashTopicForMetrics(bjgEntry.getKey()))) {
Iterator<Map.Entry<String, TimerMetrics.Metric>> smalllIt = smallOnes.entrySet().iterator();
while (smalllIt.hasNext()) {
Map.Entry<String, TimerMetrics.Metric> smallEntry = smalllIt.next();
Iterator<Map.Entry<String, TimerMetrics.Metric>> smallIt = smallOnes.entrySet().iterator();
while (smallIt.hasNext()) {
Map.Entry<String, TimerMetrics.Metric> smallEntry = smallIt.next();
if (hashTopicForMetrics(smallEntry.getKey()) == hashTopicForMetrics(bjgEntry.getKey())) {
LOGGER.warn("[CheckAndReviseMetrics]Metric hash collision between small-big code:{} small topic:{}{} big topic:{}{}", hashTopicForMetrics(smallEntry.getKey()),
smallEntry.getKey(), smallEntry.getValue(),
bjgEntry.getKey(), bjgEntry.getValue());
smalllIt.remove();
smallIt.remove();
}
}
}
Expand Down Expand Up @@ -1494,11 +1494,11 @@ public void run() {
tr.idempotentRelease();
doRes = true;
} else {
String uniqkey = MessageClientIDSetter.getUniqID(msgExt);
if (null == uniqkey) {
LOGGER.warn("No uniqkey for msg:{}", msgExt);
String uniqueKey = MessageClientIDSetter.getUniqID(msgExt);
if (null == uniqueKey) {
LOGGER.warn("No uniqueKey for msg:{}", msgExt);
}
if (null != uniqkey && tr.getDeleteList() != null && tr.getDeleteList().size() > 0 && tr.getDeleteList().contains(uniqkey)) {
if (null != uniqueKey && tr.getDeleteList() != null && tr.getDeleteList().size() > 0 && tr.getDeleteList().contains(uniqueKey)) {
doRes = true;
tr.idempotentRelease();
perfs.getCounter("dequeue_delete").flow(1);
Expand Down
Loading

0 comments on commit 3acae8a

Please sign in to comment.