Skip to content

Commit b9406d3

Browse files
authored
[Bug-8067][LogServer] fix improper use of StringBuilder (#8365)
fix code format and fix spelling errors
1 parent 4a4e72b commit b9406d3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

dolphinscheduler-log-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ public LoggerRequestProcessor() {
7070
public void process(Channel channel, Command command) {
7171
logger.info("received command : {}", command);
7272

73-
/**
74-
* reuqest task log command type
75-
*/
73+
//request task log command type
7674
final CommandType commandType = command.getType();
7775
switch (commandType) {
7876
case GET_LOG_BYTES_REQUEST:
@@ -96,7 +94,7 @@ public void process(Channel channel, Command command) {
9694
rollViewLogRequest.getSkipLineNum(), rollViewLogRequest.getLimit());
9795
StringBuilder builder = new StringBuilder();
9896
for (String line : lines) {
99-
builder.append(line + "\r\n");
97+
builder.append(line).append("\r\n");
10098
}
10199
RollViewLogResponseCommand rollViewLogRequestResponse = new RollViewLogResponseCommand(builder.toString());
102100
channel.writeAndFlush(rollViewLogRequestResponse.convert2Command(command.getOpaque()));
@@ -108,7 +106,7 @@ public void process(Channel channel, Command command) {
108106
String taskLogPath = removeTaskLogRequest.getPath();
109107

110108
File taskLogFile = new File(taskLogPath);
111-
Boolean status = true;
109+
boolean status = true;
112110
try {
113111
if (taskLogFile.exists()) {
114112
status = taskLogFile.delete();
@@ -130,11 +128,10 @@ public ExecutorService getExecutor() {
130128
}
131129

132130
/**
133-
* get files content bytesfor down load file
131+
* get files content bytes for download file
134132
*
135133
* @param filePath file path
136134
* @return byte array of file
137-
* @throws Exception exception
138135
*/
139136
private byte[] getFileContentBytes(String filePath) {
140137
try (InputStream in = new FileInputStream(filePath);

0 commit comments

Comments
 (0)