HADOOP-17208. LoadBalanceKMSClientProvider#deleteKey should invalidateCache via all KMSClientProvider instances. (#2259)
This commit is contained in:
parent
20a0e6278d
commit
6adf8462ba
@ -502,6 +502,7 @@ public Void call(KMSClientProvider provider) throws IOException {
|
||||
return null;
|
||||
}
|
||||
}, nextIdx(), false);
|
||||
invalidateCache(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -299,19 +299,18 @@ public E getNext(String keyName)
|
||||
* @param keyName the key to drain the Queue for
|
||||
*/
|
||||
public void drain(String keyName) {
|
||||
Runnable e;
|
||||
while ((e = queue.deleteByName(keyName)) != null) {
|
||||
executor.remove(e);
|
||||
}
|
||||
writeLock(keyName);
|
||||
try {
|
||||
Runnable e;
|
||||
while ((e = queue.deleteByName(keyName)) != null) {
|
||||
executor.remove(e);
|
||||
LinkedBlockingQueue kq = keyQueues.getIfPresent(keyName);
|
||||
if (kq != null) {
|
||||
kq.clear();
|
||||
}
|
||||
writeLock(keyName);
|
||||
try {
|
||||
keyQueues.get(keyName).clear();
|
||||
} finally {
|
||||
writeUnlock(keyName);
|
||||
}
|
||||
} catch (ExecutionException ex) {
|
||||
//NOP
|
||||
} finally {
|
||||
writeUnlock(keyName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user