summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/include/tiered.h
blob: caeb2226bc44ae97c8e67e4e2fd4c8756c70cb44 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*-
 * Copyright (c) 2014-2020 MongoDB, Inc.
 * Copyright (c) 2008-2014 WiredTiger, Inc.
 *	All rights reserved.
 *
 * See the file LICENSE for redistribution information.
 */

/*
 * WT_TIERED_MANAGER --
 *	A structure that holds resources used to manage any tiered storage
 *	for the whole database.
 */
struct __wt_tiered_manager {
    uint64_t wait_usecs; /* Wait time period */
    uint32_t workers;    /* Current number of workers */
    uint32_t workers_max;
    uint32_t workers_min;

#define WT_TIERED_MAX_WORKERS 20
#define WT_TIERED_MIN_WORKERS 1

/* AUTOMATIC FLAG VALUE GENERATION START */
#define WT_TIERED_MANAGER_SHUTDOWN 0x1u /* Manager has shut down */
                                        /* AUTOMATIC FLAG VALUE GENERATION STOP */
    uint32_t flags;
};

/*
 * WT_CURSOR_TIERED --
 *	An tiered cursor.
 */
struct __wt_cursor_tiered {
    WT_CURSOR iface;

    WT_TIERED *tiered;

    WT_CURSOR **cursors;
    WT_CURSOR *current; /* The current cursor for iteration */
    WT_CURSOR *primary; /* The current primary */

/* AUTOMATIC FLAG VALUE GENERATION START */
#define WT_CURTIERED_ACTIVE 0x1u       /* Incremented the session count */
#define WT_CURTIERED_ITERATE_NEXT 0x2u /* Forward iteration */
#define WT_CURTIERED_ITERATE_PREV 0x4u /* Backward iteration */
                                       /* AUTOMATIC FLAG VALUE GENERATION STOP */
    uint32_t flags;
};

/*
 * WT_TIERED --
 *	Handle for a tiered data source.
 */
struct __wt_tiered {
    WT_DATA_HANDLE iface;

    const char *name, *config, *filename;
    const char *key_format, *value_format;

    WT_DATA_HANDLE **tiers;
    u_int ntiers;

    WT_COLLATOR *collator; /* TODO: handle custom collation */
};