Commit 0cdd4820 authored by root's avatar root

sync with master

parent 4d5a9ac4
...@@ -10,11 +10,29 @@ config_setting( ...@@ -10,11 +10,29 @@ config_setting(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
config_setting(
name = "with_thrift",
define_values = {"with_thrift": "true"},
visibility = ["//visibility:public"],
)
config_setting( config_setting(
name = "unittest", name = "unittest",
define_values = {"unittest": "true"}, define_values = {"unittest": "true"},
) )
config_setting(
name = "darwin",
values = {"cpu": "darwin"},
visibility = ["//visibility:public"],
)
config_setting(
name = "linux",
values = {"cpu": "linux"},
visibility = ["//visibility:public"],
)
COPTS = [ COPTS = [
"-DBTHREAD_USE_FAST_PTHREAD_MUTEX", "-DBTHREAD_USE_FAST_PTHREAD_MUTEX",
"-D__const__=", "-D__const__=",
...@@ -28,16 +46,40 @@ COPTS = [ ...@@ -28,16 +46,40 @@ COPTS = [
] + select({ ] + select({
":with_glog": ["-DBRPC_WITH_GLOG=1"], ":with_glog": ["-DBRPC_WITH_GLOG=1"],
"//conditions:default": ["-DBRPC_WITH_GLOG=0"], "//conditions:default": ["-DBRPC_WITH_GLOG=0"],
}) + select({
":with_thrift": ["-DENABLE_THRIFT_FRAMED_PROTOCOL=1"],
"//conditions:default": [""],
}) })
LINKOPTS = [ LINKOPTS = [
"-lpthread", "-lpthread",
"-lrt", "-ldl",
"-lz",
"-lssl", "-lssl",
"-lcrypto", "-lcrypto",
"-ldl", ] + select({
"-lz", ":darwin": [
] "-framework CoreFoundation",
"-framework CoreGraphics",
"-framework CoreData",
"-framework CoreText",
"-framework Security",
"-framework Foundation",
"-Wl,-U,_MallocExtension_ReleaseFreeMemory",
"-Wl,-U,_ProfilerStart",
"-Wl,-U,_ProfilerStop",
"-Wl,-U,_RegisterThriftProtocol",
],
"//conditions:default": [
"-lrt",
],
}) + select({
":with_thrift": [
"-lthriftnb",
"-levent",
"-lthrift"],
"//conditions:default": [],
})
genrule( genrule(
name = "config_h", name = "config_h",
...@@ -107,7 +149,6 @@ BUTIL_SRCS = [ ...@@ -107,7 +149,6 @@ BUTIL_SRCS = [
"src/butil/files/scoped_file.cc", "src/butil/files/scoped_file.cc",
"src/butil/files/scoped_temp_dir.cc", "src/butil/files/scoped_temp_dir.cc",
"src/butil/file_util.cc", "src/butil/file_util.cc",
"src/butil/file_util_linux.cc",
"src/butil/file_util_posix.cc", "src/butil/file_util_posix.cc",
"src/butil/guid.cc", "src/butil/guid.cc",
"src/butil/guid_posix.cc", "src/butil/guid_posix.cc",
...@@ -122,6 +163,7 @@ BUTIL_SRCS = [ ...@@ -122,6 +163,7 @@ BUTIL_SRCS = [
"src/butil/memory/weak_ptr.cc", "src/butil/memory/weak_ptr.cc",
"src/butil/posix/file_descriptor_shuffle.cc", "src/butil/posix/file_descriptor_shuffle.cc",
"src/butil/posix/global_descriptors.cc", "src/butil/posix/global_descriptors.cc",
"src/butil/process_util.cc",
"src/butil/rand_util.cc", "src/butil/rand_util.cc",
"src/butil/rand_util_posix.cc", "src/butil/rand_util_posix.cc",
"src/butil/fast_rand.cpp", "src/butil/fast_rand.cpp",
...@@ -137,7 +179,6 @@ BUTIL_SRCS = [ ...@@ -137,7 +179,6 @@ BUTIL_SRCS = [
"src/butil/strings/string_util.cc", "src/butil/strings/string_util.cc",
"src/butil/strings/string_util_constants.cc", "src/butil/strings/string_util_constants.cc",
"src/butil/strings/stringprintf.cc", "src/butil/strings/stringprintf.cc",
"src/butil/strings/sys_string_conversions_posix.cc",
"src/butil/strings/utf_offset_string_conversions.cc", "src/butil/strings/utf_offset_string_conversions.cc",
"src/butil/strings/utf_string_conversion_utils.cc", "src/butil/strings/utf_string_conversion_utils.cc",
"src/butil/strings/utf_string_conversions.cc", "src/butil/strings/utf_string_conversions.cc",
...@@ -145,7 +186,6 @@ BUTIL_SRCS = [ ...@@ -145,7 +186,6 @@ BUTIL_SRCS = [
"src/butil/synchronization/condition_variable_posix.cc", "src/butil/synchronization/condition_variable_posix.cc",
"src/butil/synchronization/waitable_event_posix.cc", "src/butil/synchronization/waitable_event_posix.cc",
"src/butil/threading/non_thread_safe_impl.cc", "src/butil/threading/non_thread_safe_impl.cc",
"src/butil/threading/platform_thread_linux.cc",
"src/butil/threading/platform_thread_posix.cc", "src/butil/threading/platform_thread_posix.cc",
"src/butil/threading/simple_thread.cc", "src/butil/threading/simple_thread.cc",
"src/butil/threading/thread_checker_impl.cc", "src/butil/threading/thread_checker_impl.cc",
...@@ -181,8 +221,82 @@ BUTIL_SRCS = [ ...@@ -181,8 +221,82 @@ BUTIL_SRCS = [
"src/butil/containers/case_ignored_flat_map.cpp", "src/butil/containers/case_ignored_flat_map.cpp",
"src/butil/iobuf.cpp", "src/butil/iobuf.cpp",
"src/butil/popen.cpp", "src/butil/popen.cpp",
] ] + select({
":darwin": [
"src/butil/time/time_mac.cc",
"src/butil/mac/scoped_mach_port.cc",
],
"//conditions:default": [
"src/butil/file_util_linux.cc",
"src/butil/threading/platform_thread_linux.cc",
"src/butil/strings/sys_string_conversions_posix.cc",
],
})
objc_library(
name = "macos_lib",
hdrs = [":config_h",
"src/butil/atomicops.h",
"src/butil/atomicops_internals_atomicword_compat.h",
"src/butil/atomicops_internals_mac.h",
"src/butil/base_export.h",
"src/butil/basictypes.h",
"src/butil/build_config.h",
"src/butil/compat.h",
"src/butil/compiler_specific.h",
"src/butil/containers/hash_tables.h",
"src/butil/debug/debugger.h",
"src/butil/debug/leak_annotations.h",
"src/butil/file_util.h",
"src/butil/file_descriptor_posix.h",
"src/butil/files/file_path.h",
"src/butil/files/file.h",
"src/butil/files/scoped_file.h",
"src/butil/lazy_instance.h",
"src/butil/logging.h",
"src/butil/mac/bundle_locations.h",
"src/butil/mac/foundation_util.h",
"src/butil/mac/scoped_cftyperef.h",
"src/butil/mac/scoped_typeref.h",
"src/butil/macros.h",
"src/butil/memory/aligned_memory.h",
"src/butil/memory/scoped_policy.h",
"src/butil/memory/scoped_ptr.h",
"src/butil/move.h",
"src/butil/port.h",
"src/butil/posix/eintr_wrapper.h",
"src/butil/scoped_generic.h",
"src/butil/strings/string16.h",
"src/butil/strings/string_piece.h",
"src/butil/strings/string_util.h",
"src/butil/strings/string_util_posix.h",
"src/butil/strings/sys_string_conversions.h",
"src/butil/synchronization/lock.h",
"src/butil/time/time.h",
"src/butil/time.h",
"src/butil/third_party/dynamic_annotations/dynamic_annotations.h",
"src/butil/threading/platform_thread.h",
"src/butil/threading/thread_restrictions.h",
"src/butil/threading/thread_id_name_manager.h",
"src/butil/type_traits.h",
],
non_arc_srcs = [
"src/butil/mac/bundle_locations.mm",
"src/butil/mac/foundation_util.mm",
"src/butil/file_util_mac.mm",
"src/butil/threading/platform_thread_mac.mm",
"src/butil/strings/sys_string_conversions_mac.mm",
],
deps = [
"@com_github_gflags_gflags//:gflags",
] + select({
":with_glog": ["@com_github_google_glog//:glog"],
"//conditions:default": [],
}),
includes = ["src/"],
enable_modules = True,
tags = ["manual"],
)
cc_library( cc_library(
name = "butil", name = "butil",
...@@ -203,6 +317,7 @@ cc_library( ...@@ -203,6 +317,7 @@ cc_library(
"@com_github_gflags_gflags//:gflags", "@com_github_gflags_gflags//:gflags",
] + select({ ] + select({
":with_glog": ["@com_github_google_glog//:glog"], ":with_glog": ["@com_github_google_glog//:glog"],
":darwin": [":macos_lib"],
"//conditions:default": [], "//conditions:default": [],
}), }),
includes = [ includes = [
...@@ -347,7 +462,17 @@ cc_library( ...@@ -347,7 +462,17 @@ cc_library(
srcs = glob([ srcs = glob([
"src/brpc/*.cpp", "src/brpc/*.cpp",
"src/brpc/**/*.cpp", "src/brpc/**/*.cpp",
]), ],
exclude = [
"src/brpc/thrift_service.cpp",
"src/brpc/thrift_message.cpp",
"src/brpc/policy/thrift_protocol.cpp",
]) + select({
":with_thrift" : glob([
"src/brpc/thrift*.cpp",
"src/brpc/**/thrift*.cpp"]),
"//conditions:default" : [],
}),
hdrs = glob([ hdrs = glob([
"src/brpc/*.h", "src/brpc/*.h",
"src/brpc/**/*.h" "src/brpc/**/*.h"
......
...@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 2.8.10) ...@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 2.8.10)
project(brpc C CXX) project(brpc C CXX)
# Enable MACOSX_RPATH. Run "cmake --help-policy CMP0042" for policy details. # Enable MACOSX_RPATH. Run "cmake --help-policy CMP0042" for policy details.
cmake_policy(SET CMP0042 NEW) if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
set(BRPC_VERSION 0.9.0) set(BRPC_VERSION 0.9.0)
...@@ -20,14 +22,14 @@ else() ...@@ -20,14 +22,14 @@ else()
message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.") message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
endif() endif()
option(BRPC_WITH_GLOG "With glog" OFF) option(WITH_GLOG "With glog" OFF)
option(DEBUG "Print debug logs" OFF) option(DEBUG "Print debug logs" OFF)
option(WITH_DEBUG_SYMBOLS "With debug symbols" ON) option(WITH_DEBUG_SYMBOLS "With debug symbols" ON)
option(BRPC_WITH_THRIFT "With thrift framed protocol supported" OFF) option(WITH_THRIFT "With thrift framed protocol supported" OFF)
option(BUILD_UNIT_TESTS "Whether to build unit tests" OFF) option(BUILD_UNIT_TESTS "Whether to build unit tests" OFF)
set(WITH_GLOG_VAL "0") set(WITH_GLOG_VAL "0")
if(BRPC_WITH_GLOG) if(WITH_GLOG)
set(WITH_GLOG_VAL "1") set(WITH_GLOG_VAL "1")
endif() endif()
...@@ -35,10 +37,10 @@ if(WITH_DEBUG_SYMBOLS) ...@@ -35,10 +37,10 @@ if(WITH_DEBUG_SYMBOLS)
set(DEBUG_SYMBOL "-g") set(DEBUG_SYMBOL "-g")
endif() endif()
if(BRPC_WITH_THRIFT) if(WITH_THRIFT)
set(THRIFT_CPP_FLAG "-DENABLE_THRIFT_FRAMED_PROTOCOL") set(THRIFT_CPP_FLAG "-DENABLE_THRIFT_FRAMED_PROTOCOL")
set(THRIFT_LIB "thriftnb") set(THRIFTNB_LIB "thriftnb")
message("Enable thrift framed procotol") set(THRIFT_LIB "thrift")
endif() endif()
include(GNUInstallDirs) include(GNUInstallDirs)
...@@ -119,7 +121,7 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB)) ...@@ -119,7 +121,7 @@ if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB))
message(FATAL_ERROR "Fail to find leveldb") message(FATAL_ERROR "Fail to find leveldb")
endif() endif()
if(BRPC_WITH_GLOG) if(WITH_GLOG)
find_path(GLOG_INCLUDE_PATH NAMES glog/logging.h) find_path(GLOG_INCLUDE_PATH NAMES glog/logging.h)
find_library(GLOG_LIB NAMES glog) find_library(GLOG_LIB NAMES glog)
if((NOT GLOG_INCLUDE_PATH) OR (NOT GLOG_LIB)) if((NOT GLOG_INCLUDE_PATH) OR (NOT GLOG_LIB))
...@@ -155,6 +157,7 @@ set(DYNAMIC_LIB ...@@ -155,6 +157,7 @@ set(DYNAMIC_LIB
${PROTOC_LIB} ${PROTOC_LIB}
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${THRIFT_LIB} ${THRIFT_LIB}
${THRIFTNB_LIB}
${OPENSSL_LIBRARIES} ${OPENSSL_LIBRARIES}
${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}
dl dl
...@@ -162,7 +165,7 @@ set(DYNAMIC_LIB ...@@ -162,7 +165,7 @@ set(DYNAMIC_LIB
) )
set(BRPC_PRIVATE_LIBS "-lgflags -lprotobuf -lleveldb -lprotoc -lssl -lcrypto -ldl -lz") set(BRPC_PRIVATE_LIBS "-lgflags -lprotobuf -lleveldb -lprotoc -lssl -lcrypto -ldl -lz")
if(BRPC_WITH_GLOG) if(WITH_GLOG)
set(DYNAMIC_LIB ${DYNAMIC_LIB} ${GLOG_LIB}) set(DYNAMIC_LIB ${DYNAMIC_LIB} ${GLOG_LIB})
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lglog") set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lglog")
endif() endif()
...@@ -181,8 +184,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ...@@ -181,8 +184,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
"-framework Foundation" "-framework Foundation"
"-Wl,-U,_MallocExtension_ReleaseFreeMemory" "-Wl,-U,_MallocExtension_ReleaseFreeMemory"
"-Wl,-U,_ProfilerStart" "-Wl,-U,_ProfilerStart"
"-Wl,-U,_ProfilerStop" "-Wl,-U,_ProfilerStop")
"-Wl,-U,_RegisterThriftProtocol")
endif() endif()
# for *.so # for *.so
...@@ -330,6 +332,17 @@ file(GLOB_RECURSE BVAR_SOURCES "${CMAKE_SOURCE_DIR}/src/bvar/*.cpp") ...@@ -330,6 +332,17 @@ file(GLOB_RECURSE BVAR_SOURCES "${CMAKE_SOURCE_DIR}/src/bvar/*.cpp")
file(GLOB_RECURSE BTHREAD_SOURCES "${CMAKE_SOURCE_DIR}/src/bthread/*.cpp") file(GLOB_RECURSE BTHREAD_SOURCES "${CMAKE_SOURCE_DIR}/src/bthread/*.cpp")
file(GLOB_RECURSE JSON2PB_SOURCES "${CMAKE_SOURCE_DIR}/src/json2pb/*.cpp") file(GLOB_RECURSE JSON2PB_SOURCES "${CMAKE_SOURCE_DIR}/src/json2pb/*.cpp")
file(GLOB_RECURSE BRPC_SOURCES "${CMAKE_SOURCE_DIR}/src/brpc/*.cpp") file(GLOB_RECURSE BRPC_SOURCES "${CMAKE_SOURCE_DIR}/src/brpc/*.cpp")
file(GLOB_RECURSE THRIFT_SOURCES "thrift*.cpp")
if(WITH_THRIFT)
message("brpc compile with thrift proctol")
else()
# Remove thrift sources
foreach(v ${THRIFT_SOURCES})
list(REMOVE_ITEM BRPC_SOURCES ${v})
endforeach()
set(THRIFT_SOURCES "")
endif()
set(MCPACK2PB_SOURCES set(MCPACK2PB_SOURCES
${CMAKE_SOURCE_DIR}/src/mcpack2pb/field_type.cpp ${CMAKE_SOURCE_DIR}/src/mcpack2pb/field_type.cpp
...@@ -370,6 +383,7 @@ set(SOURCES ...@@ -370,6 +383,7 @@ set(SOURCES
${JSON2PB_SOURCES} ${JSON2PB_SOURCES}
${MCPACK2PB_SOURCES} ${MCPACK2PB_SOURCES}
${BRPC_SOURCES} ${BRPC_SOURCES}
${THRIFT_SOURCES}
) )
add_subdirectory(src) add_subdirectory(src)
......
...@@ -124,7 +124,6 @@ struct ChannelOptions { ...@@ -124,7 +124,6 @@ struct ChannelOptions {
class Channel : public ChannelBase { class Channel : public ChannelBase {
friend class Controller; friend class Controller;
friend class SelectiveChannel; friend class SelectiveChannel;
friend class CouchbaseChannel;
public: public:
Channel(ProfilerLinker = ProfilerLinker()); Channel(ProfilerLinker = ProfilerLinker());
~Channel(); ~Channel();
......
...@@ -102,8 +102,6 @@ friend class ParallelChannelDone; ...@@ -102,8 +102,6 @@ friend class ParallelChannelDone;
friend class ControllerPrivateAccessor; friend class ControllerPrivateAccessor;
friend class ServerPrivateAccessor; friend class ServerPrivateAccessor;
friend class SelectiveChannel; friend class SelectiveChannel;
friend class CouchbaseChannel;
friend class CouchbaseDone;
friend class schan::Sender; friend class schan::Sender;
friend class schan::SubDone; friend class schan::SubDone;
friend class policy::OnServerStreamCreated; friend class policy::OnServerStreamCreated;
...@@ -144,15 +142,6 @@ public: ...@@ -144,15 +142,6 @@ public:
void set_timeout_ms(int64_t timeout_ms); void set_timeout_ms(int64_t timeout_ms);
int64_t timeout_ms() const { return _timeout_ms; } int64_t timeout_ms() const { return _timeout_ms; }
// Set timeout of the request trace deadline (in milliseconds)
void set_request_trace_timeout_ms(int64_t timeout_ms);
// Set the request trace deadline. We suggest you to use
// set_request_trace_timeout_ms for root request.
void set_request_trace_deadline(int64_t request_trace_deadline) {
_request_trace_deadline = request_trace_deadline;
}
// Set/get the delay to send backup request in milliseconds. Use // Set/get the delay to send backup request in milliseconds. Use
// ChannelOptions.backup_request_ms on unset. // ChannelOptions.backup_request_ms on unset.
void set_backup_request_ms(int64_t timeout_ms); void set_backup_request_ms(int64_t timeout_ms);
...@@ -381,11 +370,6 @@ public: ...@@ -381,11 +370,6 @@ public:
// Get the data attached to a mongo session(practically a socket). // Get the data attached to a mongo session(practically a socket).
MongoContext* mongo_session_data() { return _mongo_session_data.get(); } MongoContext* mongo_session_data() { return _mongo_session_data.get(); }
// Get a request trace deadline timestamp.
int64_t request_trace_deadline() const;
// Get remain milliseconds to the request trace deadline.
int64_t get_request_trace_remain_ms() const;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Both-side methods. // Both-side methods.
// Following methods can be called from both client and server. But they // Following methods can be called from both client and server. But they
...@@ -467,14 +451,7 @@ public: ...@@ -467,14 +451,7 @@ public:
void set_idl_result(int64_t result) { _idl_result = result; } void set_idl_result(int64_t result) { _idl_result = result; }
int64_t idl_result() const { return _idl_result; } int64_t idl_result() const { return _idl_result; }
bool has_request_trace_deadline() const { const std::string& thrift_method_name() { return _thrift_method_name; }
return _request_trace_deadline != UNSET_MAGIC_NUM;
}
void set_thrift_method_name(const std::string& method_name) {
_thrift_method_name = method_name;
}
std::string thrift_method_name() { return _thrift_method_name; }
private: private:
struct CompletionInfo { struct CompletionInfo {
...@@ -641,17 +618,13 @@ private: ...@@ -641,17 +618,13 @@ private:
// Used by ParallelChannel // Used by ParallelChannel
int _fail_limit; int _fail_limit;
uint32_t _pipelined_count; uint32_t _pipelined_count;
// [Timeout related] // [Timeout related]
int32_t _timeout_ms; int32_t _timeout_ms;
int32_t _connect_timeout_ms; int32_t _connect_timeout_ms;
int32_t _backup_request_ms; int32_t _backup_request_ms;
// Deadline of this rpc trace(since the Epoch in microseconds),
// set by root request of the rpc trace, and each child node of trace
// can judge root rpc request timed out or not according to the value.
int64_t _request_trace_deadline;
// Deadline of this RPC (since the Epoch in microseconds). // Deadline of this RPC (since the Epoch in microseconds).
int64_t _abstime_us; int64_t _abstime_us;
// Timer registered to trigger RPC timeout event // Timer registered to trigger RPC timeout event
...@@ -713,7 +686,6 @@ private: ...@@ -713,7 +686,6 @@ private:
// Thrift method name, only used when thrift protocol enabled // Thrift method name, only used when thrift protocol enabled
std::string _thrift_method_name; std::string _thrift_method_name;
uint32_t _thrift_seq_id;
}; };
// Advises the RPC system that the caller desires that the RPC call be // Advises the RPC system that the caller desires that the RPC call be
......
...@@ -451,6 +451,8 @@ const char* MemcacheResponse::status_str(Status st) { ...@@ -451,6 +451,8 @@ const char* MemcacheResponse::status_str(Status st) {
return "Not stored"; return "Not stored";
case STATUS_DELTA_BADVAL: case STATUS_DELTA_BADVAL:
return "Bad delta"; return "Bad delta";
case STATUS_NOT_MY_VBUCKET:
return "Not my vbucket";
case STATUS_AUTH_ERROR: case STATUS_AUTH_ERROR:
return "authentication error"; return "authentication error";
case STATUS_AUTH_CONTINUE: case STATUS_AUTH_CONTINUE:
......
...@@ -111,7 +111,7 @@ public: ...@@ -111,7 +111,7 @@ public:
butil::IOBuf& raw_buffer() { return _buf; } butil::IOBuf& raw_buffer() { return _buf; }
const butil::IOBuf& raw_buffer() const { return _buf; } const butil::IOBuf& raw_buffer() const { return _buf; }
private: protected:
bool GetOrDelete(uint8_t command, const butil::StringPiece& key); bool GetOrDelete(uint8_t command, const butil::StringPiece& key);
bool Counter(uint8_t command, const butil::StringPiece& key, uint64_t delta, bool Counter(uint8_t command, const butil::StringPiece& key, uint64_t delta,
uint64_t initial_value, uint32_t exptime); uint64_t initial_value, uint32_t exptime);
...@@ -172,6 +172,7 @@ public: ...@@ -172,6 +172,7 @@ public:
STATUS_EINVAL = 0x04, STATUS_EINVAL = 0x04,
STATUS_NOT_STORED = 0x05, STATUS_NOT_STORED = 0x05,
STATUS_DELTA_BADVAL = 0x06, STATUS_DELTA_BADVAL = 0x06,
STATUS_NOT_MY_VBUCKET = 0x07,
STATUS_AUTH_ERROR = 0x20, STATUS_AUTH_ERROR = 0x20,
STATUS_AUTH_CONTINUE = 0x21, STATUS_AUTH_CONTINUE = 0x21,
STATUS_UNKNOWN_COMMAND = 0x81, STATUS_UNKNOWN_COMMAND = 0x81,
...@@ -230,7 +231,7 @@ public: ...@@ -230,7 +231,7 @@ public:
static const char* status_str(Status); static const char* status_str(Status);
private: protected:
bool PopCounter(uint8_t command, uint64_t* new_value, uint64_t* cas_value); bool PopCounter(uint8_t command, uint64_t* new_value, uint64_t* cas_value);
bool PopStore(uint8_t command, uint64_t* cas_value); bool PopStore(uint8_t command, uint64_t* cas_value);
......
...@@ -38,6 +38,9 @@ class CouchbaseAuthenticator : public Authenticator { ...@@ -38,6 +38,9 @@ class CouchbaseAuthenticator : public Authenticator {
brpc::AuthContext*) const { brpc::AuthContext*) const {
return 0; return 0;
} }
const std::string& bucket_name() const { return bucket_name_; }
const std::string& bucket_password() const { return bucket_password_; }
private: private:
const std::string bucket_name_; const std::string bucket_name_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment