|
|
|
@ -17,7 +17,6 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.server.log; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.common.utils.IOUtils; |
|
|
|
|
import org.apache.dolphinscheduler.common.utils.JSONUtils; |
|
|
|
|
import org.apache.dolphinscheduler.common.utils.LoggerUtils; |
|
|
|
|
import org.apache.dolphinscheduler.remote.command.Command; |
|
|
|
@ -44,9 +43,6 @@ import java.util.Collections;
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
|
import java.util.concurrent.Executors; |
|
|
|
|
import java.util.concurrent.LinkedBlockingQueue; |
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
@ -139,11 +135,8 @@ public class LoggerRequestProcessor implements NettyRequestProcessor {
|
|
|
|
|
* @throws Exception exception |
|
|
|
|
*/ |
|
|
|
|
private byte[] getFileContentBytes(String filePath) { |
|
|
|
|
InputStream in = null; |
|
|
|
|
ByteArrayOutputStream bos = null; |
|
|
|
|
try { |
|
|
|
|
in = new FileInputStream(filePath); |
|
|
|
|
bos = new ByteArrayOutputStream(); |
|
|
|
|
try (InputStream in = new FileInputStream(filePath); |
|
|
|
|
ByteArrayOutputStream bos = new ByteArrayOutputStream()) { |
|
|
|
|
byte[] buf = new byte[1024]; |
|
|
|
|
int len; |
|
|
|
|
while ((len = in.read(buf)) != -1) { |
|
|
|
@ -152,9 +145,6 @@ public class LoggerRequestProcessor implements NettyRequestProcessor {
|
|
|
|
|
return bos.toByteArray(); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
logger.error("get file bytes error", e); |
|
|
|
|
} finally { |
|
|
|
|
IOUtils.closeQuietly(bos); |
|
|
|
|
IOUtils.closeQuietly(in); |
|
|
|
|
} |
|
|
|
|
return new byte[0]; |
|
|
|
|
} |
|
|
|
|