CUBRID Engine  latest
compactdb_sr.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include "btree.h"
#include "thread_compat.hpp"
#include "heap_file.h"
#include "dbtype.h"
#include "boot_sr.h"
#include "locator_sr.h"
#include "set_object.h"
#include "xserver_interface.h"
#include "server_interface.h"
Include dependency graph for compactdb_sr.c:

Go to the source code of this file.

Functions

static bool is_class (OID *obj_oid, OID *class_oid)
 
static int process_set (THREAD_ENTRY *thread_p, DB_SET *set)
 
static int process_value (THREAD_ENTRY *thread_p, DB_VALUE *value)
 
static int process_object (THREAD_ENTRY *thread_p, HEAP_SCANCACHE *upd_scancache, HEAP_CACHE_ATTRINFO *attr_info, OID *oid)
 
static int desc_disk_to_attr_info (THREAD_ENTRY *thread_p, OID *oid, RECDES *recdes, HEAP_CACHE_ATTRINFO *attr_info)
 
static int process_class (THREAD_ENTRY *thread_p, OID *class_oid, HFID *hfid, int max_space_to_process, int *instance_lock_timeout, int *space_to_process, OID *last_processed_oid, int *total_objects, int *failed_objects, int *modified_objects, int *big_objects)
 
int boot_compact_db (THREAD_ENTRY *thread_p, OID *class_oids, int n_classes, int space_to_process, int instance_lock_timeout, int class_lock_timeout, bool delete_old_repr, OID *last_processed_class_oid, OID *last_processed_oid, int *total_objects, int *failed_objects, int *modified_objects, int *big_objects, int *initial_last_repr_id)
 
int boot_heap_compact_pages (THREAD_ENTRY *thread_p, OID *class_oid)
 
int boot_compact_start (THREAD_ENTRY *thread_p)
 
int boot_compact_stop (THREAD_ENTRY *thread_p)
 
bool boot_can_compact (THREAD_ENTRY *thread_p)
 

Variables

static bool compact_started = false
 
static int last_tran_index = -1
 

Function Documentation

bool boot_can_compact ( THREAD_ENTRY thread_p)
int boot_compact_db ( THREAD_ENTRY thread_p,
OID class_oids,
int  n_classes,
int  space_to_process,
int  instance_lock_timeout,
int  class_lock_timeout,
bool  delete_old_repr,
OID last_processed_class_oid,
OID last_processed_oid,
int *  total_objects,
int *  failed_objects,
int *  modified_objects,
int *  big_objects,
int *  initial_last_repr_id 
)
int boot_compact_start ( THREAD_ENTRY thread_p)
int boot_compact_stop ( THREAD_ENTRY thread_p)
int boot_heap_compact_pages ( THREAD_ENTRY thread_p,
OID class_oid 
)

Definition at line 679 of file compactdb_sr.c.

References boot_can_compact(), ER_COMPACTDB_ALREADY_STARTED, and heap_compact_pages().

Referenced by xboot_heap_compact().

Here is the caller graph for this function:

static int desc_disk_to_attr_info ( THREAD_ENTRY thread_p,
OID oid,
RECDES recdes,
HEAP_CACHE_ATTRINFO attr_info 
)
static

Definition at line 296 of file compactdb_sr.c.

References ER_FAILED, heap_attrinfo_clear_dbvalues(), heap_attrinfo_read_dbvalues(), NO_ERROR, and NULL.

Referenced by process_class().

Here is the caller graph for this function:

static bool is_class ( OID obj_oid,
OID class_oid 
)
static

Definition at line 67 of file compactdb_sr.c.

References OID_EQ, and oid_Root_class_oid.

Referenced by process_value().

Here is the caller graph for this function:

static int process_class ( THREAD_ENTRY thread_p,
OID class_oid,
HFID hfid,
int  max_space_to_process,
int *  instance_lock_timeout,
int *  space_to_process,
OID last_processed_oid,
int *  total_objects,
int *  failed_objects,
int *  modified_objects,
int *  big_objects 
)
static
static int process_set ( THREAD_ENTRY thread_p,
DB_SET set 
)
static

Definition at line 156 of file compactdb_sr.c.

References NO_ERROR, NULL, process_value(), set_iterate(), set_iterator_free(), set_iterator_next(), and set_iterator_value().

Referenced by process_value().

Here is the caller graph for this function:

Variable Documentation

bool compact_started = false
static

Definition at line 44 of file compactdb_sr.c.

Referenced by boot_can_compact(), boot_compact_start(), and boot_compact_stop().

int last_tran_index = -1
static

Definition at line 45 of file compactdb_sr.c.

Referenced by boot_can_compact(), boot_compact_start(), and boot_compact_stop().