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 2016/12/01 15:50:59 UTC

[jira] [Commented] (TINKERPOP-1562) Migrate ScriptEngine-related code to gremlin-core

    [ https://issues.apache.org/jira/browse/TINKERPOP-1562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15712304#comment-15712304 ] 

ASF GitHub Bot commented on TINKERPOP-1562:
-------------------------------------------

GitHub user spmallette opened a pull request:

    https://github.com/apache/tinkerpop/pull/510

    TINKERPOP-1562 Migrate ScriptEngine-related code to gremlin-core

    https://issues.apache.org/jira/browse/TINKERPOP-1562
    
    Apologies in advance - this is a fat, nasty PR and I doubt there would have been a way to break this up into smaller bits of work. Every change I made ended up creating new branches of stuff that needed to be touched. As it turns out `ScriptEngine` stuff was deeply nested into all areas of the code base and unraveling it all into a way that was non-breaking for 3.2.x was non-trivial.
    
    The core of this work focuses on:
    
    * Moving `ScriptEngine` and `GremlinPlugin`  related stuff out of gremlin-groovy down to gremlin-core. 
    * Given the above change that meant:
    ** Taking each existing gremlin-groovy based `GremlinPlugin` (hadoop, giraph, gephi, etc) and developing a parallel plugin based on gremlin-core.
    ** Making it so that gremlin server/console could utilize either plugin type (gremlin-server does this through a separate configuration option in gremlin-server.yaml and the console does this through a system variable that you could add to gremlin.sh (`-Dplugins=v3d3`)
    ** Deprecating lots of odds and ends to allow me to move classes around. The deprecation approach was more tedious and leads to some dead code, but it was a nice way to evolve this change more slowly and intelligently. It also taught me that we should be more watchful of "public class" scope. If just a fraction of these classes that I deprecated (which no one probably uses anyway) had been package scope this work would have been much easier.
    
    The testing for this body of work involved:
    
    * `mvn clean install` with integration tests
    * `docker/build.sh -t -i -n`
    * `process-docs.sh`
    * manual testing:
    ** every plugin in both versions 
    ** specific testing of the dependency grabber via `:install` for the console and `-i` in gremlin server
    
    For the most part I didn't provide a lot of docs for this because I don't think we need to publish this for 3.2.x. These changes essentially just set the stage for use to use them in full in 3.3.0.  I'll do some separate smaller PRs for 3.3.0 work around this that will include doc updates as I remove the deprecated code I've created here.
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1562

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/510.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #510
    
----
commit aca81c011c1d6e2df9be8a0b4085db6987a1839a
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-17T21:47:31Z

    TINKERPOP-1562 Initial effort to deprecate ScriptEngines.
    
    This opens up some options for how to move plugins up to gremlin-core (or deprecate them completely - not surehow that will flow yet). Anyway, this is a wip commit and a nice stop point.

commit d14005e8826f556882b0f0db64bec5ef4130e6e3
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-18T10:34:00Z

    TINKERPOP-1562 More deprecation around methods on building GremlinExecutor that used ScriptEngines.

commit 4943f1217eaed23030f88a5bdf225eeda7baa1ff
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-21T12:36:40Z

    TINKERPOP-1562 Add GreminServerGremlinModule for Gremlin Server specific imports
    
    Allow use of instance() as a way for GremlinModules to be instantiated.

commit 8c7fada64e6d4d53b56ade84a0f4eb0acb49ecf8
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-21T12:54:35Z

    TINKERPOP-1562 Add GremlinModule for Giraph.

commit f8fd64a650b4124eae89857ae1d7e66c05e00d5d
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-21T12:55:27Z

    TINKERPOP-1562 Moved GremlinServerGremlinModule to standard directory structure

commit c182d1d47839c196a7592224fd83195b6a0a2993
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-21T15:56:21Z

    TINKERPOP-1562 Deprecated GiraphGremlinPlugin.

commit a5f7daaf0ca90d4f3631c990720fbfd441e2e054
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-21T18:13:30Z

    TINKERPOP-1562 Move RemoteAcceptor related stuff to gremlin-core.

commit 052f19f94a8534581226c9cdb6caebcc295d6820
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-21T18:15:02Z

    TINKERPOP-1562 Renamed GremlinModule to GremlinPlugin in gremlin-core

commit d09cf9ce4ed42bc4da5d52438e896777ea5a667f
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-21T18:34:27Z

    TINKERPOP-1562 Bring back GremlinModule and deprecate it.
    
    GremlinModule was introduced in 3.2.3. Wasn't sure if GremlinModule was equal to a GremlinPlugin so I had named it differently. It was never promoted as a replacement for GremlinPlugin and it was never used in core infrastructure like Gremlin Console or Gremlin Server, but I figured it better to avoid breaking change and simply deprecate it for removal later.

commit a28100fd1d0adcb3837aed99a177a3191d54d7cd
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-21T22:15:53Z

    TINKERPOP-1562 Start getting Console working with new plugin stuff
    
    Built adapters to get new RemoteAcceptor to behave as the old RemoteAcceptor and to get new GremlinPlugin to work as the old GremlinPlugin. Deprecated some classes and undeprecated others - still a pretty big WIP commit at this point but nothing appears to be broken.

commit 11f57acf6d69ba0105e1ba2d3315e8aa3436d877
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T11:33:22Z

    TINKERPOP-1562 ImportCustomizer has become an interface
    
    This is a breaking change unfortunately, but this was not a feature that was published or used in 3.2.3 so I don't expect wide usage.

commit 2fdd4b111c437f4ad9c8d293ae36ffad256da8b0
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T11:49:14Z

    TINKERPOP-1562 Change ScriptCustomizer to an interface.
    
    This class had been added as part of this branch so recasting it as an interface is non-breaking. Get PluggedIn to process the ScriptCustomizer.

commit 32275a94952b6fbdb7f97f309b60155d799521bb
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T11:59:49Z

    TINKERPOP-1562 Rename "modules" as "plugin"

commit 1c052e69046c6691d65649cc54f19bfa0ef5094f
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T14:39:37Z

    TINKERPOP-1562 Fixed problems related to loading new/old plugins
    
    Tested in Gremlin Console and it looks like the flag that will tell it to load one plugin version or the other is working properly.

commit 05727e2c8de06aa01459e8c7ea51246a7d021dc4
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T14:42:12Z

    TINKERPOP-1562 Deprecated TinkerGraphGremlinPlugin.

commit f88af07abd131e9973887d9945a438de985906c0
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T15:57:32Z

    TINKERPOP-1562 Added SparkGremlinPlugin
    
    SparkGremlinPlugin required binding injections so a BindingCustomizer was added along with two implementations - one for direct assignment and one for lazy assignment.

commit 458c34111c078780be5393e901f85ee35e64145a
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T16:15:57Z

    TINKERPOP-1562 Add new Neo4j GremlinPlugin and deprecated old one

commit a229885d74e953d0950f978b735f7896fbefb146
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T18:41:58Z

    TINKERPOP-1562 Add new HadoopGremlinPlugin and deprecated the old.
    
    Had to add some capabilities to plugin system to allow for passing of console environment bits (like groovysh for example).

commit e57a240800097aeaa0bd82d60a97527d3fe7d653
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T19:20:11Z

    TINKERPOP-1562 Added new plugins for gremlin-groovy to replace deprecated ones.
    
    Specifically did SugarGremlinPlugin and CredentialsGrpahGremlinPlugin.

commit 47a24d590c45fb74bb739215a324c44507377d18
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-22T21:35:16Z

    TINKERPOP-1562 Added gremlin-console plugins under the new model.
    
    Had to rework the PluggedIn adapters a bit so that they could better handle Console environment variable.s

commit 469787a6c9b05fc88ca3d724ad314682078828f5
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-23T16:31:06Z

    TINKERPOP-1562 Minor changes to javadocs.
    
    Also, moved a public static field back to ImportCustomizer (after it became a interface).

commit bea343e7d5e1fc0a865b45f29230c7e831735524
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-23T19:37:26Z

    TINKERPOP-1562 Added more tests for plugins/customizers

commit daad833fbf7dc9d1173af380476b6f2cc5333807
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-23T20:36:13Z

    TINKERPOP-1562 Added more tests for the GremlnPluginAdapter

commit 30a76e69af749223b2dc7b9a9b05030cde3a03b2
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-23T22:10:13Z

    TINKERPOP-1562 Abstracted groovysh/io to GremlinShellEnvironment
    
    The GremlinShellEnvironment provides a way to abstract groovysh and io classes (i.e. groovy specific classes) so that plugins don't need to depend on gremlin-groovy at all.

commit 46ece9636b9f1a0a43726ebcd9222caed5f885d9
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-23T22:22:58Z

    TINKERPOP-1562 Added JSR-223 packages in gremin-core to core javadoc

commit 6e6dd1b4c6a462ae97732553852cc98dbd486df4
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-24T13:11:35Z

    TINKERPOP-1562 Hooked up GremlinJythonScriptEngine to Customizers
    
    GremlnJythonScriptEngine is now initialized the same way that GremlinGroovyScriptEngine is.

commit d6fcb927a79d1e6af637377f5ae7b5c66c98caf4
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-26T12:37:28Z

    TINKERPOP-1562 Get customizers for both python and jython.
    
    The customizers are combined to a set and therefore should only apply once. Presumably there wouldn't be a different set of customizers for one versus the other. If there were and you wanted them separate I guess you'd have to build two separate script engine instances.

commit 9d0d1abe044e25e256ae3a852cf1452144abcfd7
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-28T21:51:12Z

    TINKERPOP=1562 Loaded "gremlin" imports in the scriptengines
    
    Rather than load them in the DefaultGremlinScriptEngineManager it seemed better to get them loaded in the engines themselves that way if someone opted to construct the GremlinScriptEngine directly the imports would be present.

commit ce4d96cb92afa6095a1e2da8e6d0af789c5bcd46
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-29T14:21:49Z

    TINKERPOP-1562 Deprecated plugin exceptions.
    
    These are needed anymore under the revised plugin model in gremlin-core.

commit 57ea73881076a6fb106d444f63f284c478714f1e
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2016-11-29T14:39:10Z

    TINKERPOP-1562 Deprecated Artifact
    
    Moved it to a new home as the hole plugin package is going to go away in 3.3.0

----


> Migrate ScriptEngine-related code to gremlin-core
> -------------------------------------------------
>
>                 Key: TINKERPOP-1562
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1562
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: groovy
>    Affects Versions: 3.2.3
>            Reporter: stephen mallette
>            Assignee: stephen mallette
>              Labels: breaking
>
> Migrate classes and features of {{ScriptEngine}} to gremlin-core and {{GremlinScriptEngine}}. There is a minor breaking change where the {{ImportCustomizer}} class needs to become an interface. As the class itself played no real role in operations of 3.2.3 it's doubtful that this should be a big breaking change for users as no one was likely using it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)