leventov commented on a change in pull request #7038: Fix and document
concurrency of EventReceiverFirehose and TimedShutoffFirehose; Refine
concurrency specification of Firehose
URL: https://github.com/apache/incubator-druid/pull/7038#discussion_r255670746
##########
File path:
server/src/main/java/org/apache/druid/segment/realtime/firehose/TimedShutoffFirehoseFactory.java
##########
@@ -63,31 +69,25 @@ public Firehose connect(InputRowParser parser, File
temporaryDirectory) throws I
class TimedShutoffFirehose implements Firehose
{
private final Firehose firehose;
- private final ScheduledExecutorService exec;
- private final Object shutdownLock = new Object();
- private volatile boolean shutdown = false;
+ private final ScheduledExecutorService shutdownExec;
+ @GuardedBy("this")
+ private boolean closed = false;
TimedShutoffFirehose(InputRowParser parser, File temporaryDirectory)
throws IOException
{
firehose = delegateFactory.connect(parser, temporaryDirectory);
- exec = Execs.scheduledSingleThreaded("timed-shutoff-firehose-%d");
-
- exec.schedule(
- new Runnable()
- {
- @Override
- public void run()
- {
- log.info("Closing delegate firehose.");
-
- shutdown = true;
- try {
- firehose.close();
- }
- catch (IOException e) {
- log.warn(e, "Failed to close delegate firehose, ignoring.");
- }
+ shutdownExec =
Execs.scheduledSingleThreaded("timed-shutoff-firehose-%d");
Review comment:
Not sure what do you mean?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]