mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 01:42:37 +08:00
Merge pull request #5441 from xis19/master
Refactor ApplyMetadataMutation for better readability
This commit is contained in:
commit
5d84ffe019
File diff suppressed because it is too large
Load Diff
@ -22,22 +22,27 @@
|
||||
#define FDBSERVER_APPLYMETADATAMUTATION_H
|
||||
#pragma once
|
||||
|
||||
#include "fdbclient/MutationList.h"
|
||||
#include "fdbclient/SystemData.h"
|
||||
#include "fdbclient/BackupAgent.actor.h"
|
||||
#include "fdbclient/MutationList.h"
|
||||
#include "fdbclient/Notified.h"
|
||||
#include "fdbclient/SystemData.h"
|
||||
#include "fdbserver/IKeyValueStore.h"
|
||||
#include "fdbserver/LogSystem.h"
|
||||
#include "fdbserver/LogProtocolMessage.h"
|
||||
#include "fdbserver/LogSystem.h"
|
||||
#include "fdbserver/ProxyCommitData.actor.h"
|
||||
|
||||
inline bool isMetadataMutation(MutationRef const& m) {
|
||||
// FIXME: This is conservative - not everything in system keyspace is necessarily processed by
|
||||
// applyMetadataMutations
|
||||
return (m.type == MutationRef::SetValue && m.param1.size() && m.param1[0] == systemKeys.begin[0] &&
|
||||
!m.param1.startsWith(nonMetadataSystemKeys.begin)) ||
|
||||
(m.type == MutationRef::ClearRange && m.param2.size() > 1 && m.param2[0] == systemKeys.begin[0] &&
|
||||
!nonMetadataSystemKeys.contains(KeyRangeRef(m.param1, m.param2)));
|
||||
if (m.type == MutationRef::SetValue) {
|
||||
return m.param1.size() && m.param1[0] == systemKeys.begin[0] &&
|
||||
!m.param1.startsWith(nonMetadataSystemKeys.begin);
|
||||
} else if (m.type == MutationRef::ClearRange) {
|
||||
return m.param2.size() > 1 && m.param2[0] == systemKeys.begin[0] &&
|
||||
!nonMetadataSystemKeys.contains(KeyRangeRef(m.param1, m.param2));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference<StorageInfo> getStorageInfo(UID id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user