Skip to content

Commit

Permalink
fix syntax errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxin813 committed Aug 11, 2020
1 parent 1352994 commit 9dd3b16
Show file tree
Hide file tree
Showing 32 changed files with 85 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public JoyQueueCode commitIndex(String topic, short partition, long index) {
TopicMetadata topicMetadata = messagePollerInner.getAndCheckTopicMetadata(topic);

PartitionMetadata partitionMetadata = topicMetadata.getPartition(partition);
Preconditions.checkArgument(partitionMetadata != null, "partition is not exist");
Preconditions.checkArgument(partitionMetadata != null, "partition dose not exist");

return consumerIndexManager.commitIndex(topic, config.getAppFullName(), partition, index, config.getTimeout());
}
Expand Down Expand Up @@ -426,4 +426,4 @@ protected void checkState() {
throw new ConsumerException("consumer is not started", JoyQueueCode.CN_SERVICE_NOT_AVAILABLE.getCode());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,15 @@ public BrokerAssignments buildAllBrokerAssignments(TopicMetadata topicMetadata)
public TopicMetadata getAndCheckTopicMetadata(String topic) {
TopicMetadata topicMetadata = clusterManager.fetchTopicMetadata(getTopicFullName(topic), config.getAppFullName());
if (topicMetadata == null) {
throw new ConsumerException(String.format("topic %s is not exist", topic), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
throw new ConsumerException(String.format("topic %s dose not exist", topic), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
}
if (topicMetadata.getConsumerPolicy() == null) {
throw new ConsumerException(String.format("topic %s consumer %s is not exist", topic, config.getAppFullName()), JoyQueueCode.FW_CONSUMER_NOT_EXISTS.getCode());
throw new ConsumerException(String.format("topic %s consumer %s dose not exist", topic, config.getAppFullName()), JoyQueueCode.FW_CONSUMER_NOT_EXISTS.getCode());
}
return topicMetadata;
}

public String getTopicFullName(String topic) {
return NameServerHelper.getTopicFullName(topic, nameServerConfig);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public JoyQueueCode commitIndex(String topic, short partition, long index) {
TopicMetadata topicMetadata = messagePollerInner.getAndCheckTopicMetadata(topic);

PartitionMetadata partitionMetadata = topicMetadata.getPartition(partition);
Preconditions.checkArgument(partitionMetadata != null, "partition is not exist");
Preconditions.checkArgument(partitionMetadata != null, "partition dose not exist");

return consumerIndexManager.commitIndex(topic, config.getAppFullName(), partition, index, config.getTimeout());
}
Expand Down Expand Up @@ -426,4 +426,4 @@ protected void checkState() {
throw new ConsumerException("consumer is not started", JoyQueueCode.CN_SERVICE_NOT_AVAILABLE.getCode());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ protected MessagePoller createMessagePoller(String topic) {
TopicMetadata topicMetadata = clusterManager.fetchTopicMetadata(topicName.getFullName(), config.getAppFullName());

if (topicMetadata == null) {
throw new ConsumerException(String.format("topic %s is not exist", topic), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
throw new ConsumerException(String.format("topic %s dose not exist", topic), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
}
if (topicMetadata.getConsumerPolicy() == null) {
throw new ConsumerException(String.format("topic %s consumer %s is not exist", topic, config.getAppFullName()), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
throw new ConsumerException(String.format("topic %s consumer %s dose not exist", topic, config.getAppFullName()), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
}

if (config.getThread() == ConsumerConfig.NONE_THREAD) {
Expand Down Expand Up @@ -177,4 +177,4 @@ public synchronized void removeListener(BaseMessageListener messageListener) {
public MessagePoller getMessagePoller() {
return messagePoller;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void checkMessage(ProduceMessage produceMessage, ProducerConfig co
throwCheckException("message body is not empty");
}
if (produceMessage.getPartition() != ProduceMessage.NONE_PARTITION && produceMessage.getPartition() < 0) {
throwCheckException("message body is not exist");
throwCheckException("message body dose not exist");
}
if (StringUtils.isNotBlank(produceMessage.getBody()) && produceMessage.getBody().length() > config.getBodyLengthLimit()) {
throwCheckException(String.format("body is too long, it must less than %s characters", config.getBodyLengthLimit()));
Expand Down Expand Up @@ -92,4 +92,4 @@ public static void checkMessages(List<ProduceMessage> produceMessages, ProducerC
protected static void throwCheckException(String message) {
throw new ProducerException(message, JoyQueueCode.CN_PARAM_ERROR.getCode());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public synchronized void removeTransactionCallback(String topic) {

TxFeedbackScheduler txFeedbackScheduler = txCallback.get(topicFullName);
if (txFeedbackScheduler == null) {
throw new IllegalArgumentException(String.format("%s feedback is not exist", topic));
throw new IllegalArgumentException(String.format("%s feedback dose not exist", topic));
}

if (txFeedbackScheduler.isStarted()) {
Expand All @@ -130,10 +130,10 @@ public synchronized void removeTransactionCallback(String topic) {
protected TopicMetadata checkTopicMetadata(String topic) {
TopicMetadata topicMetadata = clusterManager.fetchTopicMetadata(getTopicFullName(topic), config.getApp());
if (topicMetadata == null) {
throw new ProducerException(String.format("topic %s is not exist", topic), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
throw new ProducerException(String.format("topic %s dose not exist", topic), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
}
if (topicMetadata.getProducerPolicy() == null) {
throw new ProducerException(String.format("topic %s producer %s is not exist", topic, config.getApp()), JoyQueueCode.FW_PRODUCER_NOT_EXISTS.getCode());
throw new ProducerException(String.format("topic %s producer %s dose not exist", topic, config.getApp()), JoyQueueCode.FW_PRODUCER_NOT_EXISTS.getCode());
}
return topicMetadata;
}
Expand All @@ -147,4 +147,4 @@ protected void checkState() {
throw new UnsupportedOperationException("txFeedbackManager is not started");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ protected List<SendResult> handleSendBatchResultData(String topic, String app, S
public TopicMetadata getAndCheckTopicMetadata(String topic) {
TopicMetadata topicMetadata = clusterManager.fetchTopicMetadata(getTopicFullName(topic), config.getApp());
if (topicMetadata == null) {
throw new ProducerException(String.format("topic %s is not exist", topic), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
throw new ProducerException(String.format("topic %s dose not exist", topic), JoyQueueCode.FW_TOPIC_NOT_EXIST.getCode());
}
if (topicMetadata.getProducerPolicy() == null) {
throw new ProducerException(String.format("topic %s producer %s is not exist", topic, nameServerConfig.getApp()), JoyQueueCode.FW_PRODUCER_NOT_EXISTS.getCode());
throw new ProducerException(String.format("topic %s producer %s dose not exist", topic, nameServerConfig.getApp()), JoyQueueCode.FW_PRODUCER_NOT_EXISTS.getCode());
}
return topicMetadata;
}
Expand Down Expand Up @@ -392,4 +392,4 @@ public PartitionMetadata dispatchPartitions(List<ProduceMessage> messages, Topic
public boolean isFailover(List<ProduceMessage> messages) {
return (messages.get(0).getPartition() == ProduceMessage.NONE_PARTITION);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public synchronized void removeTransactionCallback(String topic) {
Preconditions.checkArgument(StringUtils.isNotBlank(topic), "topic can not be null");
TxFeedbackManager txFeedbackManager = txFeedbackManagerMap.get(topic);
if (txFeedbackManager == null) {
throw new IllegalArgumentException(String.format("%s feedback is not exist", topic));
throw new IllegalArgumentException(String.format("%s feedback dose not exist", topic));
}
txFeedbackManager.removeTransactionCallback(topic);
}
Expand Down Expand Up @@ -242,4 +242,4 @@ protected TxFeedbackManager getTxFeedbackManager(TxFeedbackConfig config) {
}
return txFeedbackManager;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public Topic createTopic(Topic topic, List<Broker> select, Identity operator) th
public void removeTopic(String namespace, String topicCode) throws Exception {
Topic topic = topicService.findByCode(namespace, topicCode);
if (topic == null) {
throw new BusinessException("topic is not exist");
throw new BusinessException("topic dose not exist");
}
topicService.delete(topic);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ protected Consumer buildConsumeCache(Consumer consumer) {

protected Consumer getConsumerByTopicAndApp(TopicName topic, String app) {
if (!consumerCache.containsKey(topic.getFullName())) {
logger.warn("topic {} is not exist on this broker", topic.getFullName());
logger.warn("topic {} dose not exist on this broker", topic.getFullName());
return null;
}
CacheConsumer consumer = consumerCache.get(topic.getFullName()).get(app);
Expand All @@ -1110,7 +1110,7 @@ protected Consumer getConsumerByTopicAndApp(TopicName topic, String app) {

protected Producer getProducerByTopicAndApp(TopicName topic, String app) {
if (!producerCache.containsKey(topic.getFullName())) {
logger.warn("topic {} is not exist on this broker", topic.getFullName());
logger.warn("topic {} dose not exist on this broker", topic.getFullName());
return null;
}
CacheProducer producer = producerCache.get(topic.getFullName()).get(app);
Expand Down Expand Up @@ -1512,4 +1512,4 @@ protected void doStop() {
}
logger.info("clusterManager is stopped");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public Command handle(Transport transport, Command command) {
Connection connection = SessionHelper.getConnection(transport);

if (connection == null || !connection.isAuthorized(addConsumerRequest.getApp())) {
logger.warn("connection is not exists, transport: {}", transport);
logger.warn("connection dose not exist, transport: {}", transport);
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -110,4 +110,4 @@ protected String generateConsumerId(Connection connection, String topic, String
public int type() {
return JoyQueueCommandType.ADD_CONSUMER_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public Command handle(Transport transport, Command command) {
Connection connection = SessionHelper.getConnection(transport);

if (connection == null || !connection.isAuthorized(addProducerRequest.getApp())) {
logger.warn("connection is not exists, transport: {}, app: {}", transport, addProducerRequest.getApp());
logger.warn("connection dose not exist, transport: {}, app: {}", transport, addProducerRequest.getApp());
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -110,4 +110,4 @@ protected String generateProducerId(Connection connection, String topic, String
public int type() {
return JoyQueueCommandType.ADD_PRODUCER_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public Command handle(Transport transport, Command command) {
Connection connection = SessionHelper.getConnection(transport);

if (connection == null || !connection.isAuthorized(commitAckRequest.getApp())) {
logger.warn("connection is not exists, transport: {}, app: {}", transport, commitAckRequest.getApp());
logger.warn("connection dose not exist, transport: {}, app: {}", transport, commitAckRequest.getApp());
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -249,4 +249,4 @@ private RetryMessageModel generateRetryMessage(Consumer consumer, BrokerMessage
public int type() {
return JoyQueueCommandType.COMMIT_ACK_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Command handle(Transport transport, Command command) {
String app = commitIndexRequest.getApp();

if (connection == null || !connection.isAuthorized(app)) {
logger.warn("connection is not exists, transport: {}, app: {}", transport, app);
logger.warn("connection dose not exist, transport: {}, app: {}", transport, app);
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -99,4 +99,4 @@ public Command handle(Transport transport, Command command) {
public int type() {
return JoyQueueCommandType.COMMIT_ACK_INDEX_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Command handle(Transport transport, Command command) {
String connectionId = ((InetSocketAddress) transport.remoteAddress()).getHostString();

if (connection == null || !connection.isAuthorized(fetchAssignedPartitionRequest.getApp())) {
logger.warn("connection is not exists, transport: {}, app: {}", transport, fetchAssignedPartitionRequest.getApp());
logger.warn("connection dose not exist, transport: {}, app: {}", transport, fetchAssignedPartitionRequest.getApp());
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -146,4 +146,4 @@ protected List<PartitionGroup> getTopicRegionPartitionGroup(TopicConfig topicCon
public int type() {
return JoyQueueCommandType.FETCH_ASSIGNED_PARTITION_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Command handle(Transport transport, Command command) {
Connection connection = SessionHelper.getConnection(transport);

if (connection == null || !connection.isAuthorized(fetchClusterRequest.getApp())) {
logger.warn("connection is not exists, transport: {}, app: {}", transport, fetchClusterRequest.getApp());
logger.warn("connection dose not exist, transport: {}, app: {}", transport, fetchClusterRequest.getApp());
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -198,4 +198,4 @@ protected TopicPartition convertTopicPartition(PartitionGroup partitionGroup, sh
public int type() {
return JoyQueueCommandType.FETCH_CLUSTER_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Command handle(Transport transport, Command command) {
Connection connection = SessionHelper.getConnection(transport);

if (connection == null || !connection.isAuthorized(fetchIndexRequest.getApp())) {
logger.warn("connection is not exists, transport: {}, app: {}", transport, fetchIndexRequest.getApp());
logger.warn("connection dose not exist, transport: {}, app: {}", transport, fetchIndexRequest.getApp());
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -103,4 +103,4 @@ protected FetchIndexData fetchIndex(Connection connection, Consumer consumer, sh
public int type() {
return JoyQueueCommandType.FETCH_INDEX_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public Command handle(Transport transport, Command command) {
Connection connection = SessionHelper.getConnection(transport);

if (connection == null || !connection.isAuthorized(fetchPartitionMessageRequest.getApp())) {
logger.warn("connection is not exists, transport: {}, app: {}", transport, fetchPartitionMessageRequest.getApp());
logger.warn("connection dose not exist, transport: {}, app: {}", transport, fetchPartitionMessageRequest.getApp());
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -157,4 +157,4 @@ protected FetchPartitionMessageAckData fetchMessage(Transport transport, Consume
public int type() {
return JoyQueueCommandType.FETCH_PARTITION_MESSAGE_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Command handle(Transport transport, Command command) {
Connection connection = SessionHelper.getConnection(transport);

if (connection == null || !connection.isAuthorized(fetchProduceFeedbackRequest.getApp())) {
logger.warn("connection is not exists, transport: {}, app: {}", transport, fetchProduceFeedbackRequest.getApp());
logger.warn("connection dose not exist, transport: {}, app: {}", transport, fetchProduceFeedbackRequest.getApp());
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand Down Expand Up @@ -117,4 +117,4 @@ protected List<FetchProduceFeedbackAckData> buildFeedbackAckData(List<Transactio
public int type() {
return JoyQueueCommandType.FETCH_PRODUCE_FEEDBACK_REQUEST.getCode();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Command handle(Transport transport, Command command) {
Connection connection = SessionHelper.getConnection(transport);

if (connection == null || !connection.isAuthorized(fetchTopicMessageRequest.getApp())) {
logger.warn("connection is not exists, transport: {}, app: {}, topics: {}", transport, fetchTopicMessageRequest.getApp(), fetchTopicMessageRequest.getTopics().keySet());
logger.warn("connection dose not exist, transport: {}, app: {}, topics: {}", transport, fetchTopicMessageRequest.getApp(), fetchTopicMessageRequest.getTopics().keySet());
return BooleanAck.build(JoyQueueCode.FW_CONNECTION_NOT_EXISTS.getCode());
}

Expand All @@ -108,7 +108,7 @@ public Command handle(Transport transport, Command command) {
Consumer consumer = (StringUtils.isBlank(consumerId) ? null : sessionManager.getConsumerById(consumerId));

if (consumer == null) {
logger.warn("connection is not exists, transport: {}, app: {}, topics: {}", transport, fetchTopicMessageRequest.getApp(), fetchTopicMessageRequest.getTopics().keySet());
logger.warn("connection dose not exist, transport: {}, app: {}, topics: {}", transport, fetchTopicMessageRequest.getApp(), fetchTopicMessageRequest.getTopics().keySet());
result.put(topic, new FetchTopicMessageAckData(CheckResultConverter.convertFetchCode(command.getHeader().getVersion(), JoyQueueCode.FW_CONSUMER_NOT_EXISTS)));
continue;
}
Expand Down Expand Up @@ -157,4 +157,4 @@ protected FetchTopicMessageAckData fetchMessage(Transport transport, Consumer co
public int type() {
return JoyQueueCommandType.FETCH_TOPIC_MESSAGE_REQUEST.getCode();
}
}
}
Loading

0 comments on commit 9dd3b16

Please sign in to comment.