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