CUBRID Engine  latest
javasp.cpp File Reference
#include "config.h"
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netdb.h>
#include <signal.h>
#include "environment_variable.h"
#include "system_parameter.h"
#include "error_code.h"
#include "error_manager.h"
#include "message_catalog.h"
#include "utility.h"
#include "databases_file.h"
#include "object_representation.h"
#include "jsp_comm.h"
#include "jsp_file.h"
#include "jsp_sr.h"
#include <string>
#include <algorithm>
#include <array>

Go to the source code of this file.

Macros

#define JAVASP_PING_LEN   PATH_MAX
 
#define JAVASP_PRINT_ERR_MSG(...)
 
#define NULL_DEVICE   "/dev/null"
 

Functions

static int javasp_start_server (const JAVASP_SERVER_INFO jsp_info, const std::string &db_name, const std::string &path)
 
static int javasp_stop_server (const JAVASP_SERVER_INFO jsp_info, const std::string &db_name)
 
static int javasp_status_server (const JAVASP_SERVER_INFO jsp_info)
 
static void javasp_dump_status (FILE *fp, JAVASP_STATUS_INFO status_info)
 
static int javasp_ping_server (const int server_port, char *buf)
 
static bool javasp_is_running (const int server_port, const std::string &db_name)
 
static bool javasp_is_terminated_process (int pid)
 
static void javasp_terminate_process (int pid)
 
static int javasp_get_server_info (const std::string &db_name, JAVASP_SERVER_INFO &info)
 
static int javasp_check_argument (int argc, char *argv[], std::string &command, std::string &db_name)
 
static int javasp_check_database (const std::string &db_name, std::string &db_path)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

#define JAVASP_PING_LEN   PATH_MAX

Definition at line 69 of file javasp.cpp.

Referenced by javasp_is_running(), and main().

#define JAVASP_PRINT_ERR_MSG (   ...)
Value:
do {\
fprintf (stderr, __VA_ARGS__);\
}while (0)

Definition at line 71 of file javasp.cpp.

Referenced by javasp_check_argument(), and main().

#define NULL_DEVICE   "/dev/null"

Definition at line 79 of file javasp.cpp.

Referenced by main().

Function Documentation

static int javasp_check_argument ( int  argc,
char *  argv[],
std::string &  command,
std::string &  db_name 
)
static

Definition at line 600 of file javasp.cpp.

References ER_GENERIC_ERROR, JAVASP_PRINT_ERR_MSG, and NO_ERROR.

Referenced by main().

Here is the caller graph for this function:

static int javasp_check_database ( const std::string &  db_name,
std::string &  db_path 
)
static

Definition at line 580 of file javasp.cpp.

References cfg_find_db(), cfg_free_directory(), ER_GENERIC_ERROR, NO_ERROR, NULL, and database_info::pathname.

Referenced by main().

Here is the caller graph for this function:

static void javasp_dump_status ( FILE *  fp,
JAVASP_STATUS_INFO  status_info 
)
static

Definition at line 481 of file javasp.cpp.

References javasp_status_info::db_name, i, javasp_status_info::pid, javasp_status_info::port, and javasp_status_info::vm_args.

Referenced by javasp_status_server().

Here is the caller graph for this function:

static int javasp_get_server_info ( const std::string &  db_name,
JAVASP_SERVER_INFO info 
)
static

Definition at line 566 of file javasp.cpp.

References ER_GENERIC_ERROR, javasp_open_info_dir(), javasp_read_info(), and NO_ERROR.

Referenced by main().

Here is the caller graph for this function:

static bool javasp_is_running ( const int  server_port,
const std::string &  db_name 
)
static

Definition at line 499 of file javasp.cpp.

References JAVASP_PING_LEN, javasp_ping_server(), and NO_ERROR.

Referenced by javasp_start_server().

Here is the caller graph for this function:

static bool javasp_is_terminated_process ( int  pid)
static

Definition at line 521 of file javasp.cpp.

References FALSE, and NULL.

Referenced by javasp_stop_server().

Here is the caller graph for this function:

static int javasp_ping_server ( const int  server_port,
char *  buf 
)
static
static int javasp_start_server ( const JAVASP_SERVER_INFO  jsp_info,
const std::string &  db_name,
const std::string &  path 
)
static
static int javasp_stop_server ( const JAVASP_SERVER_INFO  jsp_info,
const std::string &  db_name 
)
static
static void javasp_terminate_process ( int  pid)
static

Definition at line 549 of file javasp.cpp.

References FALSE.

Referenced by javasp_stop_server().

Here is the caller graph for this function: