[
https://issues.apache.org/jira/browse/PHOENIX-1931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14516078#comment-14516078
]
James Taylor commented on PHOENIX-1931:
---------------------------------------
Also, not sure what to do about the warning that cacheKey is not used here.
Should it be used or do you use lockKey instead. I've removed it in the patch I
attached. Please commit whatever the right fix is, [~rajeshbabu].
{code}
@Override
public void dropFunction(RpcController controller, DropFunctionRequest
request,
RpcCallback<MetaDataResponse> done) {
byte[][] rowKeyMetaData = new byte[2][];
byte[] functionName = null;
try {
List<Mutation> functionMetaData =
ProtobufUtil.getMutations(request);
MetaDataUtil.getTenantIdAndFunctionName(functionMetaData,
rowKeyMetaData);
byte[] tenantIdBytes =
rowKeyMetaData[PhoenixDatabaseMetaData.TENANT_ID_INDEX];
functionName =
rowKeyMetaData[PhoenixDatabaseMetaData.FUNTION_NAME_INDEX];
byte[] lockKey = SchemaUtil.getFunctionKey(tenantIdBytes,
functionName);
HRegion region = env.getRegion();
MetaDataMutationResult result = checkFunctionKeyInRegion(lockKey,
region);
if (result != null) {
done.run(MetaDataMutationResult.toProto(result));
return;
}
List<RowLock> locks = Lists.newArrayList();
long clientTimeStamp =
MetaDataUtil.getClientTimeStamp(functionMetaData);
try {
acquireLock(region, lockKey, locks);
ImmutableBytesPtr cacheKey = new FunctionBytesPtr(lockKey);
List<byte[]> keys = new ArrayList<byte[]>(1);
keys.add(lockKey);
List<ImmutableBytesPtr> invalidateList = new
ArrayList<ImmutableBytesPtr>();
result = doDropFunction(clientTimeStamp, keys,
functionMetaData, invalidateList);
if (result.getMutationCode() !=
MutationCode.FUNCTION_ALREADY_EXISTS) {
done.run(MetaDataMutationResult.toProto(result));
return;
}
region.mutateRowsWithLocks(functionMetaData,
Collections.<byte[]> emptySet());
Cache<ImmutableBytesPtr,PMetaDataEntity> metaDataCache =
GlobalCache.getInstance(this.env).getMetaDataCache();
long currentTime =
MetaDataUtil.getClientTimeStamp(functionMetaData);
for(ImmutableBytesPtr ptr: invalidateList) {
metaDataCache.invalidate(ptr);
metaDataCache.put(ptr,
newDeletedFunctionMarker(currentTime));
}
done.run(MetaDataMutationResult.toProto(result));
return;
} finally {
region.releaseRowLocks(locks);
}
} catch (Throwable t) {
logger.error("dropFunction failed", t);
ProtobufUtil.setControllerException(controller,
ServerUtil.createIOException(Bytes.toString(functionName), t));
}
}
{code}
> IDE compilation errors after UDF check-in
> -----------------------------------------
>
> Key: PHOENIX-1931
> URL: https://issues.apache.org/jira/browse/PHOENIX-1931
> Project: Phoenix
> Issue Type: Bug
> Reporter: James Taylor
> Assignee: Rajeshbabu Chintaguntla
>
> Description Resource Path Location Type
> The method getExpressionCtor(Class<? extends FunctionExpression>) from the
> type FunctionParseNode is never used locally FunctionParseNode.java
> /phoenix-core/src/main/java/org/apache/phoenix/parse line 119 Java
> Problem
> The value of the field MetaDataEndpointImpl.TYPE_INDEX is not used
> MetaDataEndpointImpl.java
> /phoenix-core/src/main/java/org/apache/phoenix/coprocessor line 347
> Java Problem
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)