You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/11/26 23:40:46 UTC
[GitHub] [hive] pvary commented on a change in pull request #2819: HIVE-25741: Close previous writer in proto logger
pvary commented on a change in pull request #2819:
URL: https://github.com/apache/hive/pull/2819#discussion_r757717860
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveProtoLoggingHook.java
##########
@@ -314,6 +314,7 @@ private void writeEvent(HiveHookEventProtoPartialBuilder builder) {
try {
if (eventPerFile) {
if (!maybeRolloverWriterForDay()) {
+ IOUtils.closeQuietly(writer);
Review comment:
Why not just call `maybeRolloverWriterForDay()`. That method makes sure that the writer is open and ready?
Same way as for the normal case.
Like:
```
maybeRolloverWriterForDay();
LOG.debug("Event per file enabled. New proto event file: {}", writer.getPath());
writer.writeProto(event);
IOUtils.closeQuietly(writer);
writer = null;
```
--
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: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org