Motr  M0
parser.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
#include <stdarg.h>
#include "motr/m0crate/parser.h"
#include "motr/m0crate/crate_client.h"
Include dependency graph for parser.c:

Go to the source code of this file.

Data Structures

struct  key_lookup_table
 

Macros

#define NKEYS   (sizeof(lookuptable)/sizeof(struct key_lookup_table))
 
#define SIZEOF_CWIDX   sizeof(struct m0_workload_index)
 
#define SIZEOF_CWIO   sizeof(struct m0_workload_io)
 
#define workload_index(t)   (t->u.cw_index)
 
#define workload_io(t)   (t->u.cw_io)
 

Enumerations

enum  cr_kvs_key_len_max { MAX_KEY_LEN = 128 }
 
enum  config_key_val {
  INVALID_OPT = -1, LOCAL_ADDR, HA_ADDR, PROF,
  LAYOUT_ID, IS_OOSTORE, IS_READ_VERIFY, MAX_QUEUE_LEN,
  MAX_RPC_MSG, PROCESS_FID, IDX_SERVICE_ID, CASS_EP,
  CASS_KEYSPACE, CASS_COL_FAMILY, ADDB_INIT, ADDB_SIZE,
  LOG_LEVEL, WORKLOAD_TYPE, POOL_FID, SEED,
  NR_THREADS, NUM_OPS, NR_OBJS, NUM_IDX,
  NUM_KVP, PUT, GET, NEXT,
  DEL, NXRECORDS, OP_COUNT, EXEC_TIME,
  WARMUP_PUT_CNT, WARMUP_DEL_RATIO, KEY_PREFIX, KEY_ORDER,
  KEY_SIZE, VALUE_SIZE, MAX_KEY_SIZE, MAX_VALUE_SIZE,
  INDEX_FID, THREAD_OPS, BLOCK_SIZE, BLOCKS_PER_OP,
  IOSIZE, SOURCE_FILE, RAND_IO, OPCODE,
  START_OBJ_ID, MODE, MAX_NR_OPS, NR_ROUNDS
}
 

Functions

enum config_key_val get_index_from_key (char *key)
 
const char * get_key_from_index (const enum config_key_val key)
 
void parser_emit_error (const char *fmt,...) __attribute__((no_exit)) __attribute__((format(printf
 
static int parse_int_with_units (const char *value, enum config_key_val tag)
 
static int parse_int (const char *value, enum config_key_val tag)
 
int copy_value (struct workload *load, int max_workload, int *index, char *key, char *value)
 
int parse_yaml_file (struct workload *load, int max_workload, int *index, char *config_file)
 

Variables

struct workload_type_ops ops
 
struct workload_type_ops index_ops
 
struct crate_confconf
 
struct key_lookup_table lookuptable []
 
const char conf_section_name [] = "MOTR_CONFIG"
 

Macro Definition Documentation

◆ NKEYS

#define NKEYS   (sizeof(lookuptable)/sizeof(struct key_lookup_table))

Definition at line 162 of file parser.c.

◆ SIZEOF_CWIDX

#define SIZEOF_CWIDX   sizeof(struct m0_workload_index)

Definition at line 235 of file parser.c.

◆ SIZEOF_CWIO

#define SIZEOF_CWIO   sizeof(struct m0_workload_io)

Definition at line 236 of file parser.c.

◆ workload_index

#define workload_index (   t)    (t->u.cw_index)

Definition at line 238 of file parser.c.

◆ workload_io

#define workload_io (   t)    (t->u.cw_io)

Definition at line 239 of file parser.c.

Enumeration Type Documentation

◆ config_key_val

Enumerator
INVALID_OPT 
LOCAL_ADDR 
HA_ADDR 
PROF 
LAYOUT_ID 
IS_OOSTORE 
IS_READ_VERIFY 
MAX_QUEUE_LEN 
MAX_RPC_MSG 
PROCESS_FID 
IDX_SERVICE_ID 
CASS_EP 
CASS_KEYSPACE 
CASS_COL_FAMILY 
ADDB_INIT 
ADDB_SIZE 
LOG_LEVEL 
WORKLOAD_TYPE 
POOL_FID 
SEED 
NR_THREADS 
NUM_OPS 
NR_OBJS 
NUM_IDX 
NUM_KVP 
PUT 
GET 
NEXT 
DEL 
NXRECORDS 
OP_COUNT 
EXEC_TIME 
WARMUP_PUT_CNT 
WARMUP_DEL_RATIO 
KEY_PREFIX 
KEY_ORDER 
KEY_SIZE 
VALUE_SIZE 
MAX_KEY_SIZE 
MAX_VALUE_SIZE 
INDEX_FID 
THREAD_OPS 
BLOCK_SIZE 
BLOCKS_PER_OP 
IOSIZE 
SOURCE_FILE 
RAND_IO 
OPCODE 
START_OBJ_ID 
MODE 
MAX_NR_OPS 
NR_ROUNDS 

Definition at line 40 of file parser.c.

◆ cr_kvs_key_len_max

Enumerator
MAX_KEY_LEN 

Definition at line 32 of file parser.c.

Function Documentation

◆ copy_value()

int copy_value ( struct workload load,
int  max_workload,
int *  index,
char *  key,
char *  value 
)

Definition at line 243 of file parser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_index_from_key()

enum config_key_val get_index_from_key ( char *  key)

Definition at line 164 of file parser.c.

Here is the caller graph for this function:

◆ get_key_from_index()

const char* get_key_from_index ( const enum config_key_val  key)

Definition at line 178 of file parser.c.

Here is the caller graph for this function:

◆ parse_int()

static int parse_int ( const char *  value,
enum config_key_val  tag 
)
static

Definition at line 217 of file parser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_int_with_units()

static int parse_int_with_units ( const char *  value,
enum config_key_val  tag 
)
static

Definition at line 207 of file parser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parser_emit_error()

void void parser_emit_error ( const char *  fmt,
  ... 
)

Definition at line 197 of file parser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ conf_section_name

const char conf_section_name[] = "MOTR_CONFIG"

Definition at line 241 of file parser.c.

◆ index_ops

struct workload_type_ops index_ops

◆ lookuptable

struct key_lookup_table lookuptable[]

Definition at line 105 of file parser.c.