CUBRID Engine  latest
compactdb.c File Reference
#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include "porting.h"
#include "dbtype.h"
#include "load_object.h"
#include "db.h"
#include "locator_cl.h"
#include "locator_sr.h"
#include "schema_manager.h"
#include "heap_file.h"
#include "system_catalog.h"
#include "object_accessor.h"
#include "set_object.h"
#include "btree.h"
#include "message_catalog.h"
#include "network_interface_cl.h"
#include "server_interface.h"
#include "system_parameter.h"
#include "utility.h"
#include "authenticate.h"
#include "transaction_cl.h"
#include "thread_manager.hpp"

Go to the source code of this file.

Functions

static int compactdb_start (bool verbose_flag, char *input_filename, char **input_class_name, int input_class_length)
 
static void process_class (THREAD_ENTRY *thread_p, DB_OBJECT *class_, bool verbose_flag)
 
static void process_object (THREAD_ENTRY *thread_p, DESC_OBJ *desc_obj, OID *obj_oid, bool verbose_flag)
 
static int process_set (THREAD_ENTRY *thread_p, DB_SET *set)
 
static int process_value (THREAD_ENTRY *thread_p, DB_VALUE *value)
 
static DB_OBJECTis_class (OID *obj_oid, OID *class_oid)
 
static int disk_update_instance (MOP classop, DESC_OBJ *obj, OID *oid)
 
static RECDESalloc_recdes (int length)
 
static void free_recdes (RECDES *rec)
 
static void disk_init (void)
 
static void disk_final (void)
 
static int update_indexes (OID *class_oid, OID *obj_oid, RECDES *rec)
 
static void compact_usage (const char *argv0)
 
int get_class_mops (char **class_names, int num_class, MOP **class_list, int *num_class_list)
 
int get_class_mops_from_file (const char *input_filename, MOP **class_list, int *num_class_mops)
 
int compactdb (UTIL_FUNCTION_ARG *arg)
 

Variables

static int class_objects = 0
 
static int total_objects = 0
 
static int failed_objects = 0
 
static RECDESDiskrec = NULL
 

Function Documentation

static RECDES * alloc_recdes ( int  length)
static

Definition at line 718 of file compactdb.c.

References recdes::area_size, recdes::data, recdes::length, NULL, and recdes::type.

Referenced by disk_init(), and disk_update_instance().

Here is the caller graph for this function:

static void compact_usage ( const char *  argv0)
static

Definition at line 83 of file compactdb.c.

References basename(), MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_GENERIC_INVALID_ARGUMENT, MSGCAT_UTIL_SET_COMPACTDB, and util_log_write_errid().

Referenced by compactdb().

Here is the caller graph for this function:

int compactdb ( UTIL_FUNCTION_ARG arg)

Definition at line 98 of file compactdb.c.

static void disk_final ( void  )
static

Definition at line 758 of file compactdb.c.

References free_recdes(), and NULL.

Referenced by compactdb_start().

Here is the caller graph for this function:

static void disk_init ( void  )
static

Definition at line 748 of file compactdb.c.

References alloc_recdes(), and DB_PAGESIZE.

Referenced by compactdb_start().

Here is the caller graph for this function:

static void free_recdes ( RECDES rec)
static

Definition at line 738 of file compactdb.c.

References free_and_init.

Referenced by disk_final(), and disk_update_instance().

Here is the caller graph for this function:

int get_class_mops ( char **  class_names,
int  num_class,
MOP **  class_list,
int *  num_class_list 
)

Definition at line 93 of file compactdb_common.c.

Referenced by compactdb_start().

Here is the caller graph for this function:

int get_class_mops_from_file ( const char *  input_filename,
MOP **  class_list,
int *  num_class_mops 
)

Definition at line 165 of file compactdb_common.c.

Referenced by compactdb_start().

Here is the caller graph for this function:

static int process_set ( THREAD_ENTRY thread_p,
DB_SET set 
)
static

Definition at line 612 of file compactdb.c.

References 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:

static int update_indexes ( OID class_oid,
OID obj_oid,
RECDES rec 
)
static

Variable Documentation

int class_objects = 0
static

Definition at line 55 of file compactdb.c.

Referenced by process_class().

RECDES* Diskrec = NULL
static

Definition at line 58 of file compactdb.c.

int failed_objects = 0
static

Definition at line 57 of file compactdb.c.

Referenced by compactdb_start(), process_class(), and sboot_compact_db().

int total_objects = 0
static

Definition at line 56 of file compactdb.c.

Referenced by compactdb_start(), process_class(), and sboot_compact_db().