@Override
public void run() {
IntegrationHelper intHelper = new IntegrationHelper(HBaseConfiguration.create());
synchronized (THREAD_DELETION_ACTIVE_LOCK) {
while (!mKijiQueue.isEmpty() || mActive) {
KijiURI instanceURI = null;
try {
instanceURI = mKijiQueue.take();
} catch (InterruptedException ie) {
// Interruption in here is expected; as long as the queue is non-empty,
// keep trying to remove one.
continue;
}
if (null == instanceURI) {
LOG.warn("Unexpected null Kiji instance after take() in destroy thread");
continue;
}
try {
intHelper.uninstallKiji(instanceURI);
} catch (Exception e) {
LOG.error("Could not destroy Kiji instance [" + instanceURI.toString() + "]: "
+ e.getMessage());
}
}
}
}