Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,12 @@ public class PutHiveStreaming extends AbstractProcessor {
protected volatile UserGroupInformation ugi;
protected volatile HiveConf hiveConfig;

protected final AtomicBoolean isInitialized = new AtomicBoolean(false);
protected final AtomicBoolean sendHeartBeat = new AtomicBoolean(false);

protected HiveOptions options;
protected ExecutorService callTimeoutPool;
protected transient Timer heartBeatTimer;
protected AtomicBoolean sendHeartBeat = new AtomicBoolean(false);
protected Map<HiveEndPoint, HiveWriter> allWriters;
protected Map<HiveEndPoint, HiveWriter> allWriters = Collections.emptyMap();


@Override
Expand Down Expand Up @@ -662,17 +661,20 @@ public void cleanup() {
}
}
}
allWriters = Collections.emptyMap();

callTimeoutPool.shutdown();
try {
while (!callTimeoutPool.isTerminated()) {
callTimeoutPool.awaitTermination(options.getCallTimeOut(), TimeUnit.MILLISECONDS);
if (callTimeoutPool != null) {
callTimeoutPool.shutdown();
try {
while (!callTimeoutPool.isTerminated()) {
callTimeoutPool.awaitTermination(options.getCallTimeOut(), TimeUnit.MILLISECONDS);
}
} catch (Throwable t) {
log.warn("shutdown interrupted on " + callTimeoutPool, t);
}
} catch (Throwable t) {
log.warn("shutdown interrupted on " + callTimeoutPool, t);
callTimeoutPool = null;
}

callTimeoutPool = null;
ugi = null;
hiveConfigurator.stopRenewer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ public void onTriggerWithExceptionOnFlushAndClose() throws Exception {

@Test
public void cleanup() throws Exception {

processor.cleanup();
}

@Test
Expand Down