Motr  M0
iscdemo.c File Reference
#include <unistd.h>
#include "lib/memory.h"
#include "rpc/conn.h"
#include "rpc/session.h"
#include "xcode/xcode.h"
#include "conf/schema.h"
#include "layout/layout.h"
#include "layout/plan.h"
#include "motr/client.h"
#include "util.h"
#include "common.h"
#include "libdemo.h"
#include "libdemo_xc.h"
Include dependency graph for iscdemo.c:

Go to the source code of this file.

Enumerations

enum  isc_comp_type { ICT_PING, ICT_MIN, ICT_MAX }
 
enum  elm_order { ELM_FIRST, ELM_LAST }
 

Functions

static int op_type_parse (const char *op_name)
 
static int minmax_input_prepare (struct m0_buf *out, struct m0_fid *comp_fid, struct m0_layout_io_plop *iop, uint32_t *reply_len, enum isc_comp_type type)
 
static int ping_input_prepare (struct m0_buf *buf, struct m0_fid *comp_fid, uint32_t *reply_len, enum isc_comp_type type)
 
static int input_prepare (struct m0_buf *buf, struct m0_fid *comp_fid, struct m0_layout_io_plop *iop, uint32_t *reply_len, enum isc_comp_type type)
 
static struct mm_resultop_result (struct mm_result *x, struct mm_result *y, enum isc_comp_type op_type)
 
static void set_idx (struct mm_result *res, enum elm_order e)
 
static void check_edge_val (struct mm_result *res, enum elm_order e, enum isc_comp_type type)
 
static void mm_result_free_xcode_bufs (struct mm_result *r)
 
static void * minmax_output_prepare (struct m0_buf *result, bool last_unit, struct mm_result *prev, enum isc_comp_type type)
 
static void * output_process (struct m0_buf *result, bool last, void *out, enum isc_comp_type type)
 
static void usage ()
 
int read_id (const char *s, struct m0_uint128 *id)
 
int launch_comp (struct m0_layout_plan *plan, int op_type, bool last)
 
static int open_entity (struct m0_entity *entity)
 
int main (int argc, char **argv)
 

Variables

char * prog
 
const char * help_str
 

Enumeration Type Documentation

◆ elm_order

enum elm_order
Enumerator
ELM_FIRST 
ELM_LAST 

Definition at line 201 of file iscdemo.c.

◆ isc_comp_type

Enumerator
ICT_PING 
ICT_MIN 
ICT_MAX 

Definition at line 38 of file iscdemo.c.

Function Documentation

◆ check_edge_val()

static void check_edge_val ( struct mm_result res,
enum elm_order  e,
enum isc_comp_type  type 
)
static

Process the first or the last values in the first or last results.

Definition at line 217 of file iscdemo.c.

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

◆ input_prepare()

static int input_prepare ( struct m0_buf buf,
struct m0_fid comp_fid,
struct m0_layout_io_plop iop,
uint32_t *  reply_len,
enum isc_comp_type  type 
)
static

Definition at line 112 of file iscdemo.c.

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

◆ launch_comp()

int launch_comp ( struct m0_layout_plan plan,
int  op_type,
bool  last 
)

Definition at line 365 of file iscdemo.c.

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

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 469 of file iscdemo.c.

Here is the call graph for this function:

◆ minmax_input_prepare()

static int minmax_input_prepare ( struct m0_buf out,
struct m0_fid comp_fid,
struct m0_layout_io_plop iop,
uint32_t *  reply_len,
enum isc_comp_type  type 
)
static

Definition at line 59 of file iscdemo.c.

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

◆ minmax_output_prepare()

static void* minmax_output_prepare ( struct m0_buf result,
bool  last_unit,
struct mm_result prev,
enum isc_comp_type  type 
)
static

Definition at line 255 of file iscdemo.c.

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

◆ mm_result_free_xcode_bufs()

static void mm_result_free_xcode_bufs ( struct mm_result r)
static

Definition at line 249 of file iscdemo.c.

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

◆ op_result()

static struct mm_result* op_result ( struct mm_result x,
struct mm_result y,
enum isc_comp_type  op_type 
)
static

Compute the final result from two results received from the server.

Definition at line 131 of file iscdemo.c.

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

◆ op_type_parse()

static int op_type_parse ( const char *  op_name)
static

Definition at line 44 of file iscdemo.c.

Here is the caller graph for this function:

◆ open_entity()

static int open_entity ( struct m0_entity entity)
static

Definition at line 454 of file iscdemo.c.

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

◆ output_process()

static void* output_process ( struct m0_buf result,
bool  last,
void *  out,
enum isc_comp_type  type 
)
static

Deserialize the buffer at

Returns
and do the final computation, taking into account the previous result , and return the new one. indicates the last result to be processed.

Definition at line 301 of file iscdemo.c.

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

◆ ping_input_prepare()

static int ping_input_prepare ( struct m0_buf buf,
struct m0_fid comp_fid,
uint32_t *  reply_len,
enum isc_comp_type  type 
)
static

Definition at line 95 of file iscdemo.c.

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

◆ read_id()

int read_id ( const char *  s,
struct m0_uint128 id 
)

Read obj id in the format [hi:]lo. Return how many numbers were read.

Definition at line 348 of file iscdemo.c.

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

◆ set_idx()

static void set_idx ( struct mm_result res,
enum elm_order  e 
)
static

Definition at line 206 of file iscdemo.c.

Here is the caller graph for this function:

◆ usage()

static void usage ( void  )
static

Definition at line 338 of file iscdemo.c.

Here is the caller graph for this function:

Variable Documentation

◆ help_str

const char* help_str
Initial value:
= "\
\n\
Usage: %s OPTIONS COMP OBJ_ID LEN\n\
\n\
Supported COMPutations: ping, min, max\n\
\n\
OBJ_ID is two uint64 numbers in hi:lo format (dec or hex)\n\
LEN is the length of object (in KiB)\n\
\n\
Motr-related mandatory options:\n\
-e <addr> endpoint address\n\
-x <addr> ha-agent (hax) endpoint address\n\
-f <fid> process fid\n\
-p <fid> profile fid\n\
\n\
Other non-mandatory options:\n\
-v increase verbosity (-vv to increase even more)\n\
-h this help\n\
\n"

Definition at line 318 of file iscdemo.c.

◆ prog

char* prog

Definition at line 316 of file iscdemo.c.