+static struct fio_option options[] = {
+ {
+ .name = "namenode",
+ .lname = "hfds namenode",
+ .type = FIO_OPT_STR_STORE,
+ .off1 = offsetof(struct hdfsio_options, host),
+ .def = "localhost",
+ .help = "Namenode of the HDFS cluster",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_HDFS,
+ },
+ {
+ .name = "hostname",
+ .lname = "hfds namenode",
+ .type = FIO_OPT_STR_STORE,
+ .off1 = offsetof(struct hdfsio_options, host),
+ .def = "localhost",
+ .help = "Namenode of the HDFS cluster",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_HDFS,
+ },
+ {
+ .name = "port",
+ .lname = "hdfs namenode port",
+ .type = FIO_OPT_INT,
+ .off1 = offsetof(struct hdfsio_options, port),
+ .def = "9000",
+ .minval = 1,
+ .maxval = 65535,
+ .help = "Port used by the HDFS cluster namenode",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_HDFS,
+ },
+ {
+ .name = "hdfsdirectory",
+ .lname = "hfds directory",
+ .type = FIO_OPT_STR_STORE,
+ .off1 = offsetof(struct hdfsio_options, directory),
+ .def = "/",
+ .help = "The HDFS directory where fio will create chuncks",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_HDFS,
+ },
+ {
+ .name = "chunck_size",
+ .type = FIO_OPT_INT,
+ .off1 = offsetof(struct hdfsio_options, chunck_size),
+ .def = "1048576",
+ .help = "Size of individual chunck",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_HDFS,
+ },
+ {
+ .name = "single_instance",
+ .type = FIO_OPT_BOOL,
+ .off1 = offsetof(struct hdfsio_options, single_instance),
+ .def = "1",
+ .help = "Use a single instance",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_HDFS,
+ },
+ {
+ .name = "hdfs_use_direct",
+ .type = FIO_OPT_BOOL,
+ .off1 = offsetof(struct hdfsio_options, use_direct),
+ .def = "0",
+ .help = "Use readDirect instead of hdfsRead",
+ .category = FIO_OPT_C_ENGINE,
+ .group = FIO_OPT_G_HDFS,
+ },
+ {
+ .name = NULL,
+ },
+};
+
+
+static int get_chunck_name(char *dest, char *file_name, uint64_t chunk_id) {
+ return snprintf(dest, CHUNCK_NAME_LENGTH_MAX, "%s_%lu", file_name, chunk_id);