Skip to content

v3.0 Fixed Byte Ranges Update

Andrey Kurilov edited this page Feb 22, 2017 · 1 revision

Introduction

In v2.x.x there was no separate Append load type. It was possible to append the data items configuring the fixed byte range for an Update load job. But users require to have an ability to specify only a size of an appendage in order to make an Append load job circular. There's RFC7233 describing the way to specify the appendage size. So RFC7233 is used to interpret the fixed byte range configuration.

Limitations

  • Effective only if load type is set to update.

Approach

Append mode is implemented as a case of Update load type. It enables if fixed byte range is configured in a special way (no start offset). According RFC7233 it is also possible to specify both start and end offset or start offset only.

Random range update uses new data to overwrite ranges of the data item. Contrary to random range update, fixed range update overwrites/appends the data with the same data source.

Update Behavior Table

Byte Ranges Configuration Effect
No byte ranges configured Error
A random count N Random Byte Ranges Update with new data, N ranges to update per request. N should be > 0.
Fixed value: "N-" Overwrite the part of the data item with the same data starting from the position of N bytes to the end of the data item. N should be less than data item size.
Fixed value: "-N" Append N bytes to the data item using the same data source.
Fixed value: "N1-N2" Overwrite the part of the data tiem with the same data in the range of N1-N2 bytes. N1 should be not more than N2. N2 may be more than data item size.

CLI examples

Random range update example:

java -jar mongoose.jar --update --item-data-ranges-random=2 --item-input-file=items2update.csv --item-output-file=items_updated.csv ...

Overwrite the data items from 2KB to the end:

java -jar mongoose.jar --update --item-data-ranges-fixed=2KB- --item-input-file=items2overwrite_tail2KBs.csv --item-output-file=items_with_overwritten_tails.csv ...

Overwrite the data items in the range from 2KB to 5KB:

java -jar mongoose.jar --update --item-data-ranges-fixed=2KB-5KB --item-input-file=items2overwrite_range.csv --item-output-file=items_overwritten_in_the_middle.csv ...

Append 16KB to the data items:

java -jar mongoose.jar --update --item-data-ranges-fixed=-16KB --item-input-file=items2append_16KB_tails.csv --item-output-file=items_appended.csv ...

Configuration

  • Update load type should be used to use the feature: --update or --load-type=update
  • Fixed byte ranges should be specified using the --item-data-ranges-fixed= configuration parameter.
Clone this wiki locally