#/*
## * (C) Copyright 2018-2021 Intel Corporation.
## *
## * SPDX-License-Identifier: BSD-2-Clause-Patent
## */
##/**
## * An example daos EPOCH IO test conf file.
## */
#
# io conf file format:
# 1) some setting:
# test_lvl xxx (daos or vos, default is daos)
# dkey xxx
# akey xxx
# iod_size xxx (default is 1)
# obj_class xxx(ec or replica, default is replica)
#
# 2) update
# 2.1) update array and take snapshot
# update --tx x --snap --recx "[idx_start1, idx_end1] [idx_start2, idx_end2] ..."
# The max number of recxs is 5 (IOREQ_IOD_NR).
# 2.2) update single type record and take snapshot
# update --tx x --snap --single
#
# If no --epoch specified, then use default epoch 1.
# Other two options: --dkey xxx --akey xxx. If not specified then use the last
# dkey/akey set at above 1).
# for the option name:
# --single      == -s
# --recx        == -r
# --dkey        == -d
# --akey        == -a
#
# 3) fetch and verify based on snapshot teaken after update.
# same parameter usage as above 2)
#
# 4) discard
#
# 5) punch
#

test_lvl daos
dkey dkey_3
akey akey_array_1
iod_size 10
obj_class ec

update --tx 1 -r "[0, 1]3, [33, 34]9"
fetch --tx 1 -r "[0, 1], [33, 34]"
update --tx 1 -r "[3, 4]4"
fetch --tx 1 -r "[3, 4]"
update --tx 1 -r "[44, 50]7"
fetch --tx 1 -r "[30, 50]"
update --tx 2 -r "[293, 549]11"
update --tx 2 -r "[32, 64]12 [480, 512]13"
update --tx 2 -r "[0, 32]22"
update --tx 3 -r "[7, 9]23 [9, 20]34 [88, 123]55  [79, 82]11 [293, 549]8"
fetch --tx 3 -r "[7, 9] [9, 20] [88, 123]  [79, 82] [293, 549]"
fetch --tx 3 -r "[2, 100] [102, 134]"
fetch --tx 3 -r "[1, 5]"
update --tx 3 -r "[1, 132096]6"
fetch --tx 3 -r "[0, 18]"
fetch --tx 3 -r "[1, 133096]"

# single value on one target
akey akey_single_1
iod_size 1024
obj_class ec
update --tx 10 -s -u 13
fetch --tx 10 -s
punch -d dkey_3 -a akey_single_1 --tx 10 -s

# single value evenly distributed to all targets
akey akey_single_2
iod_size 10240
obj_class ec
update --tx 11 -s -u 17
fetch --tx 11 -s
punch -d dkey_3 -a akey_single_2 --tx 11 -s
