You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/04/18 21:58:00 UTC
[jira] [Commented] (TINKERPOP-2927) Make all Steps extensible and overridable
[ https://issues.apache.org/jira/browse/TINKERPOP-2927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17713784#comment-17713784 ]
ASF GitHub Bot commented on TINKERPOP-2927:
-------------------------------------------
porunov opened a new pull request, #2027:
URL: https://github.com/apache/tinkerpop/pull/2027
In this commit the next changes are done for the Step classes:
- Make private fields as protected
- Allow to overwride any method by removing `final` keyword
- Allow to extend any Step class by removing `final` keyword
- Add getter methods for some fields which might be useful for Step information retrieval
https://issues.apache.org/jira/browse/TINKERPOP-2927
> Make all Steps extensible and overridable
> ------------------------------------------
>
> Key: TINKERPOP-2927
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2927
> Project: TinkerPop
> Issue Type: Improvement
> Components: driver
> Affects Versions: 3.6.2
> Reporter: Oleksandr Porunov
> Priority: Minor
>
> Related issue (fixed): https://issues.apache.org/jira/browse/TINKERPOP-2924
>
> Working on optimization strategies sometimes require replacing steps with extended version of those steps. At this moment not all steps can be extended due to being `final` (like `ProjectStep`, `PropertyKeyStep`, `PropertyValueStep`, `RangeLocalStep`, `SumLocalStep`, and many more). Thus, it requires creating a similar step and duplicate some logic there instead of simply extending a specific step.
>
> For those steps which are non-final there are sometimes private fields without any getter methods (for example `private CallbackRegistry<Event> callbackRegistry` in `DropStep` is `private`. Thus, the caller needs to use Reflaction API to retrieve it's value).
>
> In JanusGraph we replace some steps with the extended version of those steps.
> For example, we completely overwrite `flatMap` step of `PropertiesStep` which is an anti-pattern, but in the case when it's hard to extend specific logic parts such anti-pattern might be a a good solution I guess.
>
> I think it would make sense to let Graph developers to extend any step and has access to it's fields / utility methods.
> In such case we could do similar with `ProjectStep` and make it query data in parallel (see issue: [https://github.com/JanusGraph/janusgraph/issues/3559] ).
>
> I'm also good not doing it in case anyone can suggest other patterns to follow for those optimizations instead of overwriting logic.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)