-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55dc7a2
commit 6b28633
Showing
25 changed files
with
1,001 additions
and
673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//------------------------------------------------------------------------------ | ||
/* | ||
This file is part of rippled: https://github.com/ripple/rippled | ||
Copyright (c) 2020 Ripple Labs Inc. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
//============================================================================== | ||
|
||
#ifndef RIPPLE_NODESTORE_SHARDINFO_H_INCLUDED | ||
#define RIPPLE_NODESTORE_SHARDINFO_H_INCLUDED | ||
|
||
#include <ripple/basics/RangeSet.h> | ||
#include <ripple/nodestore/Types.h> | ||
#include <ripple/nodestore/impl/Shard.h> | ||
#include <ripple/protocol/messages.h> | ||
|
||
namespace ripple { | ||
namespace NodeStore { | ||
|
||
/* Contains information on the status of shards for a node | ||
*/ | ||
class ShardInfo | ||
{ | ||
public: | ||
struct Incomplete | ||
{ | ||
Incomplete() = delete; | ||
Incomplete(State state_, float progress_) | ||
: state(state_), progress(progress_) | ||
{ | ||
} | ||
|
||
State const state; | ||
float const progress; | ||
}; | ||
|
||
[[nodiscard]] std::string | ||
finalToString() const; | ||
|
||
[[nodiscard]] std::string | ||
incompleteToString() const; | ||
|
||
[[nodiscard]] protocol::TMPeerShardInfoV2 | ||
makeMessage(Application& app) const; | ||
|
||
// Complete and verified immutable shards | ||
RangeSet<std::uint32_t> final; | ||
|
||
// Incomplete shards being acquired or verified | ||
std::map<std::uint32_t, Incomplete> incomplete; | ||
}; | ||
|
||
} // namespace NodeStore | ||
} // namespace ripple | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.