See comment in Catalog.
(Function desc)
| 396 | * See comment in Catalog. |
| 397 | */ |
| 398 | public Function removeFunction(Function desc) { |
| 399 | synchronized (functions_) { |
| 400 | Function fn = getFunction(desc, Function.CompareMode.IS_INDISTINGUISHABLE); |
| 401 | if (fn == null) return null; |
| 402 | List<Function> fns = functions_.get(desc.functionName()); |
| 403 | Preconditions.checkNotNull(fns); |
| 404 | fns.remove(fn); |
| 405 | if (fns.isEmpty()) functions_.remove(desc.functionName()); |
| 406 | if (fn.getBinaryType() == TFunctionBinaryType.JAVA) return fn; |
| 407 | // Remove the function from the metastore database parameters |
| 408 | String fnKey = FUNCTION_INDEX_PREFIX + fn.signatureString(); |
| 409 | boolean removeFn = removeFromHmsParameters(fnKey); |
| 410 | Preconditions.checkState(removeFn); |
| 411 | return fn; |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | public void removeAllFunctions() { |
| 416 | synchronized (functions_) { |
no test coverage detected