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;
|
return null;
|
||||||
}
|
}
|
||||||
}, nextIdx(), false);
|
}, nextIdx(), false);
|
||||||
|
invalidateCache(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -299,20 +299,19 @@ public E getNext(String keyName)
|
|||||||
* @param keyName the key to drain the Queue for
|
* @param keyName the key to drain the Queue for
|
||||||
*/
|
*/
|
||||||
public void drain(String keyName) {
|
public void drain(String keyName) {
|
||||||
try {
|
|
||||||
Runnable e;
|
Runnable e;
|
||||||
while ((e = queue.deleteByName(keyName)) != null) {
|
while ((e = queue.deleteByName(keyName)) != null) {
|
||||||
executor.remove(e);
|
executor.remove(e);
|
||||||
}
|
}
|
||||||
writeLock(keyName);
|
writeLock(keyName);
|
||||||
try {
|
try {
|
||||||
keyQueues.get(keyName).clear();
|
LinkedBlockingQueue kq = keyQueues.getIfPresent(keyName);
|
||||||
|
if (kq != null) {
|
||||||
|
kq.clear();
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
writeUnlock(keyName);
|
writeUnlock(keyName);
|
||||||
}
|
}
|
||||||
} catch (ExecutionException ex) {
|
|
||||||
//NOP
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user