Uploaded image for project: 'Apache InLong'
  1. Apache InLong
  2. INLONG-73

remove duplicate codes & some minor updates

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 0.5.0
    • None

    Description

      1. remove duplicate block

      catch (final Exception e) {
                  logger.error("Put message failed ", e);
                  strBuffer.delete(0, strBuffer.length());
                  builder.setSuccess(false);
                  builder.setErrCode(TErrCodeConstants.INTERNAL_SERVER_ERROR);
                  builder.setErrMsg(strBuffer.append("Put message failed from ")
                          .append(tubeConfig.getHostName()).append(" ")
                          .append((e.getMessage() != null ? e.getMessage() : " ")).toString());
                  return builder.build();
              } catch (final Throwable ex) {
                  logger.error("Put message failed ", ex);
                  strBuffer.delete(0, strBuffer.length());
                  builder.setSuccess(false);
                  builder.setErrCode(TErrCodeConstants.INTERNAL_SERVER_ERROR);
                  builder.setErrMsg(strBuffer.append("Put message failed from ")
                          .append(tubeConfig.getHostName()).append(" ")
                          .append((ex.getMessage() != null ? ex.getMessage() : " ")).toString());
                  return builder.build();
              }
      

      2. remove inner if

      if (request.getCheckSum() != -1) {
           if (checkSum != request.getCheckSum()) {
                builder.setErrCode(TErrCodeConstants.FORBIDDEN);
                builder.setErrMsg(strBuffer.append("Checksum msg data failure: ")
                              .append(request.getCheckSum()).append(" of ").append(reqTopic)
                              .append(" not equal to the data's checksum of ")
                              .append(checkSum).toString());
                 return builder.build();
             }
      }
      

      3. fix some typos
      transferedMessageList -> transferMessageList
      cosnumer -> consumer

      4. modify log print

      logger.info(strBuffer.append("[Consumer Register]").append(clientId)
                          .append(TokenConstants.SEGMENT_SEP).append(partStr)
                          .append(TokenConstants.SEGMENT_SEP).append(offsetInfo)
                          .append(", requestOffset=").append(reqOffset)
                          .append(", req has SSD storeId=").append(request.hasSsdStoreId())
                          .append(", req qryPriorityId=").append(reqQryPriorityId)
                          .append(", cur SSD storeId=").append(reqSsdStoreId)
                          .append(", isOverTLS=").append(overtls).toString());
      

      to below :

      logger.info(strBuffer.append("[Consumer Register]").append(clientId)
                          .append(TokenConstants.SEGMENT_SEP).append(partStr)
                          .append(TokenConstants.SEGMENT_SEP).append(offsetInfo)
                          .append(", reqOffset=").append(reqOffset)
                          .append(", reqSsdStoreId=").append(reqSsdStoreId)
                          .append(", reqQryPriorityId=").append(reqQryPriorityId)
                          .append(", isOverTLS=").append(overtls).toString());
      

      Attachments

        Activity

          People

            technoboy Guo Jiwei
            technoboy Guo Jiwei
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m