Class BlockfileRow

java.lang.Object
io.datarouter.bytes.blockfile.row.BlockfileRow

public class BlockfileRow extends Object
A generic KeyValue, plus a version represented as bytes. Entries are compared by key+version. Empty fields: - A key is generally required for any useful workload. - The version can be an empty byte[] if keys are unique. - The value can be an empty byte[] if all information is contained in the key. The bytes are interpreted lexicographically using Arrays::compareUnsigned. Many of these can be written to an OutputStream to be persisted for backup or further processing. Encodes KvFileEntry objects to bytes using the format: - varInt: total length of the all following fields - the total length is redundant, but can help split the InputStream faster for passing decoding to other threads - it can also help identify corruption, if the lengths don't add up - varInt: keyLength - bytes: key - varInt: versionLength - bytes: version - byte: opType - varInt: valueLength - bytes: value