dockerzhang opened a new issue #695:
URL: https://github.com/apache/incubator-inlong/issues/695


   <p>1. Fix typo<br/>
    validConsumerGroupParmeter -> validConsumerGroupParameter<br/>
    pushIsListenerWaitTimeoutRollBack -> pushListenerWaitTimeoutRollBack<br/>
    pushIsListenerThrowedRollBack -> pushListenerThrowedRollBack</p>
   
   <p>2. Use IllegalArgumentException<br/>
    In ConsumerConfig#validConsumerGroupParameter</p>
   <div class="code panel" style="border-width: 1px;"><div class="codeContent 
panelContent">
   <pre class="code-java">
   <span class="code-keyword">private</span> void 
validConsumerGroupParameter(<span class="code-object">String</span> 
consumerGroup) <span class="code-keyword">throws</span> Exception {
   <span class="code-keyword">if</span> (TStringUtils.isBlank(consumerGroup)) {
       <span class="code-keyword">throw</span> <span 
class="code-keyword">new</span> Exception(<span class="code-quote">"Illegal 
parameter: consumerGroup is Blank!"</span>);
   }
   <span class="code-object">String</span> tmpConsumerGroup = <span 
class="code-object">String</span>.valueOf(consumerGroup).trim();
   <span class="code-keyword">if</span> (tmpConsumerGroup.length() > 
TBaseConstants.META_MAX_GROUPNAME_LENGTH) {
       <span class="code-keyword">throw</span> <span 
class="code-keyword">new</span> Exception(<span class="code-keyword">new</span> 
StringBuilder(512)
       .append(<span class="code-quote">"Illegal parameter: the max length of 
consumerGroup is "</span>)
       .append(TBaseConstants.META_MAX_GROUPNAME_LENGTH)
       .append(<span class="code-quote">" characters"</span>).toString());
   }
   <span class="code-keyword">if</span> 
(!tmpConsumerGroup.matches(TBaseConstants.META_TMP_GROUP_VALUE)) {
       <span class="code-keyword">throw</span> <span 
class="code-keyword">new</span> Exception(<span class="code-keyword">new</span> 
StringBuilder(512)
       .append(<span class="code-quote">"Illegal parameter: the value of 
consumerGroup"</span>)
       .append(<span class="code-quote">" must begin with a letter, "</span>)
       .append(<span class="code-quote">"can only contain 
characters,numbers,hyphen,and underscores"</span>).toString());
   }
       }
   </pre>
   </div></div>
   <p>will change to throw IllegalArgumentException</p>
   <div class="code panel" style="border-width: 1px;"><div class="codeContent 
panelContent">
   <pre class="code-java">
   <span class="code-keyword">private</span> void 
validConsumerGroupParameter(<span class="code-object">String</span> 
consumerGroup) <span class="code-keyword">throws</span> Exception {
   <span class="code-keyword">if</span> (TStringUtils.isBlank(consumerGroup)) {
       <span class="code-keyword">throw</span> <span 
class="code-keyword">new</span> IllegalArgumentException(<span 
class="code-quote">"Illegal parameter: consumerGroup is Blank!"</span>);
   }
   <span class="code-object">String</span> tmpConsumerGroup = <span 
class="code-object">String</span>.valueOf(consumerGroup).trim();
   <span class="code-keyword">if</span> (tmpConsumerGroup.length() > 
TBaseConstants.META_MAX_GROUPNAME_LENGTH) {
       <span class="code-keyword">throw</span> <span 
class="code-keyword">new</span> IllegalArgumentException(<span 
class="code-keyword">new</span> StringBuilder(512)
       .append(<span class="code-quote">"Illegal parameter: the max length of 
consumerGroup is "</span>)
       .append(TBaseConstants.META_MAX_GROUPNAME_LENGTH)
       .append(<span class="code-quote">" characters"</span>).toString());
   }
   <span class="code-keyword">if</span> 
(!tmpConsumerGroup.matches(TBaseConstants.META_TMP_GROUP_VALUE)) {
       <span class="code-keyword">throw</span> <span 
class="code-keyword">new</span> IllegalArgumentException(<span 
class="code-keyword">new</span> StringBuilder(512)
       .append(<span class="code-quote">"Illegal parameter: the value of 
consumerGroup"</span>)
       .append(<span class="code-quote">" must begin with a letter, "</span>)
       .append(<span class="code-quote">"can only contain 
characters,numbers,hyphen,and underscores"</span>).toString());
   }
       }
   </pre>
   </div></div>
   <i>JIRA link - <a 
href="https://issues.apache.org/jira/browse/INLONG-96";>[INLONG-96]</a> created 
by technoboy</i>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to