[
https://issues.apache.org/jira/browse/TINKERPOP-1562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15729134#comment-15729134
]
ASF GitHub Bot commented on TINKERPOP-1562:
-------------------------------------------
Github user spmallette commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/510#discussion_r91326812
--- Diff:
hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/jsr223/HadoopGremlinPlugin.java
---
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.hadoop.jsr223;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.io.IOUtils;
+import org.apache.hadoop.io.compress.CodecPool;
+import org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat;
+import org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat;
+import org.apache.hadoop.util.ToolRunner;
+import org.apache.tinkerpop.gremlin.hadoop.Constants;
+import
org.apache.tinkerpop.gremlin.hadoop.process.computer.mapreduce.MapReduceGraphComputer;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopConfiguration;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopEdge;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopElement;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopProperty;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopVertex;
+import org.apache.tinkerpop.gremlin.hadoop.structure.HadoopVertexProperty;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.FileSystemStorage;
+import org.apache.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.graphson.GraphSONInputFormat;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.graphson.GraphSONOutputFormat;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.graphson.GraphSONRecordReader;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.graphson.GraphSONRecordWriter;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoInputFormat;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoOutputFormat;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoRecordReader;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.gryo.GryoRecordWriter;
+import
org.apache.tinkerpop.gremlin.hadoop.structure.io.script.ScriptInputFormat;
+import org.apache.tinkerpop.gremlin.hadoop.structure.util.ConfUtil;
+import org.apache.tinkerpop.gremlin.jsr223.AbstractGremlinPlugin;
+import org.apache.tinkerpop.gremlin.jsr223.BindingsCustomizer;
+import org.apache.tinkerpop.gremlin.jsr223.Customizer;
+import org.apache.tinkerpop.gremlin.jsr223.DefaultImportCustomizer;
+import org.apache.tinkerpop.gremlin.jsr223.ImportCustomizer;
+import org.apache.tinkerpop.gremlin.jsr223.LazyBindingsCustomizer;
+import org.apache.tinkerpop.gremlin.jsr223.console.ConsoleCustomizer;
+import org.apache.tinkerpop.gremlin.jsr223.console.GremlinShellEnvironment;
+import org.apache.tinkerpop.gremlin.jsr223.console.RemoteAcceptor;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class HadoopGremlinPlugin extends AbstractGremlinPlugin {
+
+ protected static String NAME = "tinkerpop.hadoop";
+
+ private static final BindingsCustomizer bindings;
+
+ private static final ImportCustomizer imports;
+
+ private static final Set<String> appliesTo = new
HashSet<>(Collections.singletonList("gremlin-groovy"));
+
+ static {
+ try {
+ // TODO: most of the imports here were wildcarded, but we
dont' allow that anymore - needs review
+ imports = DefaultImportCustomizer.build()
+ .addClassImports(
+ Configuration.class,
+ org.apache.hadoop.hdfs.DFSClient.class,
+ FileSystem.class,
+ ToolRunner.class,
+ IOUtils.class,
+ CodecPool.class,
+ SequenceFileInputFormat.class,
+ SequenceFileOutputFormat.class,
+ Constants.class,
+ HadoopConfiguration.class,
+ HadoopEdge.class,
+ HadoopElement.class,
+ HadoopGraph.class,
+ HadoopProperty.class,
+ HadoopVertex.class,
+ HadoopVertexProperty.class,
+ ConfUtil.class,
+ VertexWritable.class,
+ GraphSONInputFormat.class,
+ GraphSONOutputFormat.class,
+ GraphSONRecordReader.class,
+ GraphSONRecordWriter.class,
+ GryoInputFormat.class,
+ GryoOutputFormat.class,
+ GryoRecordReader.class,
+ GryoRecordWriter.class,
+ ScriptInputFormat.class,
--- End diff --
done
> 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)