key-types.h 680 Bytes
Newer Older
Matthieu Dorier's avatar
Matthieu Dorier committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#ifndef __CORE_KEY_TYPES_H
#define __CORE_KEY_TYPES_H

#include <stdint.h>
#include <bake-client.h>

typedef uint64_t oid_t;

typedef enum seg_type_t {
    ZERO         = 0,
    BAKE_REGION  = 1,
    SMALL_REGION = 2,
    TOMBSTONE    = 3
} seg_type_t;

typedef struct segment_key_t {
    oid_t oid;
    uint32_t type; /* seg_type */
    double timestamp;
    uint64_t start_index; // first index, included
    uint64_t end_index;  // end index is not included
} segment_key_t;

typedef struct omap_key_t {
    oid_t oid;
    char key[1];
} omap_key_t;

29 30 31
#define MAX_OMAP_KEY_SIZE 128
#define MAX_OMAP_VAL_SIZE 256

Matthieu Dorier's avatar
Matthieu Dorier committed
32 33
#define SMALL_REGION_THRESHOLD (sizeof(bake_region_id_t))
#endif