Upgrade the following dependecies: libevent -> 2.1.12 OpenSSL 1.0.2k -> 1.1.1l thrift 0.9.3 -> 0.13.0 protobuf 3.5.1 -> 3.14.0 gflags 2.2.0 -> 2.2.2 glog 0.3.3 -> 0.4.0 googletest 1.8.0 -> 1.10.0 snappy 1.1.7 -> 1.1.8 gperftools 2.7 -> 2.9.1 lz4 1.7.5 -> 1.9.3 curl 7.54.1 -> 7.79.0 re2 2017-05-01 -> 2021-02-02 zstd 1.3.7 -> 1.5.0 brotli 1.0.7 -> 1.0.9 flatbuffers 1.10.0 -> 2.0.0 apache-arrow 0.15.1 -> 5.0.0 CRoaring 0.2.60 -> 0.3.4 orc 1.5.8 -> 1.6.6 libdivide 4.0.0 -> 5.0 brpc 0.97 -> 1.0.0-rc02 librdkafka 1.7.0 -> 1.8.0 after this pr compile doris should use build-env:1.4.0
94 lines
2.6 KiB
C++
94 lines
2.6 KiB
C++
// Licensed to the Apache Software Foundation (ASF) under one
|
|
// or more contributor license agreements. See the NOTICE file
|
|
// distributed with this work for additional information
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
// to you under the Apache License, Version 2.0 (the
|
|
// "License"); you may not use this file except in compliance
|
|
// with the License. You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing,
|
|
// software distributed under the License is distributed on an
|
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
// KIND, either express or implied. See the License for the
|
|
// specific language governing permissions and limitations
|
|
// under the License.
|
|
|
|
#include "util/debug_util.h"
|
|
|
|
#include <iomanip>
|
|
#include <sstream>
|
|
|
|
#include "common/logging.h"
|
|
#include "gen_cpp/Opcodes_types.h"
|
|
#include "gen_cpp/types.pb.h"
|
|
#include "gen_cpp/version.h"
|
|
#include "util/cpu_info.h"
|
|
|
|
#define PRECISION 2
|
|
#define KILOBYTE (1024)
|
|
#define MEGABYTE (1024 * 1024)
|
|
#define GIGABYTE (1024 * 1024 * 1024)
|
|
|
|
#define SECOND (1000)
|
|
#define MINUTE (1000 * 60)
|
|
#define HOUR (1000 * 60 * 60)
|
|
|
|
#define THOUSAND (1000)
|
|
#define MILLION (THOUSAND * 1000)
|
|
#define BILLION (MILLION * 1000)
|
|
|
|
namespace doris {
|
|
|
|
std::string print_plan_node_type(const TPlanNodeType::type& type) {
|
|
std::map<int, const char*>::const_iterator i;
|
|
i = _TPlanNodeType_VALUES_TO_NAMES.find(type);
|
|
|
|
if (i != _TPlanNodeType_VALUES_TO_NAMES.end()) {
|
|
return i->second;
|
|
}
|
|
|
|
return "Invalid plan node type";
|
|
}
|
|
|
|
std::string get_build_version(bool compact) {
|
|
std::stringstream ss;
|
|
ss << DORIS_BUILD_VERSION
|
|
#ifdef NDEBUG
|
|
<< " RELEASE"
|
|
#else
|
|
<< " DEBUG"
|
|
#endif
|
|
<< " (build " << DORIS_BUILD_HASH << ")";
|
|
|
|
if (!compact) {
|
|
ss << std::endl << "Built on " << DORIS_BUILD_TIME << " by " << DORIS_BUILD_INFO;
|
|
}
|
|
|
|
return ss.str();
|
|
}
|
|
|
|
std::string get_short_version() {
|
|
static std::string short_version(std::string(DORIS_BUILD_VERSION) + "-" +
|
|
DORIS_BUILD_SHORT_HASH);
|
|
return short_version;
|
|
}
|
|
|
|
std::string get_version_string(bool compact) {
|
|
std::stringstream ss;
|
|
ss << " version " << get_build_version(compact);
|
|
return ss.str();
|
|
}
|
|
|
|
std::string hexdump(const char* buf, int len) {
|
|
std::stringstream ss;
|
|
ss << std::hex << std::uppercase;
|
|
for (int i = 0; i < len; ++i) {
|
|
ss << std::setfill('0') << std::setw(2) << ((uint16_t)buf[i] & 0xff);
|
|
}
|
|
return ss.str();
|
|
}
|
|
|
|
} // namespace doris
|