Skip to content

File locator.c

FileList > cubrid > src > transaction > locator.c

Go to the source code of this file

  • #include "locator.h"
  • #include "config.h"
  • #include "porting.h"
  • #include "memory_alloc.h"
  • #include "oid.h"
  • #include "object_representation.h"
  • #include "error_manager.h"
  • #include "storage_common.h"
  • #include "connection_error.h"
  • #include "thread_compat.hpp"
  • #include "thread_manager.hpp"
  • #include <stdio.h>
  • #include <string.h>
  • #include <assert.h>
  • #include "memory_wrapper.hpp"

Classes

Type Name
struct locator_global
struct locator_global_copyareas
struct locator_global_lockhint_areas
struct locator_global_lockset_areas
struct locator_global_packed_areas

Public Types

Type Name
typedef struct locator_global LOCATOR_GLOBAL

Public Static Attributes

Type Name
bool locator_Is_initialized = [**false**](broker__monitor_8c.md#function-timeout)
LOCATOR_GLOBAL locator_Keep
LC_COPYAREA packed_req_area_ptrs

Public Functions

Type Name
LC_OIDMAP * locator_add_oid_set (THREAD_ENTRY * thread_p, LC_OIDSET * set, HFID * heap, OID * class_oid, OID * obj_oid)
LC_LOCKHINT * locator_allocate_and_unpack_lockhint (char * unpacked, int unpacked_size, bool unpack_classes, bool reg_unpacked)
LC_LOCKSET * locator_allocate_and_unpack_lockset (char * unpacked, int unpacked_size, bool unpack_classes, bool unpack_objects, bool reg_unpacked)
LC_COPYAREA * locator_allocate_copy_area_by_length (int min_length)
LC_COPYAREA * locator_allocate_copyarea (DKNPAGES npages)
LC_LOCKHINT * locator_allocate_lockhint (int max_classes, bool quit_on_errors)
LC_LOCKSET * locator_allocate_lockset (int max_reqobjs, LOCK reqobj_inst_lock, LOCK reqobj_class_lock, int quit_on_errors)
LC_LOCKSET * locator_allocate_lockset_by_length (int length)
void locator_clear_oid_set (THREAD_ENTRY * thread_p, LC_OIDSET * oidset)
void locator_dump_copy_area (FILE * out_fp, const LC_COPYAREA * copyarea, int print_rec)
void locator_dump_lockhint (FILE * out_fp, LC_LOCKHINT * lockhint)
void locator_dump_lockset (FILE * out_fp, LC_LOCKSET * lockset)
void locator_free_areas (void)
void locator_free_copy_area (LC_COPYAREA * copyarea)
void locator_free_lockhint (LC_LOCKHINT * lockhint)
void locator_free_lockset (LC_LOCKSET * lockset)
void locator_free_oid_set (THREAD_ENTRY * thread_p, LC_OIDSET * oidset)
void locator_free_packed (char * packed_area, int packed_size)
int locator_get_packed_oid_set_size (LC_OIDSET * oidset)
void locator_initialize_areas (void)
LC_OIDSET * locator_make_oid_set (void)
bool locator_manyobj_flag_is_set (LC_COPYAREA_MANYOBJS * copyarea, enum MULTI_UPDATE_FLAG muf)
void locator_manyobj_flag_remove (LC_COPYAREA_MANYOBJS * copyarea, enum MULTI_UPDATE_FLAG muf)
void locator_manyobj_flag_set (LC_COPYAREA_MANYOBJS * copyarea, enum MULTI_UPDATE_FLAG muf)
char * locator_pack_copy_area_descriptor (int num_objs, LC_COPYAREA * copyarea, char * desc, int desc_len)
int locator_pack_lockhint (LC_LOCKHINT * lockhint, bool pack_classes)
int locator_pack_lockset (LC_LOCKSET * lockset, bool pack_classes, bool pack_objects)
char * locator_pack_oid_set (char * buffer, LC_OIDSET * oidset)
LC_COPYAREA * locator_reallocate_copy_area_by_length (LC_COPYAREA * old_area, int new_length)
LC_LOCKHINT * locator_reallocate_lockhint (LC_LOCKHINT * lockhint, int max_classes)
LC_LOCKSET * locator_reallocate_lockset (LC_LOCKSET * lockset, int max_reqobjs)
LC_COPYAREA * locator_recv_allocate_copyarea (int num_objs, char ** contents_ptr, int contents_length)
int locator_send_copy_area (LC_COPYAREA * copyarea, char ** contents_ptr, int * contents_length, char ** desc_ptr, int * desc_length, bool encode_endian)
char * locator_unpack_copy_area_descriptor (int num_objs, LC_COPYAREA * copyarea, char * desc, int packed_desc_size)
int locator_unpack_lockhint (LC_LOCKHINT * lockhint, bool unpack_classes)
int locator_unpack_lockset (LC_LOCKSET * lockset, bool unpack_classes, bool unpack_objects)
bool locator_unpack_oid_set_to_exist (char * buffer, LC_OIDSET * use)
LC_OIDSET * locator_unpack_oid_set_to_new (THREAD_ENTRY * thread_p, char * buffer)

Public Static Functions

Type Name
char * locator_allocate_packed (int packed_size)
void locator_dump_copy_area_one_object (FILE * out_fp, LC_COPYAREA_ONEOBJ * obj, int obj_index, const LC_COPYAREA * copyarea, int print_rec)
void locator_dump_lockhint_classes (FILE * out_fp, LC_LOCKHINT * lockhint)
void locator_dump_lockhint_info (FILE * out_fp, LC_LOCKHINT * lockhint)
void locator_dump_lockset_area_info (FILE * out_fp, LC_LOCKSET * lockset)
void locator_dump_lockset_classes (FILE * out_fp, LC_LOCKSET * lockset)
void locator_dump_lockset_objects (FILE * out_fp, LC_LOCKSET * lockset)
void locator_dump_string (FILE * out_fp, char * dump_string, int length)
int locator_initialize_lockhint (LC_LOCKHINT * lockhint, int length, int max_classes, bool quit_on_errors)
int locator_initialize_lockset (LC_LOCKSET * lockset, int length, int max_reqobjs, LOCK reqobj_inst_lock, LOCK reqobj_class_lock, int quit_on_errors)
bool locator_is_hfid_equal (HFID * hfid1_p, HFID * hfid2_p)
char * locator_pack_lockhint_classes (char * packed, LC_LOCKHINT * lockhint)
char * locator_pack_lockhint_header (char * packed, LC_LOCKHINT * lockhint)
char * locator_pack_lockset_classes (char * packed, LC_LOCKSET * lockset)
char * locator_pack_lockset_header (char * packed, LC_LOCKSET * lockset)
char * locator_pack_lockset_objects (char * packed, LC_LOCKSET * lockset)
char * locator_reallocate_packed (char * packed, int packed_size)
char * locator_unpack_lockhint_classes (char * unpacked, LC_LOCKHINT * lockhint)
char * locator_unpack_lockhint_header (char * unpacked, LC_LOCKHINT * lockhint)
char * locator_unpack_lockset_classes (char * unpacked, LC_LOCKSET * lockset)
char * locator_unpack_lockset_header (char * unpacked, LC_LOCKSET * lockset)
char * locator_unpack_lockset_objects (char * unpacked, LC_LOCKSET * lockset)

Macros

Type Name
define LOCATOR_CACHED_COPYAREA_SIZE_LIMIT ([**IO\_MAX\_PAGE\_SIZE**](storage__common_8h.md#define-io_max_page_size) \* 2 + [**sizeof**](broker__monitor_8c.md#function-timeout) ([**LC\_COPYAREA**](locator_8h.md#typedef-lc_copyarea)))
define LOCATOR_NKEEP_LIMIT (200)

Public Types Documentation

typedef LOCATOR_GLOBAL

typedef struct locator_global LOCATOR_GLOBAL;

Public Static Attributes Documentation

variable locator_Is_initialized

bool locator_Is_initialized;

variable locator_Keep

LOCATOR_GLOBAL locator_Keep;

variable packed_req_area_ptrs

LC_COPYAREA packed_req_area_ptrs[(200)];

Public Functions Documentation

function locator_add_oid_set

LC_OIDMAP * locator_add_oid_set (
    THREAD_ENTRY * thread_p,
    LC_OIDSET * set,
    HFID * heap,
    OID * class_oid,
    OID * obj_oid
) 

function locator_allocate_and_unpack_lockhint

LC_LOCKHINT * locator_allocate_and_unpack_lockhint (
    char * unpacked,
    int unpacked_size,
    bool unpack_classes,
    bool reg_unpacked
) 

function locator_allocate_and_unpack_lockset

LC_LOCKSET * locator_allocate_and_unpack_lockset (
    char * unpacked,
    int unpacked_size,
    bool unpack_classes,
    bool unpack_objects,
    bool reg_unpacked
) 

function locator_allocate_copy_area_by_length

LC_COPYAREA * locator_allocate_copy_area_by_length (
    int min_length
) 

function locator_allocate_copyarea

LC_COPYAREA * locator_allocate_copyarea (
    DKNPAGES npages
) 

function locator_allocate_lockhint

LC_LOCKHINT * locator_allocate_lockhint (
    int max_classes,
    bool quit_on_errors
) 

function locator_allocate_lockset

LC_LOCKSET * locator_allocate_lockset (
    int max_reqobjs,
    LOCK reqobj_inst_lock,
    LOCK reqobj_class_lock,
    int quit_on_errors
) 

function locator_allocate_lockset_by_length

LC_LOCKSET * locator_allocate_lockset_by_length (
    int length
) 

function locator_clear_oid_set

void locator_clear_oid_set (
    THREAD_ENTRY * thread_p,
    LC_OIDSET * oidset
) 

function locator_dump_copy_area

void locator_dump_copy_area (
    FILE * out_fp,
    const  LC_COPYAREA * copyarea,
    int print_rec
) 

function locator_dump_lockhint

void locator_dump_lockhint (
    FILE * out_fp,
    LC_LOCKHINT * lockhint
) 

function locator_dump_lockset

void locator_dump_lockset (
    FILE * out_fp,
    LC_LOCKSET * lockset
) 

function locator_free_areas

void locator_free_areas (
    void
) 

function locator_free_copy_area

void locator_free_copy_area (
    LC_COPYAREA * copyarea
) 

function locator_free_lockhint

void locator_free_lockhint (
    LC_LOCKHINT * lockhint
) 

function locator_free_lockset

void locator_free_lockset (
    LC_LOCKSET * lockset
) 

function locator_free_oid_set

void locator_free_oid_set (
    THREAD_ENTRY * thread_p,
    LC_OIDSET * oidset
) 

function locator_free_packed

void locator_free_packed (
    char * packed_area,
    int packed_size
) 

function locator_get_packed_oid_set_size

int locator_get_packed_oid_set_size (
    LC_OIDSET * oidset
) 

function locator_initialize_areas

void locator_initialize_areas (
    void
) 

function locator_make_oid_set

LC_OIDSET * locator_make_oid_set (
    void
) 

function locator_manyobj_flag_is_set

bool locator_manyobj_flag_is_set (
    LC_COPYAREA_MANYOBJS * copyarea,
    enum  MULTI_UPDATE_FLAG muf
) 

function locator_manyobj_flag_remove

void locator_manyobj_flag_remove (
    LC_COPYAREA_MANYOBJS * copyarea,
    enum  MULTI_UPDATE_FLAG muf
) 

function locator_manyobj_flag_set

void locator_manyobj_flag_set (
    LC_COPYAREA_MANYOBJS * copyarea,
    enum  MULTI_UPDATE_FLAG muf
) 

function locator_pack_copy_area_descriptor

char * locator_pack_copy_area_descriptor (
    int num_objs,
    LC_COPYAREA * copyarea,
    char * desc,
    int desc_len
) 

function locator_pack_lockhint

int locator_pack_lockhint (
    LC_LOCKHINT * lockhint,
    bool pack_classes
) 

function locator_pack_lockset

int locator_pack_lockset (
    LC_LOCKSET * lockset,
    bool pack_classes,
    bool pack_objects
) 

function locator_pack_oid_set

char * locator_pack_oid_set (
    char * buffer,
    LC_OIDSET * oidset
) 

function locator_reallocate_copy_area_by_length

LC_COPYAREA * locator_reallocate_copy_area_by_length (
    LC_COPYAREA * old_area,
    int new_length
) 

function locator_reallocate_lockhint

LC_LOCKHINT * locator_reallocate_lockhint (
    LC_LOCKHINT * lockhint,
    int max_classes
) 

function locator_reallocate_lockset

LC_LOCKSET * locator_reallocate_lockset (
    LC_LOCKSET * lockset,
    int max_reqobjs
) 

function locator_recv_allocate_copyarea

LC_COPYAREA * locator_recv_allocate_copyarea (
    int num_objs,
    char ** contents_ptr,
    int contents_length
) 

function locator_send_copy_area

int locator_send_copy_area (
    LC_COPYAREA * copyarea,
    char ** contents_ptr,
    int * contents_length,
    char ** desc_ptr,
    int * desc_length,
    bool encode_endian
) 

function locator_unpack_copy_area_descriptor

char * locator_unpack_copy_area_descriptor (
    int num_objs,
    LC_COPYAREA * copyarea,
    char * desc,
    int packed_desc_size
) 

function locator_unpack_lockhint

int locator_unpack_lockhint (
    LC_LOCKHINT * lockhint,
    bool unpack_classes
) 

function locator_unpack_lockset

int locator_unpack_lockset (
    LC_LOCKSET * lockset,
    bool unpack_classes,
    bool unpack_objects
) 

function locator_unpack_oid_set_to_exist

bool locator_unpack_oid_set_to_exist (
    char * buffer,
    LC_OIDSET * use
) 

function locator_unpack_oid_set_to_new

LC_OIDSET * locator_unpack_oid_set_to_new (
    THREAD_ENTRY * thread_p,
    char * buffer
) 

Public Static Functions Documentation

function locator_allocate_packed

static char * locator_allocate_packed (
    int packed_size
) 

function locator_dump_copy_area_one_object

static void locator_dump_copy_area_one_object (
    FILE * out_fp,
    LC_COPYAREA_ONEOBJ * obj,
    int obj_index,
    const  LC_COPYAREA * copyarea,
    int print_rec
) 

function locator_dump_lockhint_classes

static void locator_dump_lockhint_classes (
    FILE * out_fp,
    LC_LOCKHINT * lockhint
) 

function locator_dump_lockhint_info

static void locator_dump_lockhint_info (
    FILE * out_fp,
    LC_LOCKHINT * lockhint
) 

function locator_dump_lockset_area_info

static void locator_dump_lockset_area_info (
    FILE * out_fp,
    LC_LOCKSET * lockset
) 

function locator_dump_lockset_classes

static void locator_dump_lockset_classes (
    FILE * out_fp,
    LC_LOCKSET * lockset
) 

function locator_dump_lockset_objects

static void locator_dump_lockset_objects (
    FILE * out_fp,
    LC_LOCKSET * lockset
) 

function locator_dump_string

static void locator_dump_string (
    FILE * out_fp,
    char * dump_string,
    int length
) 

function locator_initialize_lockhint

static int locator_initialize_lockhint (
    LC_LOCKHINT * lockhint,
    int length,
    int max_classes,
    bool quit_on_errors
) 

function locator_initialize_lockset

static int locator_initialize_lockset (
    LC_LOCKSET * lockset,
    int length,
    int max_reqobjs,
    LOCK reqobj_inst_lock,
    LOCK reqobj_class_lock,
    int quit_on_errors
) 

function locator_is_hfid_equal

static bool locator_is_hfid_equal (
    HFID * hfid1_p,
    HFID * hfid2_p
) 

function locator_pack_lockhint_classes

static char * locator_pack_lockhint_classes (
    char * packed,
    LC_LOCKHINT * lockhint
) 

function locator_pack_lockhint_header

static char * locator_pack_lockhint_header (
    char * packed,
    LC_LOCKHINT * lockhint
) 

function locator_pack_lockset_classes

static char * locator_pack_lockset_classes (
    char * packed,
    LC_LOCKSET * lockset
) 

function locator_pack_lockset_header

static char * locator_pack_lockset_header (
    char * packed,
    LC_LOCKSET * lockset
) 

function locator_pack_lockset_objects

static char * locator_pack_lockset_objects (
    char * packed,
    LC_LOCKSET * lockset
) 

function locator_reallocate_packed

static char * locator_reallocate_packed (
    char * packed,
    int packed_size
) 

function locator_unpack_lockhint_classes

static char * locator_unpack_lockhint_classes (
    char * unpacked,
    LC_LOCKHINT * lockhint
) 

function locator_unpack_lockhint_header

static char * locator_unpack_lockhint_header (
    char * unpacked,
    LC_LOCKHINT * lockhint
) 

function locator_unpack_lockset_classes

static char * locator_unpack_lockset_classes (
    char * unpacked,
    LC_LOCKSET * lockset
) 

function locator_unpack_lockset_header

static char * locator_unpack_lockset_header (
    char * unpacked,
    LC_LOCKSET * lockset
) 

function locator_unpack_lockset_objects

static char * locator_unpack_lockset_objects (
    char * unpacked,
    LC_LOCKSET * lockset
) 

Macro Definition Documentation

define LOCATOR_CACHED_COPYAREA_SIZE_LIMIT

#define LOCATOR_CACHED_COPYAREA_SIZE_LIMIT `( IO_MAX_PAGE_SIZE * 2 + sizeof ( LC_COPYAREA ))`

define LOCATOR_NKEEP_LIMIT

#define LOCATOR_NKEEP_LIMIT `(200)`


The documentation for this class was generated from the following file cubrid/src/transaction/locator.c