CUBRID Engine  latest
lob_locator.hpp
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 // Lob locator interface
21 //
22 
23 #ifndef _LOB_LOCATOR_HPP_
24 #define _LOB_LOCATOR_HPP_
25 
26 /* there can be following transitions in transient lobs
27 
28  -------------------------------------------------------------------------
29  | locator | created | deleted |
30  |--------------------|-----------------------|--------------------------|
31  | in | transient | LOB_TRANSIENT_CREATED i LOB_UNKNOWN |
32  | tran |-----------|-----------------------|--------------------------|
33  | | permanent | LOB_PERMANENT_CREATED | LOB_PERMANENT_DELETED |
34  |--------------------|-----------------------|--------------------------|
35  | out of | transient | LOB_UNKNOWN | LOB_UNKNOWN |
36  | tran |-----------|-----------------------|--------------------------|
37  | | permanent | LOB_UNKNOWN | LOB_TRANSIENT_DELETED |
38  -------------------------------------------------------------------------
39 
40  s1: create a transient locator and delete it
41  LOB_TRANSIENT_CREATED -> LOB_UNKNOWN
42 
43  s2: create a transient locator and bind it to a row in table
44  LOB_TRANSIENT_CREATED -> LOB_PERMANENT_CREATED
45 
46  s3: bind a transient locator to a row and delete the locator
47  LOB_PERMANENT_CREATED -> LOB_PERMANENT_DELETED
48 
49  s4: delete a locator to be create out of transaction
50  LOB_UNKNOWN -> LOB_TRANSIENT_DELETED
51 
52  */
54 {
61 };
63 
64 LOB_LOCATOR_STATE lob_locator_find (const char *locator, char *real_locator);
65 int lob_locator_add (const char *locator, LOB_LOCATOR_STATE state);
66 int lob_locator_change_state (const char *locator, const char *new_locator, LOB_LOCATOR_STATE state);
67 int lob_locator_drop (const char *locator);
68 
69 bool lob_locator_is_valid (const char *locator);
70 const char *lob_locator_key (const char *locator); // pointer in locator to key
71 const char *lob_locator_meta (const char *locator); // pointer in locator to meta
72 
73 #endif // _LOB_LOCATOR_HPP_
const char * lob_locator_meta(const char *locator)
Definition: lob_locator.cpp:60
int lob_locator_change_state(const char *locator, const char *new_locator, LOB_LOCATOR_STATE state)
int lob_locator_drop(const char *locator)
const char * lob_locator_key(const char *locator)
Definition: lob_locator.cpp:54
LOB_LOCATOR_STATE lob_locator_find(const char *locator, char *real_locator)
Definition: lob_locator.cpp:72
enum lob_locator_state LOB_LOCATOR_STATE
Definition: lob_locator.hpp:62
int lob_locator_add(const char *locator, LOB_LOCATOR_STATE state)
Definition: lob_locator.cpp:88
lob_locator_state
Definition: lob_locator.hpp:53
bool lob_locator_is_valid(const char *locator)
Definition: lob_locator.cpp:37