Use LF instead of CRLF in LatencyBandConfig
This commit is contained in:
parent
39968b3bde
commit
6d111186d9
|
@ -1,92 +1,92 @@
|
||||||
/*
|
/*
|
||||||
* LatencyBandConfig.h
|
* LatencyBandConfig.h
|
||||||
*
|
*
|
||||||
* This source file is part of the FoundationDB open source project
|
* This source file is part of the FoundationDB open source project
|
||||||
*
|
*
|
||||||
* Copyright 2013-2019 Apple Inc. and the FoundationDB project authors
|
* Copyright 2013-2019 Apple Inc. and the FoundationDB project authors
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FDBSERVER_LATENCYBANDCONFIG_H
|
#ifndef FDBSERVER_LATENCYBANDCONFIG_H
|
||||||
#define FDBSERVER_LATENCYBANDCONFIG_H
|
#define FDBSERVER_LATENCYBANDCONFIG_H
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "fdbclient/FDBTypes.h"
|
#include "fdbclient/FDBTypes.h"
|
||||||
#include "fdbclient/JSONDoc.h"
|
#include "fdbclient/JSONDoc.h"
|
||||||
|
|
||||||
struct LatencyBandConfig {
|
struct LatencyBandConfig {
|
||||||
struct RequestConfig {
|
struct RequestConfig {
|
||||||
std::set<double> bands;
|
std::set<double> bands;
|
||||||
|
|
||||||
friend bool operator==(RequestConfig const& lhs, RequestConfig const& rhs);
|
friend bool operator==(RequestConfig const& lhs, RequestConfig const& rhs);
|
||||||
friend bool operator!=(RequestConfig const& lhs, RequestConfig const& rhs);
|
friend bool operator!=(RequestConfig const& lhs, RequestConfig const& rhs);
|
||||||
|
|
||||||
virtual void fromJson(JSONDoc json);
|
virtual void fromJson(JSONDoc json);
|
||||||
|
|
||||||
template <class Ar>
|
template <class Ar>
|
||||||
void serialize(Ar& ar) {
|
void serialize(Ar& ar) {
|
||||||
serializer(ar, bands);
|
serializer(ar, bands);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool isEqual(RequestConfig const& r) const;
|
virtual bool isEqual(RequestConfig const& r) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GrvConfig : RequestConfig {};
|
struct GrvConfig : RequestConfig {};
|
||||||
|
|
||||||
struct ReadConfig : RequestConfig {
|
struct ReadConfig : RequestConfig {
|
||||||
Optional<int> maxReadBytes;
|
Optional<int> maxReadBytes;
|
||||||
Optional<int> maxKeySelectorOffset;
|
Optional<int> maxKeySelectorOffset;
|
||||||
|
|
||||||
void fromJson(JSONDoc json) override;
|
void fromJson(JSONDoc json) override;
|
||||||
|
|
||||||
template <class Ar>
|
template <class Ar>
|
||||||
void serialize(Ar& ar) {
|
void serialize(Ar& ar) {
|
||||||
serializer(ar, *(RequestConfig*)this, maxReadBytes, maxKeySelectorOffset);
|
serializer(ar, *(RequestConfig*)this, maxReadBytes, maxKeySelectorOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool isEqual(RequestConfig const& r) const override;
|
bool isEqual(RequestConfig const& r) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CommitConfig : RequestConfig {
|
struct CommitConfig : RequestConfig {
|
||||||
Optional<int> maxCommitBytes;
|
Optional<int> maxCommitBytes;
|
||||||
|
|
||||||
void fromJson(JSONDoc json) override;
|
void fromJson(JSONDoc json) override;
|
||||||
|
|
||||||
template <class Ar>
|
template <class Ar>
|
||||||
void serialize(Ar& ar) {
|
void serialize(Ar& ar) {
|
||||||
serializer(ar, *(RequestConfig*)this, maxCommitBytes);
|
serializer(ar, *(RequestConfig*)this, maxCommitBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool isEqual(RequestConfig const& r) const override;
|
bool isEqual(RequestConfig const& r) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
GrvConfig grvConfig;
|
GrvConfig grvConfig;
|
||||||
ReadConfig readConfig;
|
ReadConfig readConfig;
|
||||||
CommitConfig commitConfig;
|
CommitConfig commitConfig;
|
||||||
|
|
||||||
template <class Ar>
|
template <class Ar>
|
||||||
void serialize(Ar& ar) {
|
void serialize(Ar& ar) {
|
||||||
serializer(ar, grvConfig, readConfig, commitConfig);
|
serializer(ar, grvConfig, readConfig, commitConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Optional<LatencyBandConfig> parse(ValueRef configurationString);
|
static Optional<LatencyBandConfig> parse(ValueRef configurationString);
|
||||||
|
|
||||||
bool operator==(LatencyBandConfig const& r) const;
|
bool operator==(LatencyBandConfig const& r) const;
|
||||||
bool operator!=(LatencyBandConfig const& r) const;
|
bool operator!=(LatencyBandConfig const& r) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue