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
  • Loading branch information
codesigner committed Jan 14, 2023
1 parent 9c1ff89 commit ac0888e
Show file tree
Hide file tree
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
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion conf/nebula-graphd.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion conf/nebula-storaged.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion conf/nebula-storaged.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/clients/storage/StorageClientBase-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/codec/RowReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}

Expand Down Expand Up @@ -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;

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

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

private:
const Iterator* iter_;
Expand Down Expand Up @@ -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);
}

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

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

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

Expand Down Expand Up @@ -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_;
Expand Down
38 changes: 19 additions & 19 deletions src/codec/RowReaderV1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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();
}

Expand All @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand All @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);

Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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";
Expand All @@ -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;
}
Expand All @@ -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);
}

Expand Down
Loading

0 comments on commit ac0888e

Please sign in to comment.