Removed 'if' condition. (#8768)

This commit is contained in:
karthikbhat13 2019-10-29 02:10:03 +05:30 committed by Fangjin Yang
parent aa81253cf4
commit b8ceee4eee
1 changed files with 2 additions and 7 deletions

View File

@ -233,9 +233,7 @@ public class KafkaLookupExtractorFactory implements LookupExtractorFactory
}
catch (InterruptedException | ExecutionException | TimeoutException e) {
executorService.shutdown();
if (!future.isDone() && !future.cancel(false)) {
LOG.warn("Could not cancel kafka listening thread");
}
future.cancel(true);
LOG.error(e, "Failed to start kafka extraction factory");
cacheHandler.close();
return false;
@ -259,10 +257,7 @@ public class KafkaLookupExtractorFactory implements LookupExtractorFactory
final ListenableFuture<?> future = this.future;
if (future != null) {
if (!future.isDone() && !future.cancel(false)) {
LOG.error("Error cancelling future for topic [%s]", getKafkaTopic());
return false;
}
future.cancel(true);
}
cacheHandler.close();
return true;