Skip to content

Commit

Permalink
Rename Attributes to CompressedAttributes. (envoyproxy#197)
Browse files Browse the repository at this point in the history
* rename

* Rename Attributes to CompressedAttributes.
  • Loading branch information
qiwzhang authored Oct 16, 2017
1 parent a1c6649 commit 48d0381
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 125 deletions.
2 changes: 1 addition & 1 deletion mixerclient/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ cc_proto_library(
actual = "@gogoproto_git//:cc_gogoproto_genproto",
)

ISTIO_API = "32e95fc675f9c4a41f3e88a9ef84d68ca220c968"
ISTIO_API = "ce599cdd0517de3e0275f72aac01b7a8022091cf"

def mixerapi_repositories(protobuf_repo="@protobuf_bzl//", bind=True):
gogoproto_repositories(bind)
Expand Down
9 changes: 5 additions & 4 deletions mixerclient/src/attribute_converter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ::istio::mixer::v1::StringMap CreateStringMap(

bool ConvertToPb(const Attributes& attributes, MessageDictionary& dict,
DeltaUpdate& delta_update,
::istio::mixer::v1::Attributes* pb) {
::istio::mixer::v1::CompressedAttributes* pb) {
delta_update.Start();

// Fill attributes.
Expand Down Expand Up @@ -133,7 +133,7 @@ class BatchConverterImpl : public BatchConverter {
}

bool Add(const Attributes& attributes) override {
::istio::mixer::v1::Attributes pb;
::istio::mixer::v1::CompressedAttributes pb;
if (!ConvertToPb(attributes, dict_, *delta_update_, &pb)) {
return false;
}
Expand Down Expand Up @@ -185,8 +185,9 @@ void GlobalDictionary::ShrinkToBase() {
}
}

void AttributeConverter::Convert(const Attributes& attributes,
::istio::mixer::v1::Attributes* pb) const {
void AttributeConverter::Convert(
const Attributes& attributes,
::istio::mixer::v1::CompressedAttributes* pb) const {
MessageDictionary dict(global_dict_);
std::unique_ptr<DeltaUpdate> delta_update = DeltaUpdate::CreateNoOp();

Expand Down
2 changes: 1 addition & 1 deletion mixerclient/src/attribute_converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BatchConverter {
class AttributeConverter {
public:
void Convert(const Attributes& attributes,
::istio::mixer::v1::Attributes* attributes_pb) const;
::istio::mixer::v1::CompressedAttributes* attributes_pb) const;

// Create a batch converter.
std::unique_ptr<BatchConverter> CreateBatchConverter() const;
Expand Down
4 changes: 2 additions & 2 deletions mixerclient/src/attribute_converter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ class AttributeConverterTest : public ::testing::Test {
TEST_F(AttributeConverterTest, ConvertTest) {
// A converter with an empty global dictionary.
AttributeConverter converter({});
::istio::mixer::v1::Attributes attributes_pb;
::istio::mixer::v1::CompressedAttributes attributes_pb;
converter.Convert(attributes_, &attributes_pb);

std::string out_str;
TextFormat::PrintToString(attributes_pb, &out_str);
GOOGLE_LOG(INFO) << "===" << out_str << "===";

::istio::mixer::v1::Attributes expected_attributes_pb;
::istio::mixer::v1::CompressedAttributes expected_attributes_pb;
ASSERT_TRUE(
TextFormat::ParseFromString(kAttributes, &expected_attributes_pb));
EXPECT_TRUE(
Expand Down
117 changes: 0 additions & 117 deletions mixerclient/src/transport.h

This file was deleted.

0 comments on commit 48d0381

Please sign in to comment.