You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/08/04 09:52:26 UTC
[GitHub] [incubator-kyuubi] yaooqinn opened a new pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
yaooqinn opened a new pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892
<!--
Thanks for sending a pull request!
Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->
### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
1. If you add a feature, you can talk about the use case of it.
2. If you fix a bug, you can clarify why it is a bug.
-->
### _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
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r682570791
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +36,51 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
Review comment:
PrintWriter is not optional
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#issuecomment-892540367
# [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#892](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e815d10) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/4fecf139027780a71de863acf3109458e80f3be7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4fecf13) will **decrease** coverage by `0.02%`.
> The diff coverage is `80.64%`.
> :exclamation: Current head e815d10 differs from pull request most recent head e6ebef1. Consider uploading reports for the commit e6ebef1 to get more accurate results
[](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #892 +/- ##
============================================
- Coverage 79.16% 79.13% -0.03%
Complexity 11 11
============================================
Files 143 143
Lines 5346 5354 +8
Branches 649 650 +1
============================================
+ Hits 4232 4237 +5
- Misses 751 752 +1
- Partials 363 365 +2
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...e/kyuubi/engine/spark/events/JsonEventLogger.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9ldmVudHMvSnNvbkV2ZW50TG9nZ2VyLnNjYWxh) | `84.21% <80.00%> (-5.79%)` | :arrow_down: |
| [...uubi/engine/spark/events/EventLoggingService.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9ldmVudHMvRXZlbnRMb2dnaW5nU2VydmljZS5zY2FsYQ==) | `82.60% <100.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4fecf13...e6ebef1](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#issuecomment-892588704
cc @pan3793 @ulysses-you @zhang1002
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r683078533
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +39,50 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
- private def getOrUpdate(event: KyuubiEvent): PrintWriter = synchronized {
+ private var logRoot: URI = _
+ private var fs: FileSystem = _
+ private val writers = HashMap.empty[String, Logger]
+
+ private def getOrUpdate(event: KyuubiEvent): Logger = synchronized {
writers.getOrElseUpdate(event.eventType, {
- val eventDir = Files.createDirectories(Paths.get(logRoot.toString, event.eventType))
- Files.setPosixFilePermissions(eventDir, JSON_LOG_DIR_PERM)
- val eventPath = Files.createFile(Paths.get(eventDir.toString, logName + ".json"))
- // TODO: make it support Hadoop compatible filesystems
- val newWriter = new PrintWriter(Files.newBufferedWriter(eventPath, StandardCharsets.UTF_8))
- Files.setPosixFilePermissions(eventPath, JSON_LOG_FILE_PERM)
- newWriter
+ val eventPath = new Path(new Path(logRoot), event.eventType)
+ FileSystem.mkdirs(fs, eventPath, JSON_LOG_DIR_PERM)
+ val logFile = new Path(eventPath, logName + ".json")
+ var hadoopDataStream: FSDataOutputStream = null
+ val rawStream = if (logFile.toUri.getScheme == "file") {
+ new FileOutputStream(logFile.toUri.getPath)
+ } else {
+ hadoopDataStream = fs.create(logFile)
+ hadoopDataStream
+ }
Review comment:
why we need distinguish the scheme here, we can't just do this ?
```
val stream = fs.create(logFile)
val bStream = new BufferedOutputStream(stream)
```
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +39,50 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
- private def getOrUpdate(event: KyuubiEvent): PrintWriter = synchronized {
+ private var logRoot: URI = _
+ private var fs: FileSystem = _
+ private val writers = HashMap.empty[String, Logger]
+
+ private def getOrUpdate(event: KyuubiEvent): Logger = synchronized {
writers.getOrElseUpdate(event.eventType, {
- val eventDir = Files.createDirectories(Paths.get(logRoot.toString, event.eventType))
- Files.setPosixFilePermissions(eventDir, JSON_LOG_DIR_PERM)
- val eventPath = Files.createFile(Paths.get(eventDir.toString, logName + ".json"))
- // TODO: make it support Hadoop compatible filesystems
- val newWriter = new PrintWriter(Files.newBufferedWriter(eventPath, StandardCharsets.UTF_8))
- Files.setPosixFilePermissions(eventPath, JSON_LOG_FILE_PERM)
- newWriter
+ val eventPath = new Path(new Path(logRoot), event.eventType)
+ FileSystem.mkdirs(fs, eventPath, JSON_LOG_DIR_PERM)
+ val logFile = new Path(eventPath, logName + ".json")
+ var hadoopDataStream: FSDataOutputStream = null
+ val rawStream = if (logFile.toUri.getScheme == "file") {
+ new FileOutputStream(logFile.toUri.getPath)
+ } else {
+ hadoopDataStream = fs.create(logFile)
+ hadoopDataStream
+ }
Review comment:
Can we add that bug link here
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#issuecomment-892540367
# [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#892](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e815d10) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/4fecf139027780a71de863acf3109458e80f3be7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4fecf13) will **decrease** coverage by `0.02%`.
> The diff coverage is `80.64%`.
> :exclamation: Current head e815d10 differs from pull request most recent head e6ebef1. Consider uploading reports for the commit e6ebef1 to get more accurate results
[](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #892 +/- ##
============================================
- Coverage 79.16% 79.13% -0.03%
Complexity 11 11
============================================
Files 143 143
Lines 5346 5354 +8
Branches 649 650 +1
============================================
+ Hits 4232 4237 +5
- Misses 751 752 +1
- Partials 363 365 +2
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...e/kyuubi/engine/spark/events/JsonEventLogger.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9ldmVudHMvSnNvbkV2ZW50TG9nZ2VyLnNjYWxh) | `84.21% <80.00%> (-5.79%)` | :arrow_down: |
| [...uubi/engine/spark/events/EventLoggingService.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9ldmVudHMvRXZlbnRMb2dnaW5nU2VydmljZS5zY2FsYQ==) | `82.60% <100.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4fecf13...e6ebef1](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#issuecomment-892540367
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
pan3793 commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r682568983
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +36,51 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
+
+ private var logRoot: URI = _
+ private var fs: FileSystem = _
+ private val writers =
+ new scala.collection.mutable.HashMap[String, Logger]()
Review comment:
`scala.collection.mutable.HashMap` => `mutable.HashMap`
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
pan3793 commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r682565350
##########
File path: externals/kyuubi-spark-sql-engine/pom.xml
##########
@@ -68,6 +68,19 @@
<scope>provided</scope>
</dependency>
+
Review comment:
nit: keep one blank line
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
pan3793 commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r682568436
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +36,51 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
Review comment:
How about `type Logger = Either[PrintWriter, FSDataOutputStream]`
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#issuecomment-892540367
# [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#892](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c110b4e) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/4fecf139027780a71de863acf3109458e80f3be7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4fecf13) will **decrease** coverage by `0.01%`.
> The diff coverage is `80.00%`.
> :exclamation: Current head c110b4e differs from pull request most recent head e291a73. Consider uploading reports for the commit e291a73 to get more accurate results
[](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #892 +/- ##
============================================
- Coverage 79.16% 79.15% -0.02%
Complexity 11 11
============================================
Files 143 143
Lines 5346 5353 +7
Branches 649 650 +1
============================================
+ Hits 4232 4237 +5
- Misses 751 752 +1
- Partials 363 364 +1
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...e/kyuubi/engine/spark/events/JsonEventLogger.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9ldmVudHMvSnNvbkV2ZW50TG9nZ2VyLnNjYWxh) | `83.78% <79.31%> (-6.22%)` | :arrow_down: |
| [...uubi/engine/spark/events/EventLoggingService.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9ldmVudHMvRXZlbnRMb2dnaW5nU2VydmljZS5zY2FsYQ==) | `82.60% <100.00%> (ø)` | |
| [...pache/kyuubi/sql/KyuubiQueryStagePreparation.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGV2L2t5dXViaS1leHRlbnNpb24tc3BhcmstMy0xL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NxbC9LeXV1YmlRdWVyeVN0YWdlUHJlcGFyYXRpb24uc2NhbGE=) | `80.39% <0.00%> (+0.98%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4fecf13...e291a73](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r683078533
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +39,50 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
- private def getOrUpdate(event: KyuubiEvent): PrintWriter = synchronized {
+ private var logRoot: URI = _
+ private var fs: FileSystem = _
+ private val writers = HashMap.empty[String, Logger]
+
+ private def getOrUpdate(event: KyuubiEvent): Logger = synchronized {
writers.getOrElseUpdate(event.eventType, {
- val eventDir = Files.createDirectories(Paths.get(logRoot.toString, event.eventType))
- Files.setPosixFilePermissions(eventDir, JSON_LOG_DIR_PERM)
- val eventPath = Files.createFile(Paths.get(eventDir.toString, logName + ".json"))
- // TODO: make it support Hadoop compatible filesystems
- val newWriter = new PrintWriter(Files.newBufferedWriter(eventPath, StandardCharsets.UTF_8))
- Files.setPosixFilePermissions(eventPath, JSON_LOG_FILE_PERM)
- newWriter
+ val eventPath = new Path(new Path(logRoot), event.eventType)
+ FileSystem.mkdirs(fs, eventPath, JSON_LOG_DIR_PERM)
+ val logFile = new Path(eventPath, logName + ".json")
+ var hadoopDataStream: FSDataOutputStream = null
+ val rawStream = if (logFile.toUri.getScheme == "file") {
+ new FileOutputStream(logFile.toUri.getPath)
+ } else {
+ hadoopDataStream = fs.create(logFile)
+ hadoopDataStream
+ }
Review comment:
why we need distinguish the scheme here, we can't just do this ?
```
val stream = fs.create(logFile)
val bStream = new BufferedOutputStream(stream)
```
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
pan3793 commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r682565003
##########
File path: externals/kyuubi-spark-sql-engine/pom.xml
##########
@@ -68,6 +68,19 @@
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client-runtime</artifactId>
+ <scope>provided</scope>
Review comment:
keep `hadoop-client-runtime` in test scope
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] yaooqinn closed pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
yaooqinn closed pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#issuecomment-892540367
# [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#892](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e815d10) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/4fecf139027780a71de863acf3109458e80f3be7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4fecf13) will **decrease** coverage by `0.02%`.
> The diff coverage is `80.64%`.
> :exclamation: Current head e815d10 differs from pull request most recent head e291a73. Consider uploading reports for the commit e291a73 to get more accurate results
[](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #892 +/- ##
============================================
- Coverage 79.16% 79.13% -0.03%
Complexity 11 11
============================================
Files 143 143
Lines 5346 5354 +8
Branches 649 650 +1
============================================
+ Hits 4232 4237 +5
- Misses 751 752 +1
- Partials 363 365 +2
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...e/kyuubi/engine/spark/events/JsonEventLogger.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9ldmVudHMvSnNvbkV2ZW50TG9nZ2VyLnNjYWxh) | `84.21% <80.00%> (-5.79%)` | :arrow_down: |
| [...uubi/engine/spark/events/EventLoggingService.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/892/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9ldmVudHMvRXZlbnRMb2dnaW5nU2VydmljZS5zY2FsYQ==) | `82.60% <100.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4fecf13...e291a73](https://codecov.io/gh/apache/incubator-kyuubi/pull/892?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r682570791
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +36,51 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
Review comment:
PrintWriter is not optional
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +39,50 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
- private def getOrUpdate(event: KyuubiEvent): PrintWriter = synchronized {
+ private var logRoot: URI = _
+ private var fs: FileSystem = _
+ private val writers = HashMap.empty[String, Logger]
+
+ private def getOrUpdate(event: KyuubiEvent): Logger = synchronized {
writers.getOrElseUpdate(event.eventType, {
- val eventDir = Files.createDirectories(Paths.get(logRoot.toString, event.eventType))
- Files.setPosixFilePermissions(eventDir, JSON_LOG_DIR_PERM)
- val eventPath = Files.createFile(Paths.get(eventDir.toString, logName + ".json"))
- // TODO: make it support Hadoop compatible filesystems
- val newWriter = new PrintWriter(Files.newBufferedWriter(eventPath, StandardCharsets.UTF_8))
- Files.setPosixFilePermissions(eventPath, JSON_LOG_FILE_PERM)
- newWriter
+ val eventPath = new Path(new Path(logRoot), event.eventType)
+ FileSystem.mkdirs(fs, eventPath, JSON_LOG_DIR_PERM)
+ val logFile = new Path(eventPath, logName + ".json")
+ var hadoopDataStream: FSDataOutputStream = null
+ val rawStream = if (logFile.toUri.getScheme == "file") {
+ new FileOutputStream(logFile.toUri.getPath)
+ } else {
+ hadoopDataStream = fs.create(logFile)
+ hadoopDataStream
+ }
Review comment:
avoid hdfs bug
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#issuecomment-892588704
cc @pan3793 @ulysses-you @zhang1002
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r683107814
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +39,50 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
- private def getOrUpdate(event: KyuubiEvent): PrintWriter = synchronized {
+ private var logRoot: URI = _
+ private var fs: FileSystem = _
+ private val writers = HashMap.empty[String, Logger]
+
+ private def getOrUpdate(event: KyuubiEvent): Logger = synchronized {
writers.getOrElseUpdate(event.eventType, {
- val eventDir = Files.createDirectories(Paths.get(logRoot.toString, event.eventType))
- Files.setPosixFilePermissions(eventDir, JSON_LOG_DIR_PERM)
- val eventPath = Files.createFile(Paths.get(eventDir.toString, logName + ".json"))
- // TODO: make it support Hadoop compatible filesystems
- val newWriter = new PrintWriter(Files.newBufferedWriter(eventPath, StandardCharsets.UTF_8))
- Files.setPosixFilePermissions(eventPath, JSON_LOG_FILE_PERM)
- newWriter
+ val eventPath = new Path(new Path(logRoot), event.eventType)
+ FileSystem.mkdirs(fs, eventPath, JSON_LOG_DIR_PERM)
+ val logFile = new Path(eventPath, logName + ".json")
+ var hadoopDataStream: FSDataOutputStream = null
+ val rawStream = if (logFile.toUri.getScheme == "file") {
+ new FileOutputStream(logFile.toUri.getPath)
+ } else {
+ hadoopDataStream = fs.create(logFile)
+ hadoopDataStream
+ }
Review comment:
Can we add that bug link here
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r683090646
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +39,50 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
- private def getOrUpdate(event: KyuubiEvent): PrintWriter = synchronized {
+ private var logRoot: URI = _
+ private var fs: FileSystem = _
+ private val writers = HashMap.empty[String, Logger]
+
+ private def getOrUpdate(event: KyuubiEvent): Logger = synchronized {
writers.getOrElseUpdate(event.eventType, {
- val eventDir = Files.createDirectories(Paths.get(logRoot.toString, event.eventType))
- Files.setPosixFilePermissions(eventDir, JSON_LOG_DIR_PERM)
- val eventPath = Files.createFile(Paths.get(eventDir.toString, logName + ".json"))
- // TODO: make it support Hadoop compatible filesystems
- val newWriter = new PrintWriter(Files.newBufferedWriter(eventPath, StandardCharsets.UTF_8))
- Files.setPosixFilePermissions(eventPath, JSON_LOG_FILE_PERM)
- newWriter
+ val eventPath = new Path(new Path(logRoot), event.eventType)
+ FileSystem.mkdirs(fs, eventPath, JSON_LOG_DIR_PERM)
+ val logFile = new Path(eventPath, logName + ".json")
+ var hadoopDataStream: FSDataOutputStream = null
+ val rawStream = if (logFile.toUri.getScheme == "file") {
+ new FileOutputStream(logFile.toUri.getPath)
+ } else {
+ hadoopDataStream = fs.create(logFile)
+ hadoopDataStream
+ }
Review comment:
avoid hdfs bug
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-kyuubi] pan3793 commented on a change in pull request #892: Make JsonEventLogger compatible with HDFS-like FileSystems
Posted by GitBox <gi...@apache.org>.
pan3793 commented on a change in pull request #892:
URL: https://github.com/apache/incubator-kyuubi/pull/892#discussion_r682565003
##########
File path: externals/kyuubi-spark-sql-engine/pom.xml
##########
@@ -68,6 +68,19 @@
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client-runtime</artifactId>
+ <scope>provided</scope>
Review comment:
keep `hadoop-client-runtime` in test scope
##########
File path: externals/kyuubi-spark-sql-engine/pom.xml
##########
@@ -68,6 +68,19 @@
<scope>provided</scope>
</dependency>
+
Review comment:
nit: keep one blank line
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +36,51 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
Review comment:
How about `type Logger = Either[PrintWriter, FSDataOutputStream]`
##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/events/JsonEventLogger.scala
##########
@@ -33,32 +36,51 @@ import org.apache.kyuubi.service.AbstractService
* The {eventType} is based on core concepts of the Kyuubi systems, e.g. engine/session/statement
* @param logName the engine id formed of appId + attemptId(if any)
*/
-class JsonEventLogger(logName: String)
+class JsonEventLogger(logName: String, hadoopConf: Configuration)
extends AbstractService("JsonEventLogger") with EventLogger with Logging {
- private var logRoot: Path = _
- private val writers = new scala.collection.mutable.HashMap[String, PrintWriter]()
+ type Logger = (PrintWriter, Option[FSDataOutputStream])
+
+ private var logRoot: URI = _
+ private var fs: FileSystem = _
+ private val writers =
+ new scala.collection.mutable.HashMap[String, Logger]()
Review comment:
`scala.collection.mutable.HashMap` => `mutable.HashMap`
--
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: commits-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org