This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
forked from apache/geode-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-10402: Fix FunctionException handling (apache#981)
* GEODE-10402: Fix FunctionException handling - Fixed handling for FunctionException. - Added InternalFunctionInvocationTargetException and replaced GF_FUNCTION_EXCEPTION by GF_INTERNAL_FUNCTION_INVOCATION_TARGET_EXCEPTION, so function exceptions are properly handled. - Code modified to adapt to the above changes. * GEODE-10402: Revision 1 - Actually added handling for FunctionException exception in ThinClientRegion. - Removed InternalFunctionInvocationTargetException as part of the public API since this is part of the internal Java API. - Added a new IT to verify that FunctionExceptions thrown by the user are actually thrown in the native library as FunctionException's. * GEODE-10402: Format code * GEODE-10402: Revision 2 - Fixed clang-tidy warnings. - Fixed format on one of the Java classes for testing.
- Loading branch information
1 parent
0f50683
commit 4053b71
Showing
10 changed files
with
136 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package javaobject; | ||
|
||
import java.io.Serializable; | ||
|
||
import org.apache.geode.cache.Declarable; | ||
import org.apache.geode.cache.Region; | ||
import org.apache.geode.cache.execute.FunctionAdapter; | ||
import org.apache.geode.cache.execute.FunctionContext; | ||
import org.apache.geode.cache.execute.FunctionException; | ||
import org.apache.geode.cache.execute.RegionFunctionContext; | ||
|
||
import java.util.Properties; | ||
|
||
/** | ||
* Function that returns the value of the key passed in through the filter, | ||
* using the default result collector. | ||
*/ | ||
public class UserExceptionFunction extends FunctionAdapter implements Declarable { | ||
|
||
private static final String ID = "GetKeyFunction"; | ||
|
||
public void execute(FunctionContext context) { | ||
throw new FunctionException("This is an user expected exception"); | ||
} | ||
|
||
public String getId() { | ||
return ID; | ||
} | ||
|
||
public boolean hasResult() { | ||
return true; | ||
} | ||
|
||
public void init(Properties p) { | ||
} | ||
public boolean isHA() { | ||
return false; | ||
} | ||
|
||
} | ||
|