Skip to content

Commit

Permalink
remove noexcept to make memtracker work
Browse files Browse the repository at this point in the history
print memory stats default to false (vesoft-inc#5234)

* print memory stats default to false

* update conf

Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com>

fix bug of extract prop expr visitor (vesoft-inc#5238)

fxi lint

refine

refine

refine

refine

refine

fix

refine

refine

fix

fix

fix

fix

fix

fix
codesigner committed Jan 14, 2023

Verified

This commit was signed with the committer’s verified signature.
AVVS Vitaly Aminev
1 parent 9c1ff89 commit ac0888e
Showing 115 changed files with 521 additions and 362 deletions.
2 changes: 1 addition & 1 deletion conf/nebula-graphd.conf.default
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@
--memory_tracker_untracked_reserved_memory_mb=50

# enable log memory tracker stats periodically
--memory_tracker_detail_log=true
--memory_tracker_detail_log=false
# log memory tacker stats interval in milliseconds
--memory_tracker_detail_log_interval_ms=60000

2 changes: 1 addition & 1 deletion conf/nebula-graphd.conf.production
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@
--memory_tracker_untracked_reserved_memory_mb=50

# enable log memory tracker stats periodically
--memory_tracker_detail_log=true
--memory_tracker_detail_log=false
# log memory tacker stats interval in milliseconds
--memory_tracker_detail_log_interval_ms=60000

2 changes: 1 addition & 1 deletion conf/nebula-storaged.conf.default
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@
--memory_tracker_untracked_reserved_memory_mb=50

# enable log memory tracker stats periodically
--memory_tracker_detail_log=true
--memory_tracker_detail_log=false
# log memory tacker stats interval in milliseconds
--memory_tracker_detail_log_interval_ms=60000

2 changes: 1 addition & 1 deletion conf/nebula-storaged.conf.production
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@
--memory_tracker_untracked_reserved_memory_mb=50

# enable log memory tracker stats periodically
--memory_tracker_detail_log=true
--memory_tracker_detail_log=false
# log memory tacker stats interval in milliseconds
--memory_tracker_detail_log_interval_ms=60000

5 changes: 5 additions & 0 deletions src/clients/storage/StorageClientBase-inl.h
Original file line number Diff line number Diff line change
@@ -76,6 +76,8 @@ StorageClientBase<ClientType, ClientManagerType>::collectResponse(
folly::EventBase* evb,
std::unordered_map<HostAddr, Request> requests,
RemoteFunc&& remoteFunc) {
memory::MemoryCheckOffGuard offGuard;

std::vector<folly::Future<StatusOr<Response>>> respFutures;
respFutures.reserve(requests.size());

@@ -155,6 +157,9 @@ template <typename ClientType, typename ClientManagerType>
template <class Request, class RemoteFunc, class Response>
folly::Future<StatusOr<Response>> StorageClientBase<ClientType, ClientManagerType>::getResponse(
folly::EventBase* evb, const HostAddr& host, const Request& request, RemoteFunc&& remoteFunc) {
// memory::MemoryCheckOffGuard offGuard;
// DCHECK(!memory::MemoryTracker::isOn()) << "is on";

static_assert(
folly::isFuture<std::invoke_result_t<RemoteFunc, ClientType*, const Request&>>::value);

4 changes: 2 additions & 2 deletions src/codec/RowReader.cpp
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ namespace nebula {
* class RowReader::Cell
*
********************************************/
Value RowReader::Cell::value() const noexcept {
Value RowReader::Cell::value() const {
return iter_->reader_->getValueByIndex(iter_->index_);
}

@@ -50,7 +50,7 @@ RowReader::Iterator& RowReader::Iterator::operator++() {
*
********************************************/

bool RowReader::resetImpl(meta::SchemaProviderIf const* schema, folly::StringPiece row) noexcept {
bool RowReader::resetImpl(meta::SchemaProviderIf const* schema, folly::StringPiece row) {
schema_ = schema;
data_ = row;

22 changes: 11 additions & 11 deletions src/codec/RowReader.h
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ class RowReader {
friend class Iterator;

public:
Value value() const noexcept;
Value value() const;

private:
const Iterator* iter_;
@@ -74,41 +74,41 @@ class RowReader {
* @param prop Property name
* @return Value Property value
*/
virtual Value getValueByName(const std::string& prop) const noexcept = 0;
virtual Value getValueByName(const std::string& prop) const = 0;

/**
* @brief Get the property value by index in schema
*
* @param index Index in Schema
* @return Value Property value
*/
virtual Value getValueByIndex(const int64_t index) const noexcept = 0;
virtual Value getValueByIndex(const int64_t index) const = 0;

/**
* @brief Get the timestamp in value
*
* @return int64_t UTC
*/
virtual int64_t getTimestamp() const noexcept = 0;
virtual int64_t getTimestamp() const = 0;

/**
* @brief The row reader version, only 1 or 2 is legal
*
* @return int32_t Reader version
*/
virtual int32_t readerVer() const noexcept = 0;
virtual int32_t readerVer() const = 0;

/**
* @brief Return the number of bytes used for the header info
*/
virtual size_t headerLen() const noexcept = 0;
virtual size_t headerLen() const = 0;

/**
* @brief Iterator points to the first field
*
* @return Iterator
*/
virtual Iterator begin() const noexcept {
virtual Iterator begin() const {
return Iterator(this, 0);
}

@@ -117,7 +117,7 @@ class RowReader {
*
* @return const Iterator&
*/
virtual const Iterator& end() const noexcept {
virtual const Iterator& end() const {
return endIter_;
}

@@ -126,7 +126,7 @@ class RowReader {
*
* @return SchemaVer Schema version
*/
virtual SchemaVer schemaVer() const noexcept {
virtual SchemaVer schemaVer() const {
return schema_->getVersion();
}

@@ -135,7 +135,7 @@ class RowReader {
*
* @return size_t
*/
virtual size_t numFields() const noexcept {
virtual size_t numFields() const {
return schema_->getNumFields();
}

@@ -170,7 +170,7 @@ class RowReader {
* @param row
* @return Whether reset succeed
*/
virtual bool resetImpl(meta::SchemaProviderIf const* schema, folly::StringPiece row) noexcept;
virtual bool resetImpl(meta::SchemaProviderIf const* schema, folly::StringPiece row);

private:
Iterator endIter_;
38 changes: 19 additions & 19 deletions src/codec/RowReaderV1.cpp
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ using nebula::cpp2::PropertyType;
* class RowReaderV1
*
********************************************/
bool RowReaderV1::resetImpl(meta::SchemaProviderIf const* schema, folly::StringPiece row) noexcept {
bool RowReaderV1::resetImpl(meta::SchemaProviderIf const* schema, folly::StringPiece row) {
RowReader::resetImpl(schema, row);

DCHECK(schema_ != nullptr) << "A schema must be provided";
@@ -95,7 +95,7 @@ bool RowReaderV1::processHeader(folly::StringPiece row) {
return true;
}

int64_t RowReaderV1::skipToNext(int64_t index, int64_t offset) const noexcept {
int64_t RowReaderV1::skipToNext(int64_t index, int64_t offset) const {
const PropertyType& vType = getSchema()->getFieldType(index);
if (offsets_[index + 1] >= 0) {
return offsets_[index + 1];
@@ -160,7 +160,7 @@ int64_t RowReaderV1::skipToNext(int64_t index, int64_t offset) const noexcept {
return offset;
}

int64_t RowReaderV1::skipToField(int64_t index) const noexcept {
int64_t RowReaderV1::skipToField(int64_t index) const {
DCHECK_GE(index, 0);
if (index >= static_cast<int64_t>(schema_->getNumFields())) {
// Index is out of range
@@ -191,12 +191,12 @@ int64_t RowReaderV1::skipToField(int64_t index) const noexcept {
* Get the property value
*
***********************************************************/
Value RowReaderV1::getValueByName(const std::string& prop) const noexcept {
Value RowReaderV1::getValueByName(const std::string& prop) const {
int64_t index = getSchema()->getFieldIndex(prop);
return getValueByIndex(index);
}

Value RowReaderV1::getValueByIndex(const int64_t index) const noexcept {
Value RowReaderV1::getValueByIndex(const int64_t index) const {
if (index < 0 || static_cast<size_t>(index) >= schema_->getNumFields()) {
return Value(NullType::UNKNOWN_PROP);
}
@@ -224,7 +224,7 @@ Value RowReaderV1::getValueByIndex(const int64_t index) const noexcept {
}
}

int64_t RowReaderV1::getTimestamp() const noexcept {
int64_t RowReaderV1::getTimestamp() const {
return std::numeric_limits<int64_t>::max();
}

@@ -233,7 +233,7 @@ int64_t RowReaderV1::getTimestamp() const noexcept {
* Get the property value from the serialized binary string
*
***********************************************************/
Value RowReaderV1::getBool(int64_t index) const noexcept {
Value RowReaderV1::getBool(int64_t index) const {
RR_GET_OFFSET()
Value v;
switch (getSchema()->getFieldType(index)) {
@@ -272,7 +272,7 @@ Value RowReaderV1::getBool(int64_t index) const noexcept {
return v;
}

Value RowReaderV1::getInt(int64_t index) const noexcept {
Value RowReaderV1::getInt(int64_t index) const {
RR_GET_OFFSET()
Value v;
switch (getSchema()->getFieldType(index)) {
@@ -296,7 +296,7 @@ Value RowReaderV1::getInt(int64_t index) const noexcept {
return v;
}

Value RowReaderV1::getFloat(int64_t index) const noexcept {
Value RowReaderV1::getFloat(int64_t index) const {
RR_GET_OFFSET()
Value v;
switch (getSchema()->getFieldType(index)) {
@@ -334,7 +334,7 @@ Value RowReaderV1::getFloat(int64_t index) const noexcept {
return v;
}

Value RowReaderV1::getDouble(int64_t index) const noexcept {
Value RowReaderV1::getDouble(int64_t index) const {
RR_GET_OFFSET()
Value v;
switch (getSchema()->getFieldType(index)) {
@@ -368,7 +368,7 @@ Value RowReaderV1::getDouble(int64_t index) const noexcept {
return v;
}

Value RowReaderV1::getString(int64_t index) const noexcept {
Value RowReaderV1::getString(int64_t index) const {
RR_GET_OFFSET()
Value v;
switch (getSchema()->getFieldType(index)) {
@@ -391,7 +391,7 @@ Value RowReaderV1::getString(int64_t index) const noexcept {
return v;
}

Value RowReaderV1::getInt64(int64_t index) const noexcept {
Value RowReaderV1::getInt64(int64_t index) const {
RR_GET_OFFSET()
Value v;
int64_t val;
@@ -425,7 +425,7 @@ Value RowReaderV1::getInt64(int64_t index) const noexcept {
return v;
}

Value RowReaderV1::getVid(int64_t index) const noexcept {
Value RowReaderV1::getVid(int64_t index) const {
auto fieldType = getSchema()->getFieldType(index);
if (fieldType == PropertyType::INT64 || fieldType == PropertyType::VID) {
// Since 2.0, vid has been defined as a binary array. So we need to convert
@@ -445,7 +445,7 @@ Value RowReaderV1::getVid(int64_t index) const noexcept {
* Low-level functions to read from the bytes
*
***********************************************************/
int32_t RowReaderV1::readInteger(int64_t offset, int64_t& v) const noexcept {
int32_t RowReaderV1::readInteger(int64_t offset, int64_t& v) const {
const uint8_t* start = reinterpret_cast<const uint8_t*>(&(buffer_[offset]));
folly::ByteRange range(start, buffer_.size() - offset);

@@ -457,7 +457,7 @@ int32_t RowReaderV1::readInteger(int64_t offset, int64_t& v) const noexcept {
return range.begin() - start;
}

int32_t RowReaderV1::readFloat(int64_t offset, float& v) const noexcept {
int32_t RowReaderV1::readFloat(int64_t offset, float& v) const {
if (offset + sizeof(float) > buffer_.size()) {
return -1;
}
@@ -467,7 +467,7 @@ int32_t RowReaderV1::readFloat(int64_t offset, float& v) const noexcept {
return sizeof(float);
}

int32_t RowReaderV1::readDouble(int64_t offset, double& v) const noexcept {
int32_t RowReaderV1::readDouble(int64_t offset, double& v) const {
if (offset + sizeof(double) > buffer_.size()) {
return -1;
}
@@ -477,7 +477,7 @@ int32_t RowReaderV1::readDouble(int64_t offset, double& v) const noexcept {
return sizeof(double);
}

int32_t RowReaderV1::readString(int64_t offset, folly::StringPiece& v) const noexcept {
int32_t RowReaderV1::readString(int64_t offset, folly::StringPiece& v) const {
int64_t strLen = 0;
int32_t intLen = readInteger(offset, strLen);
CHECK_GT(intLen, 0) << "Invalid string length";
@@ -489,7 +489,7 @@ int32_t RowReaderV1::readString(int64_t offset, folly::StringPiece& v) const noe
return intLen + strLen;
}

int32_t RowReaderV1::readInt64(int64_t offset, int64_t& v) const noexcept {
int32_t RowReaderV1::readInt64(int64_t offset, int64_t& v) const {
if (offset + sizeof(int64_t) > buffer_.size()) {
return -1;
}
@@ -500,7 +500,7 @@ int32_t RowReaderV1::readInt64(int64_t offset, int64_t& v) const noexcept {
return sizeof(int64_t);
}

int32_t RowReaderV1::readVid(int64_t offset, int64_t& v) const noexcept {
int32_t RowReaderV1::readVid(int64_t offset, int64_t& v) const {
return readInt64(offset, v);
}

Loading

0 comments on commit ac0888e

Please sign in to comment.