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

CodecRegistry usability improvements #62

Closed
wants to merge 7 commits into from
Closed

CodecRegistry usability improvements #62

wants to merge 7 commits into from

Conversation

rozza
Copy link
Owner

@rozza rozza commented Feb 25, 2015

Two commits to help make codec registries easier for users and for wrapping libraries

  1. Made copying MongoClientOptions easier for libraries wrapping drivers
  2. CodecRegistry refactoring, codec registry implementations are now private / internal and users can create and / or combine by using the CodecRegistryHelper

Review on Reviewable

Making copying them easier - refs JAVA-1655
Created a CodecRegistryHelper simplifyin the creation and combining of registries.
New CodecRegistries accessible from the helper:
  * SimpleCodecRegistry is a simple wrapper providing a registry for a specific codec
  * ProviderCodecRegistry takes a list of codec providers to use for finding the correct codec
  * PreferredCodecRegistry takes two codec registries and uses the first for codec lookups then falls back to the second registry

Drivers internally use the internal RootCodecRegistry which wraps the user provided codec registry and throws a CodecConfigurationException if a codec can't be found

JAVA-1655
@rozza
Copy link
Owner Author

rozza commented Feb 25, 2015

/cc @evanchooly / @craiggwilson

@jyemin
Copy link
Collaborator

jyemin commented Feb 25, 2015

Comments from the review on Reviewable.io

Reviewed files:

  • bson/src/main/org/bson/codecs/BsonDocumentCodec.java @ r1
  • bson/src/main/org/bson/codecs/BsonValueCodec.java @ r1
  • bson/src/main/org/bson/codecs/configuration/ChildCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/configuration/CodecRegistryHelper.java @ r1
  • bson/src/main/org/bson/codecs/configuration/PreferredCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/configuration/ProviderCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/configuration/RootCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/configuration/SimpleCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/DocumentCodec.java @ r1
  • bson/src/main/org/bson/RawBsonDocument.java @ r1
  • bson/src/test/unit/org/bson/codecs/BsonValueCodecProviderSpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/configuration/CodecRegistrySpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/configuration/PreferredCodecRegistrySpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/configuration/ProviderCodecRegistrySpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/configuration/SimpleCodecRegistrySpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/DocumentCodecSpecification.groovy @ r1
  • driver-async/src/main/com/mongodb/async/client/AggregateIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/DistinctIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/FindIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/ListCollectionsIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/ListDatabasesIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/ListIndexesIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MapReduceIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MongoClientImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MongoClientOptions.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MongoCollectionImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MongoDatabaseImpl.java @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/AggregateIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/DistinctIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/FindIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/ListCollectionsIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/ListDatabasesIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/ListIndexesIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MapReduceIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MongoClientOptionsSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MongoClientSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MongoCollectionSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MongoDatabaseSpecification.groovy @ r1
  • driver-core/src/main/com/mongodb/connection/RequestMessage.java @ r1
  • driver-core/src/main/com/mongodb/internal/codecs/RootCodecRegistry.java @ r1
  • driver-core/src/main/com/mongodb/operation/CommandResultDocumentCodec.java @ r1
  • driver-core/src/test/functional/com/mongodb/operation/DistinctOperationSpecification.groovy @ r1
  • driver-core/src/test/unit/com/mongodb/internal/codecs/RootCodecRegistrySpecification.groovy @ r1
  • driver/src/main/com/mongodb/AggregateIterableImpl.java @ r1
  • driver/src/main/com/mongodb/DistinctIterableImpl.java @ r1
  • driver/src/main/com/mongodb/FindIterableImpl.java @ r1
  • driver/src/main/com/mongodb/ListCollectionsIterableImpl.java @ r1
  • driver/src/main/com/mongodb/ListDatabasesIterableImpl.java @ r1
  • driver/src/main/com/mongodb/ListIndexesIterableImpl.java @ r1
  • driver/src/main/com/mongodb/MapReduceIterableImpl.java @ r1
  • driver/src/main/com/mongodb/MongoClient.java @ r1
  • driver/src/main/com/mongodb/MongoClientOptions.java @ r1
  • driver/src/main/com/mongodb/MongoCollectionImpl.java @ r1
  • driver/src/main/com/mongodb/MongoDatabaseImpl.java @ r1
  • driver/src/test/acceptance/com/mongodb/acceptancetest/atomicoperations/FindAndReplaceAcceptanceTest.java @ r1
  • driver/src/test/acceptance/com/mongodb/acceptancetest/atomicoperations/FindAndUpdateAcceptanceTest.java @ r1
  • driver/src/test/acceptance/com/mongodb/acceptancetest/querying/QueryAcceptanceTest.java @ r1
  • driver/src/test/functional/com/mongodb/client/MongoCollectionTest.java @ r1
  • driver/src/test/functional/com/mongodb/DBObjectCodecTest.java @ r1
  • driver/src/test/unit/com/mongodb/AggregateIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/DBObjectCodecSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/DBRefCodecSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/DistinctIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/FindIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/ListCollectionsIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/ListDatabasesIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/ListIndexesIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/MapReduceIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/MongoClientOptionsSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/MongoCollectionSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/MongoDatabaseSpecification.groovy @ r1

bson/src/main/org/bson/codecs/configuration/CodecRegistryHelper.java, line 27 [r1] (raw file):
Missing @SInCE


bson/src/main/org/bson/codecs/configuration/CodecRegistryHelper.java, line 45 [r1] (raw file):
This seems ungrammatical. Did you intend a period before the @see?


bson/src/main/org/bson/codecs/configuration/PreferredCodecRegistry.java, line 23 [r1] (raw file):
I'd prefer the name CompoundCodecRegistry


bson/src/main/org/bson/codecs/configuration/ProviderCodecRegistry.java, line 26 [r1] (raw file):
How about ProvidersCodecRegistry instead?


bson/src/main/org/bson/codecs/configuration/ProviderCodecRegistry.java, line 47 [r1] (raw file):
This is very dangerous and we shouldn't do it. If the provider throws an exception it has to bubble up, we can't swallow it like this. What if it was an NPE, for example? The contract for CodecProvider.get should already be to return null if it can't provide a Codec.


driver-core/src/main/com/mongodb/internal/codecs/RootCodecRegistry.java, line 58 [r1] (raw file):
This is a bit awkward. Since all the other CodecRegistry implementations return null if they don't have a Codec for the given Class, the Javadoc for CodecRegistry should indicate that that's the expected behavior. But then we have RootCodecRegistry which does something different. It would be like providing a Map implementation that throws an exception if a key is not present instead of returning null.

I don't think we can have it both ways. Seems like this is only an issue for the PreferredCodecRegistry. What if we just take the hit there and catch CodecConfigurationException when asking the preferred provider for a Codec? Yes, it's using exceptions for control flow, but it's better than this IMO.


@craiggwilson
Copy link

Comments from the review on Reviewable.io


bson/src/main/org/bson/codecs/configuration/PreferredCodecRegistry.java, line 23 [r1] (raw file):
Since it's only 2, I'd call it a CodecRegistryPair. But everyone has their preferred name.


bson/src/main/org/bson/codecs/configuration/SimpleCodecRegistry.java, line 24 [r1] (raw file):
SingleCodeRegistry? Simple doesn't really tell me why it's simple.


driver-async/src/main/com/mongodb/async/client/ListIndexesIterableImpl.java, line 46 [r1] (raw file):
Why are we changing all these places that used to take an abstraction to now take a concrete class? I don't see the point...


driver-core/src/main/com/mongodb/internal/codecs/RootCodecRegistry.java, line 58 [r1] (raw file):
Yeah... this is where the difference in providers and registries exists. If you want, you could add a tryGet to CodeRegistry that returns null instead of throwing when that behavior is desired.


@craiggwilson
Copy link

Comments from the review on Reviewable.io


In general, I'm wondering why we are now passing RootCodecRegistry around instead of just CodeRegistry. It doesn't seem like depending on RootCodecRegistry is a good thing.


@rozza
Copy link
Owner Author

rozza commented Feb 25, 2015

Comments from the review on Reviewable.io


I've renamed the protected classes to the suggestions and followed up why I think RootCodecRegistry is good thing.

Theres still an open question about ProvidersCodecRegistry


bson/src/main/org/bson/codecs/configuration/CodecRegistryHelper.java, line 27 [r1] (raw file):
Done.


bson/src/main/org/bson/codecs/configuration/CodecRegistryHelper.java, line 45 [r1] (raw file):
Done.


bson/src/main/org/bson/codecs/configuration/PreferredCodecRegistry.java, line 23 [r1] (raw file):
I went with CompoundCodecRegistry - as it follows the CodecRegistry convention


bson/src/main/org/bson/codecs/configuration/ProviderCodecRegistry.java, line 26 [r1] (raw file):
Done.


bson/src/main/org/bson/codecs/configuration/ProviderCodecRegistry.java, line 47 [r1] (raw file):
I wasn't too happy about this but the reason I added it was because we had an example in the tests that requires two codecs to be in the registry from the provider. I provided a test case which has the scenario where one provider is incorrectly configured but there is a correct provider after.

If this scenario isn't feasible - I'm happy to remove the catch, I'm not sure on what the intent was and the last thing I want to do is provide a codec that isn't correctly configured especially when a correct one for the clazz could be elsewhere.


bson/src/main/org/bson/codecs/configuration/SimpleCodecRegistry.java, line 24 [r1] (raw file):
Done. Now 100% Simpler ;)

It followed on from the SimpleCodecProvider used in a test and I renamed that also.


driver-async/src/main/com/mongodb/async/client/ListIndexesIterableImpl.java, line 46 [r1] (raw file):
These are concrete implementations! so I'm protecting it by enforcing a concrete codec registry - as we call codec.get(clazz) and all userland registries should return null if they fail - here we explicitly don't want that as the user would get an IllegalArgument exception that wouldn't make sense due to its obscurity.


driver-core/src/main/com/mongodb/internal/codecs/RootCodecRegistry.java, line 58 [r1] (raw file):
I think that instances of CodecRegistry should have return null when they fail to find a codec - thats a good thing! But this is an internal class for our use only and it wraps any user provided registries - its here for convenience as it saves the user from obscure IllegalArgument exceptions when ever we pass a codecRegistry.get(clazz) in the code.

So essentially this class is here to DRY all those null checks up and is not intended for public consumption hence being in internal. I'm happy to not have it both ways but it'll come at the cost of adding lots of checking duplication throughout the code - with the easy risk of missing one.

Also, this isn't here for just PreferredRegistry its an issue for all instances of CodecRegistry they should return null if they fail to find a codec. This way users can mix and build their registries as required and our code handles the null checks as it has the responsibility to.


@jyemin
Copy link
Collaborator

jyemin commented Feb 25, 2015

Comments from the review on Reviewable.io

Reviewed files:

  • bson/src/main/org/bson/codecs/BsonDocumentCodec.java @ r1
  • bson/src/main/org/bson/codecs/BsonValueCodec.java @ r1
  • bson/src/main/org/bson/codecs/configuration/ChildCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/configuration/CodecRegistryHelper.java @ r1
  • bson/src/main/org/bson/codecs/configuration/PreferredCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/configuration/ProviderCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/configuration/RootCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/configuration/SimpleCodecRegistry.java @ r1
  • bson/src/main/org/bson/codecs/DocumentCodec.java @ r1
  • bson/src/main/org/bson/RawBsonDocument.java @ r1
  • bson/src/test/unit/org/bson/codecs/BsonValueCodecProviderSpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/configuration/CodecRegistrySpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/configuration/PreferredCodecRegistrySpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/configuration/ProviderCodecRegistrySpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/configuration/SimpleCodecRegistrySpecification.groovy @ r1
  • bson/src/test/unit/org/bson/codecs/DocumentCodecSpecification.groovy @ r1
  • driver-async/src/main/com/mongodb/async/client/AggregateIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/DistinctIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/FindIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/ListCollectionsIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/ListDatabasesIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/ListIndexesIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MapReduceIterableImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MongoClientImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MongoClientOptions.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MongoCollectionImpl.java @ r1
  • driver-async/src/main/com/mongodb/async/client/MongoDatabaseImpl.java @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/AggregateIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/DistinctIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/FindIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/ListCollectionsIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/ListDatabasesIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/ListIndexesIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MapReduceIterableSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MongoClientOptionsSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MongoClientSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MongoCollectionSpecification.groovy @ r1
  • driver-async/src/test/unit/com/mongodb/async/client/MongoDatabaseSpecification.groovy @ r1
  • driver-core/src/main/com/mongodb/connection/RequestMessage.java @ r1
  • driver-core/src/main/com/mongodb/internal/codecs/RootCodecRegistry.java @ r1
  • driver-core/src/main/com/mongodb/operation/CommandResultDocumentCodec.java @ r1
  • driver-core/src/test/functional/com/mongodb/operation/DistinctOperationSpecification.groovy @ r1
  • driver-core/src/test/unit/com/mongodb/internal/codecs/RootCodecRegistrySpecification.groovy @ r1
  • driver/src/main/com/mongodb/AggregateIterableImpl.java @ r1
  • driver/src/main/com/mongodb/DistinctIterableImpl.java @ r1
  • driver/src/main/com/mongodb/FindIterableImpl.java @ r1
  • driver/src/main/com/mongodb/ListCollectionsIterableImpl.java @ r1
  • driver/src/main/com/mongodb/ListDatabasesIterableImpl.java @ r1
  • driver/src/main/com/mongodb/ListIndexesIterableImpl.java @ r1
  • driver/src/main/com/mongodb/MapReduceIterableImpl.java @ r1
  • driver/src/main/com/mongodb/MongoClient.java @ r1
  • driver/src/main/com/mongodb/MongoClientOptions.java @ r1
  • driver/src/main/com/mongodb/MongoCollectionImpl.java @ r1
  • driver/src/main/com/mongodb/MongoDatabaseImpl.java @ r1
  • driver/src/test/acceptance/com/mongodb/acceptancetest/atomicoperations/FindAndReplaceAcceptanceTest.java @ r1
  • driver/src/test/acceptance/com/mongodb/acceptancetest/atomicoperations/FindAndUpdateAcceptanceTest.java @ r1
  • driver/src/test/acceptance/com/mongodb/acceptancetest/querying/QueryAcceptanceTest.java @ r1
  • driver/src/test/functional/com/mongodb/client/MongoCollectionTest.java @ r1
  • driver/src/test/functional/com/mongodb/DBObjectCodecTest.java @ r1
  • driver/src/test/unit/com/mongodb/AggregateIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/DBObjectCodecSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/DBRefCodecSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/DistinctIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/FindIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/ListCollectionsIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/ListDatabasesIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/ListIndexesIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/MapReduceIterableSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/MongoClientOptionsSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/MongoCollectionSpecification.groovy @ r1
  • driver/src/test/unit/com/mongodb/MongoDatabaseSpecification.groovy @ r1

bson/src/main/org/bson/codecs/configuration/ProviderCodecRegistry.java, line 47 [r1] (raw file):
If a provider is incorrectly configured it shouldn't be ignored. I think we should remove the catch and rely on providers to return null or throw an exception, in which case it should get surfaced.


driver-core/src/main/com/mongodb/internal/codecs/RootCodecRegistry.java, line 58 [r1] (raw file):
The problem is that we then go ahead and pass that RootCodecRegistry to user code, which doesn't know what to expect (we now pass it to Bson.toBsonDocument(...). Implementors of that method need to know whether getCodec will throw or return null.


@craiggwilson
Copy link

Comments from the review on Reviewable.io


bson/src/main/org/bson/codecs/configuration/CodecRegistry.java, line 36 [r2] (raw file):
I don't think this is the right way to go. A vast majority of cases, either the thing you need is in there, or there is nothing to do but blow up. This puts that onus on the caller and I guarantee there will be all kinds of NPE that show up because of this. It would be much better to add a different method with the semantics you are looking for.


driver-async/src/main/com/mongodb/async/client/ListIndexesIterableImpl.java, line 46 [r1] (raw file):
Yeah, still not buying it. This is a DIP(http://en.wikipedia.org/wiki/Dependency_inversion_principle) violation. This makes it harder to test these classes. These classes must be provided with a valid registry and it's the caller's responsibility to provide that. This might come back later and be overly restrictive for some scenario you haven't thought of yet, whereas using an abstraction mitigates that danger.


driver-core/src/main/com/mongodb/internal/codecs/RootCodecRegistry.java, line 58 [r1] (raw file):
As mentioned earlier, you should add a different method with this semantic because almost every user of this will expect one to come out. Think of this more like a DI container (because that's essentially what it is).


@jyemin
Copy link
Collaborator

jyemin commented Feb 25, 2015

Comments from the review on Reviewable.io


driver-async/src/main/com/mongodb/async/client/ListIndexesIterableImpl.java, line 46 [r1] (raw file):
As I said elsewhere, it seems like the only reason for this is so that CompoundCodecProvider doesn't have to use exceptions for control flow. We either live with that, or as Craig suggested add a tryGet to handle that specific use case.


@rozza
Copy link
Owner Author

rozza commented Feb 25, 2015

Comments from the review on Reviewable.io


Thanks, I've finally made it to the same page! I'm now happy to remove RootCodecRegistry - I didn't get Jeff's point about it would only really need to be checked on the CompoundCodecRegistry but that makes sense given the original nature of the registries. And that in turn will make Craig happy again as its CodecRegistries all round!

We still blindly trust any given CodecRegistry will throw on get() and not return null, thats the rabbit hole I went down to solve - are we happy that isn't a problem? All methods that accept a codec should null check - so it would be caught just not necessarily obvious as to why it happened.

Thanks again, I'll update tomorrow.


bson/src/main/org/bson/codecs/configuration/CodecRegistry.java, line 36 [r2] (raw file):
Conversely, thats why I explicitly guaranteed it with a RootCodecRegistry - it means we don't have to trust that users will throw an exception if no matching codec is found. Currently we will throw an NPE all over because we blindly accept and use any CodecRepository - at least we control the wrapping of any supplied CodecRepositories in the database, collection and Iterable implementations.


driver-async/src/main/com/mongodb/async/client/ListIndexesIterableImpl.java, line 46 [r1] (raw file):
Perversely I added this for the tests as they needed the exception!


driver-core/src/main/com/mongodb/internal/codecs/RootCodecRegistry.java, line 58 [r1] (raw file):
Good point, I never thought of that explicitness and consistency works for me.


@rozza
Copy link
Owner Author

rozza commented Feb 25, 2015

Comments from the review on Reviewable.io


bson/src/main/org/bson/codecs/configuration/CodecRegistry.java, line 36 [r2] (raw file):
I should have added I will revert back to original behaviour.


@rozza
Copy link
Owner Author

rozza commented Feb 26, 2015

Comments from the review on Reviewable.io


Much happier now its CodecRegistries all round


*
* @return a codec registry that has a preferred registry when looking for codecs.
*/
public static CodecRegistry compoundRegistry(final CodecRegistry firstRegistry, final CodecRegistry secondRegistry) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change to fromRegistries to be consistent with the other method names?

@jyemin
Copy link
Collaborator

jyemin commented Feb 26, 2015

I like this much better. Just one comment on a method name, and then an implementation issue with caching of Codec instances in the registry implementations.

@rozza
Copy link
Owner Author

rozza commented Feb 26, 2015

Updated :)

@jyemin
Copy link
Collaborator

jyemin commented Feb 26, 2015

I see you made the listCollectionNames/databaseNames in async. Let's do it for sync as well.

Otherwise, LGTM.

@rozza
Copy link
Owner Author

rozza commented Feb 26, 2015

Finally got there! Rebased and merged

@rozza rozza closed this Feb 26, 2015
@rozza rozza deleted the j1655 branch February 26, 2015 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants