[KYUUBI #412] [MINOR] Simplify ProcBuilder code

![MyLanPangzi](https://badgen.net/badge/Hello/MyLanPangzi/green) [![Closes #412](https://badgen.net/badge/Preview/Closes%20%23412/blue)](https://github.com/yaooqinn/kyuubi/pull/412) ![2](https://badgen.net/badge/%2B/2/red) ![2](https://badgen.net/badge/-/2/green) ![4](https://badgen.net/badge/commits/4/yellow) ![Target Issue](https://badgen.net/badge/Missing/Target%20Issue/ff0000) ![Test Plan](https://badgen.net/badge/Missing/Test%20Plan/ff0000) [&#10088;?&#10089;](https://pullrequestbadge.com/?utm_medium=github&utm_source=yaooqinn&utm_campaign=badge_info)<!-- PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->

remove redundancy code, beause scala SAM will opt the code.

### _Why are the changes needed?_
just simpfy code

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/tools/testing.html#running-tests) locally before make a pull request

Closes #412 from MyLanPangzi/master.

2830118 [hiscat] Update ProcBuilder.scala
a368183 [hiscat] refacotor(kyuubi-main): fix code analysis error
f3f1bca [hiscat] refactor(kyuubi-main):  fix compile error
fb1b841 [hiscat] reafactor(kyuubi-main): simpfy ProcBuilder code

Lead-authored-by: MyLanPangzi <1251723871@qq.com>
Co-authored-by: hiscat <46845236+MyLanPangzi@users.noreply.github.com>
Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
MyLanPangzi 2021-03-10 10:12:37 +08:00 committed by Kent Yao
parent 471dbbcb61
commit 4d3f0742dd
No known key found for this signature in database
GPG Key ID: F7051850A0AF904D

View File

@ -105,8 +105,8 @@ trait ProcBuilder {
val proc = processBuilder.start()
val reader = Files.newBufferedReader(engineLog.toPath, StandardCharsets.UTF_8)
val redirect = new Runnable {
override def run(): Unit = try {
val redirect: Runnable = { () =>
try {
val maxErrorSize = conf.get(KyuubiConf.ENGINE_ERROR_MAX_SIZE)
var line: String = reader.readLine
while (true) {