#include <hdfs.h>
#include "../fio.h"
-
+#include "../optgroup.h"
#define CHUNCK_NAME_LENGTH_MAX 80
#define CHUNCK_CREATION_BUFFER_SIZE 65536
.group = FIO_OPT_G_HDFS,
},
{
- .name = "chunck_size",
+ .name = "chunk_size",
+ .alias = "chunck_size",
+ .lname = "Chunk size",
.type = FIO_OPT_INT,
.off1 = offsetof(struct hdfsio_options, chunck_size),
.def = "1048576",
},
{
.name = "single_instance",
+ .lname = "Single Instance",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct hdfsio_options, single_instance),
.def = "1",
},
{
.name = "hdfs_use_direct",
+ .lname = "HDFS Use Direct",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct hdfsio_options, use_direct),
.def = "0",
static int fio_hdfsio_prep(struct thread_data *td, struct io_u *io_u)
{
struct hdfsio_options *options = td->eo;
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
unsigned long f_id;
char fname[CHUNCK_NAME_LENGTH_MAX];
int open_flags;
static int fio_hdfsio_queue(struct thread_data *td, struct io_u *io_u)
{
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
struct hdfsio_options *options = td->eo;
int ret;
unsigned long offset;
int fio_hdfsio_close_file(struct thread_data *td, struct fio_file *f)
{
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
if (hd->curr_file_id != -1) {
if ( hdfsCloseFile(hd->fs, hd->fp) == -1) {
static int fio_hdfsio_init(struct thread_data *td)
{
struct hdfsio_options *options = td->eo;
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
struct fio_file *f;
uint64_t j,k;
int i, failure = 0;
int i;
uint64_t file_size, total_file_size;
- if (!td->io_ops->data) {
+ if (!td->io_ops_data) {
hd = malloc(sizeof(*hd));
memset(hd, 0, sizeof(*hd));
hd->curr_file_id = -1;
- td->io_ops->data = hd;
+ td->io_ops_data = hd;
}
total_file_size = 0;
static int fio_hdfsio_io_u_init(struct thread_data *td, struct io_u *io_u)
{
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
struct hdfsio_options *options = td->eo;
int failure;
struct hdfsBuilder *bld;
static void fio_hdfsio_io_u_free(struct thread_data *td, struct io_u *io_u)
{
- struct hdfsio_data *hd = td->io_ops->data;
+ struct hdfsio_data *hd = td->io_ops_data;
if (hd->fs && hdfsDisconnect(hd->fs) < 0) {
log_err("hdfs: disconnect failed: %d\n", errno);