[
https://issues.apache.org/jira/browse/TINKERPOP-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15413474#comment-15413474
]
stephen mallette commented on TINKERPOP-1402:
---------------------------------------------
I'm hesitant to introduce a breaking change to the structure API, but I see the
problem (i'm also not sure I see how changing the signature helps - a graph
would get one type of {{Builder}} and then just sorta throw it away for
whatever {{Io}} instance it feels like returning? maybe i'm missing the point).
The {{classResolver}} is something newer that didn't really have a place in the
{{Io.Builder}} interface, especially since it's specific to Gryo and really
doesn't have a similar concept anywhere else.
I'm wondering if a quieter way to handle it would be to add another method to
{{Io.Builder}}:
{code}
public Builder<? extends Io> onMapper(final UnaryOperator<Mapper.Builder>
mapper);
{code}
Of course, that makes the point of the {{registry}} method a bit useless as
then you could just assign the {{IoRegistry}} in the {{UnaryOperator}}. Maybe
the {{IoRegistry}} could somehow have some function in allowing a graph to
register a {{ClassResolver}} there in a general way?
> Impossible for graph implementations to provide a class resolver for Gryo IO
> ----------------------------------------------------------------------------
>
> Key: TINKERPOP-1402
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1402
> Project: TinkerPop
> Issue Type: Improvement
> Components: structure
> Affects Versions: 3.2.1
> Reporter: Bryn Cooke
> Priority: Critical
>
> As far as I can tell there is no way for a graph implementation to specify a
> classresolver for the following code:
> {noformat}g.io(IoCore.gryo()).writer().create(){noformat}
> The problem is that inside the graph implementation we need to be able to do
> this:
> {noformat}
> public <I extends Io> I io(final Io.Builder<I> builder) {
> Io io =
> builder.graph(this).registry(MyRegistry.INSTANCE).classResolver(MyClassReolver.INSTANCE).create();
> {noformat}
> but only supplying a registry is supported.
> Other solutions could be to design GryoIo for extension so that it can be
> wrapped or to change the signature of Graph#io to:
> {noformat}
> public default Io io(final Io.Builder<I> builder)
> {noformat}
> I would probably go for the signature change, so the graph is responsible for
> deciding the implementation that is returned.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)