projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
engines/aioring: update for newer mmap based API
[fio.git]
/
engines
/
libhdfs.c
diff --git
a/engines/libhdfs.c
b/engines/libhdfs.c
index f690b009e431a2b6c80bdf7b97a9003d64b5549b..6000160129402472385da53b478229b123db82b2 100644
(file)
--- a/
engines/libhdfs.c
+++ b/
engines/libhdfs.c
@@
-15,7
+15,7
@@
#include <hdfs.h>
#include "../fio.h"
#include <hdfs.h>
#include "../fio.h"
-
+#include "../optgroup.h"
#define CHUNCK_NAME_LENGTH_MAX 80
#define CHUNCK_CREATION_BUFFER_SIZE 65536
#define CHUNCK_NAME_LENGTH_MAX 80
#define CHUNCK_CREATION_BUFFER_SIZE 65536
@@
-80,7
+80,9
@@
static struct fio_option options[] = {
.group = FIO_OPT_G_HDFS,
},
{
.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",
.type = FIO_OPT_INT,
.off1 = offsetof(struct hdfsio_options, chunck_size),
.def = "1048576",
@@
-90,6
+92,7
@@
static struct fio_option options[] = {
},
{
.name = "single_instance",
},
{
.name = "single_instance",
+ .lname = "Single Instance",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct hdfsio_options, single_instance),
.def = "1",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct hdfsio_options, single_instance),
.def = "1",
@@
-99,6
+102,7
@@
static struct fio_option options[] = {
},
{
.name = "hdfs_use_direct",
},
{
.name = "hdfs_use_direct",
+ .lname = "HDFS Use Direct",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct hdfsio_options, use_direct),
.def = "0",
.type = FIO_OPT_BOOL,
.off1 = offsetof(struct hdfsio_options, use_direct),
.def = "0",
@@
-119,7
+123,7
@@
static int get_chunck_name(char *dest, char *file_name, uint64_t chunk_id) {
static int fio_hdfsio_prep(struct thread_data *td, struct io_u *io_u)
{
struct hdfsio_options *options = td->eo;
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;
unsigned long f_id;
char fname[CHUNCK_NAME_LENGTH_MAX];
int open_flags;
@@
-161,9
+165,10
@@
static int fio_hdfsio_prep(struct thread_data *td, struct io_u *io_u)
return 0;
}
return 0;
}
-static int fio_hdfsio_queue(struct thread_data *td, struct io_u *io_u)
+static enum fio_q_status 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;
struct hdfsio_options *options = td->eo;
int ret;
unsigned long offset;
@@
-223,7
+228,7
@@
int fio_hdfsio_open_file(struct thread_data *td, struct fio_file *f)
int fio_hdfsio_close_file(struct thread_data *td, struct fio_file *f)
{
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) {
if (hd->curr_file_id != -1) {
if ( hdfsCloseFile(hd->fs, hd->fp) == -1) {
@@
-238,7
+243,7
@@
int fio_hdfsio_close_file(struct thread_data *td, struct fio_file *f)
static int fio_hdfsio_init(struct thread_data *td)
{
struct hdfsio_options *options = td->eo;
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;
struct fio_file *f;
uint64_t j,k;
int i, failure = 0;
@@
-309,13
+314,13
@@
static int fio_hdfsio_setup(struct thread_data *td)
int i;
uint64_t file_size, total_file_size;
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;
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;
}
total_file_size = 0;
@@
-346,7
+351,7
@@
static int fio_hdfsio_setup(struct thread_data *td)
static int fio_hdfsio_io_u_init(struct thread_data *td, struct io_u *io_u)
{
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;
struct hdfsio_options *options = td->eo;
int failure;
struct hdfsBuilder *bld;
@@
-381,7
+386,7
@@
static int fio_hdfsio_io_u_init(struct thread_data *td, struct io_u *io_u)
static void fio_hdfsio_io_u_free(struct thread_data *td, struct io_u *io_u)
{
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);
if (hd->fs && hdfsDisconnect(hd->fs) < 0) {
log_err("hdfs: disconnect failed: %d\n", errno);