Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ BUTIL_SRCS = [
"src/butil/third_party/modp_b64/modp_b64.cc",
"src/butil/third_party/symbolize/demangle.cc",
"src/butil/third_party/symbolize/symbolize.cc",
"src/butil/third_party/snappy/snappy-sinksource.cc",
"src/butil/third_party/snappy/snappy-stubs-internal.cc",
"src/butil/third_party/snappy/snappy.cc",
"src/butil/third_party/murmurhash3/murmurhash3.cpp",
"src/butil/arena.cpp",
"src/butil/at_exit.cc",
Expand Down Expand Up @@ -342,6 +339,7 @@ cc_library(
"@com_github_gflags_gflags//:gflags",
"@com_github_madler_zlib//:zlib",
"@com_google_protobuf//:protobuf",
"@snappy"
] + select({
"//bazel/config:brpc_with_glog": ["@com_github_google_glog//:glog"],
"//conditions:default": [],
Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,6 @@ set(BUTIL_SOURCES
${PROJECT_SOURCE_DIR}/src/butil/third_party/modp_b64/modp_b64.cc
${PROJECT_SOURCE_DIR}/src/butil/third_party/symbolize/demangle.cc
${PROJECT_SOURCE_DIR}/src/butil/third_party/symbolize/symbolize.cc
${PROJECT_SOURCE_DIR}/src/butil/third_party/snappy/snappy-sinksource.cc
${PROJECT_SOURCE_DIR}/src/butil/third_party/snappy/snappy-stubs-internal.cc
${PROJECT_SOURCE_DIR}/src/butil/third_party/snappy/snappy.cc
${PROJECT_SOURCE_DIR}/src/butil/third_party/murmurhash3/murmurhash3.cpp
${PROJECT_SOURCE_DIR}/src/butil/arena.cpp
${PROJECT_SOURCE_DIR}/src/butil/at_exit.cc
Expand Down
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ bazel_dep(name = 'rules_cc', version = '0.0.1')
bazel_dep(name = 'rules_proto', version = '4.0.0')
bazel_dep(name = 'zlib', version = '1.3.1.bcr.5', repo_name = 'com_github_madler_zlib')
bazel_dep(name = 'libunwind', version = '1.8.1', repo_name = 'com_github_libunwind_libunwind')
bazel_dep(name = "snappy", version = "1.2.2")

# --registry=https://baidu.github.io/babylon/registry
bazel_dep(name = 'leveldb', version = '1.23', repo_name = 'com_github_google_leveldb')
Expand Down
994 changes: 994 additions & 0 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/brpc/policy/public_pbrpc_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <google/protobuf/descriptor.h> // MethodDescriptor
#include <google/protobuf/message.h> // Message
#include <gflags/gflags.h>
#include "butil/third_party/snappy/snappy.h" // snappy::Compress
#include "snappy.h" // snappy::Compress
#include "butil/time.h"
#include "brpc/controller.h" // Controller
#include "brpc/socket.h" // Socket
Expand Down Expand Up @@ -136,7 +136,7 @@ void PublicPbrpcServiceAdaptor::SerializeResponseToIOBuf(
}
if (cntl->response_compress_type() == COMPRESS_TYPE_SNAPPY) {
std::string tmp;
butil::snappy::Compress(response_str->data(), response_str->size(), &tmp);
snappy::Compress(response_str->data(), response_str->size(), &tmp);
response_str->swap(tmp);
head->set_compress_type(COMPRESS_TYPE);
}
Expand Down
6 changes: 3 additions & 3 deletions src/brpc/policy/snappy_compress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


#include "butil/logging.h"
#include "butil/third_party/snappy/snappy.h"
#include "snappy.h"
#include "brpc/policy/snappy_compress.h"
#include "brpc/protocol.h"
#include "brpc/compress.h"
Expand Down Expand Up @@ -72,13 +72,13 @@ bool SnappyDecompress(const butil::IOBuf& data, google::protobuf::Message* msg)
bool SnappyCompress(const butil::IOBuf& in, butil::IOBuf* out) {
butil::IOBufAsSnappySource source(in);
butil::IOBufAsSnappySink sink(*out);
return butil::snappy::Compress(&source, &sink);
return snappy::Compress(&source, &sink);
}

bool SnappyDecompress(const butil::IOBuf& in, butil::IOBuf* out) {
butil::IOBufAsSnappySource source(in);
butil::IOBufAsSnappySink sink(*out);
return butil::snappy::Uncompress(&source, &sink);
return snappy::Uncompress(&source, &sink);
}

} // namespace policy
Expand Down
6 changes: 3 additions & 3 deletions src/butil/iobuf.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <ostream> // std::ostream
#include <google/protobuf/io/zero_copy_stream.h> // ZeroCopyInputStream
#include "butil/strings/string_piece.h" // butil::StringPiece
#include "butil/third_party/snappy/snappy-sinksource.h"
#include "snappy-sinksource.h"
#include "butil/zero_copy_stream_as_streambuf.h"
#include "butil/macros.h"
#include "butil/reader_writer.h"
Expand Down Expand Up @@ -605,7 +605,7 @@ class IOBufAsZeroCopyOutputStream
};

// Wrap IOBuf into input of snappy compression.
class IOBufAsSnappySource : public butil::snappy::Source {
class IOBufAsSnappySource : public snappy::Source {
public:
explicit IOBufAsSnappySource(const butil::IOBuf& buf)
: _buf(&buf), _stream(buf) {}
Expand All @@ -627,7 +627,7 @@ class IOBufAsSnappySource : public butil::snappy::Source {
};

// Wrap IOBuf into output of snappy compression.
class IOBufAsSnappySink : public butil::snappy::Sink {
class IOBufAsSnappySink : public snappy::Sink {
public:
explicit IOBufAsSnappySink(butil::IOBuf& buf);
virtual ~IOBufAsSnappySink() {}
Expand Down
1 change: 0 additions & 1 deletion src/butil/third_party/snappy/AUTHORS

This file was deleted.

54 changes: 0 additions & 54 deletions src/butil/third_party/snappy/COPYING

This file was deleted.

Loading
Loading