CUBRID Engine  latest
shard_key.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * shard_key.h -
21  */
22 
23 #ifndef _SHARD_KEY_H_
24 #define _SHARD_KEY_H_
25 
26 #ident "$Id$"
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 /************************************************************************
34  * IMPORTED SYSTEM HEADER FILES *
35  ************************************************************************/
36 
37 /************************************************************************
38  * IMPORTED OTHER HEADER FILES *
39  ************************************************************************/
40 
41 /************************************************************************
42  * EXPORTED DEFINITIONS *
43  ************************************************************************/
44 
45  typedef enum
46  {
50 
79 
82 
83 #define ERROR_ON_ARGUMENT -1
84 #define ERROR_ON_MAKE_SHARD_KEY -2
85 
86 /*
87  return value :
88  success - shard key id(>0)
89  fail - invalid argument(ERROR_ON_ARGUMENT), shard key id make fail(ERROR_ON_MAKE_SHARD_KEY)
90  type : shard key value type
91  val : shard key value
92  */
93  typedef int (*FN_GET_SHARD_KEY) (const char *shard_key, T_SHARD_U_TYPE type, const void *val, int val_size);
94 
95 /************************************************************************
96  * EXPORTED VARIABLES *
97  ************************************************************************/
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif /* _SHARD_KEY_H_ */
int(* FN_GET_SHARD_KEY)(const char *shard_key, T_SHARD_U_TYPE type, const void *val, int val_size)
Definition: shard_key.h:93
T_SHARD_U_TYPE
Definition: shard_key.h:45