rippled
ripple
nodestore
nodestore/Types.h
1
//------------------------------------------------------------------------------
2
/*
3
This file is part of rippled: https://github.com/ripple/rippled
4
Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6
Permission to use, copy, modify, and/or distribute this software for any
7
purpose with or without fee is hereby granted, provided that the above
8
copyright notice and this permission notice appear in all copies.
9
10
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
//==============================================================================
19
20
#ifndef RIPPLE_NODESTORE_TYPES_H_INCLUDED
21
#define RIPPLE_NODESTORE_TYPES_H_INCLUDED
22
23
#include <ripple/basics/BasicConfig.h>
24
#include <ripple/nodestore/NodeObject.h>
25
#include <
vector
>
26
27
namespace
ripple
{
28
namespace
NodeStore {
29
30
enum
{
31
// This is only used to pre-allocate the array for
32
// batch objects and does not affect the amount written.
33
//
34
batchWritePreallocationSize
= 256,
35
36
// This sets a limit on the maximum number of writes
37
// in a batch. Actual usage can be twice this since
38
// we have a new batch growing as we write the old.
39
//
40
batchWriteLimitSize
= 65536
41
};
42
44
enum
Status
{
45
ok
,
46
notFound
,
47
dataCorrupt
,
48
unknown
,
49
backendError
,
50
51
customCode
= 100
52
};
53
55
using
Batch
=
std::vector<std::shared_ptr<NodeObject>
>;
56
57
}
// namespace NodeStore
58
60
enum class
ShardState
:
std::uint32_t
{
61
acquire
,
// Acquiring ledgers
62
complete
,
// Backend is ledger complete, database is unverified
63
finalizing
,
// Verifying database
64
finalized
,
// Database verified, shard is immutable
65
queued
// Queued to be finalized
66
};
67
68
}
// namespace ripple
69
70
#endif
ripple::ShardState::complete
@ complete
ripple::NodeStore::ok
@ ok
Definition:
nodestore/Types.h:45
vector
ripple::NodeStore::unknown
@ unknown
Definition:
nodestore/Types.h:48
ripple::NodeStore::backendError
@ backendError
Definition:
nodestore/Types.h:49
ripple::ShardState
ShardState
Shard states.
Definition:
nodestore/Types.h:60
ripple::NodeStore::batchWritePreallocationSize
@ batchWritePreallocationSize
Definition:
nodestore/Types.h:34
ripple::NodeStore::notFound
@ notFound
Definition:
nodestore/Types.h:46
ripple::NodeStore::batchWriteLimitSize
@ batchWriteLimitSize
Definition:
nodestore/Types.h:40
ripple::NodeStore::customCode
@ customCode
Definition:
nodestore/Types.h:51
ripple::ShardState::finalized
@ finalized
ripple::NodeStore::dataCorrupt
@ dataCorrupt
Definition:
nodestore/Types.h:47
std::uint32_t
ripple::ShardState::finalizing
@ finalizing
ripple::NodeStore::Status
Status
Return codes from Backend operations.
Definition:
nodestore/Types.h:44
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition:
RCLCensorshipDetector.h:29
ripple::ShardState::acquire
@ acquire
ripple::ShardState::queued
@ queued
Generated by
1.8.17