Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include/denc: improvements #12626

Merged
merged 5 commits into from Jan 10, 2017
Merged

Conversation

adamemerson
Copy link
Contributor

@adamemerson adamemerson commented Dec 22, 2016

Collapse duplicated code between all containers.

(I know about the test failures, I'll run through those.)

Foo(buffer::ptr::iterator& p, uint64_t features = 0);
}

Will have be deconde constructble. Instances of this class can be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

efficiently decoded into containers.

Since decode-constructors are new, I require all of them to accept a
features argument, to avoid the combinatorial explosion.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to be very careful with this. We generally rely on being able to transition a class from unfeatured to featured and get compile errors on all encoding paths. If callers for this pass in feature fields they aren't explicitly passed (e.g., from a features=0 arg) we may silently fill in bogus features. (Hopefully we haven't already done this elsewhere!)

@liewegas
Copy link
Member

Several build errors.. see https://jenkins.ceph.com/job/ceph-pull-requests/16112/

@liewegas
Copy link
Member

The ctor changes are great!

@adamemerson adamemerson force-pushed the wip-denconstruction branch 3 times, most recently from 8361514 to 4be1d09 Compare December 27, 2016 15:30
@adamemerson adamemerson force-pushed the wip-denconstruction branch 2 times, most recently from c1b91c8 to 65951e4 Compare December 28, 2016 04:24
@adamemerson
Copy link
Contributor Author

@liewegas Take another look at this? I plan to redo the constructor stuff on top of it to see if I can get it to work under Trusty Tahr. I don't know if you want to pull this in as is since it's a logically separate change, or hold off until I have the whole thing done.

@liewegas
Copy link
Member

liewegas commented Dec 28, 2016 via email

@liewegas liewegas changed the title DNM: Denc improvements include/denc: improvements Dec 28, 2016
@liewegas
Copy link
Member

retest this please

@liewegas
Copy link
Member

retest this please

std::array<legacy_t, 2> s = { legacy_t(1), legacy_t(2) };
test_encode_decode(s);
cout << "std::tuple<uint64_t, uint32_t>" << std::endl;
std::tuple<uint64_t, uint32_t> s = { 100, 97 };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the jenkins fails. so might want to put something like

std::tuple<uint64_t, uint32_t> s = { 100U, 97U };

instead

}
{
cout << "std::tuple<std::string, uint3_t>" << std::endl;
std::tuple<std::string, uint32_t> s = { "foo", 97 };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

}
{
cout << "std::tuple<std::string, std::set<uint32_t>>" << std::endl;
std::tuple<std::string, std::set<uint32_t>> s = { "bar", {1, 2, 3} };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

@adamemerson adamemerson force-pushed the wip-denconstruction branch 3 times, most recently from ac501a9 to 15f675c Compare December 29, 2016 08:58
@adamemerson
Copy link
Contributor Author

@liewegas All right! The tests are hammered into submission.

@liewegas
Copy link
Member

@adamemerson
Copy link
Contributor Author

@liewegas Do you mean it didn't pass? I see a couple erros but they look like clock skews and problems with the testing infrastructure.

@liewegas
Copy link
Member

liewegas commented Jan 9, 2017

I meant it passed; failures do not appear related.

This all looks fine to me. I'm not sure that boost::optional and tuple are that useful, since we aren't explicitly encoding those types, but it's certainly harmless to support them. With optional, for example, it is probably just as likely that we will use a shared flags field to indicate the presence of optional fields. But it does happen...

@liewegas
Copy link
Member

liewegas commented Jan 9, 2017

retest this please

Using template templates, kill off the reduplication in
container encoding.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
We could support zero-length tuples, but contiguous appender doesn't
like zero-length writes, so I've ruled them out for now.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
@liewegas liewegas merged commit 9f54e9f into ceph:master Jan 10, 2017
@adamemerson adamemerson deleted the wip-denconstruction branch January 13, 2017 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants