You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@s2graph.apache.org by st...@apache.org on 2017/07/31 01:05:26 UTC
[12/25] incubator-s2graph git commit: run apache-rat.
run apache-rat.
Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/33ed1d8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/33ed1d8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/33ed1d8d
Branch: refs/heads/master
Commit: 33ed1d8d5bbaa2eca46d49a2e6c042fb39754636
Parents: 1af749f
Author: DO YUNG YOON <st...@apache.org>
Authored: Fri Jul 21 21:03:40 2017 +0900
Committer: DO YUNG YOON <st...@apache.org>
Committed: Fri Jul 21 21:03:40 2017 +0900
----------------------------------------------------------------------
.../io/tinkerpop/optimize/HasStepFolder.java | 20 +++++++++++
.../core/io/tinkerpop/optimize/S2GraphStep.java | 20 +++++++++++
.../tinkerpop/optimize/S2GraphStepStrategy.java | 20 +++++++++++
.../optimize/S2GraphTraversalUtil.java | 19 +++++++++++
.../tinkerpop/optimize/S2GraphVertexStep.java | 20 +++++++++++
.../s2graph/core/index/IndexProvider.scala | 36 +++++++++++++++++++-
.../core/tinkerpop/optimize/S2GraphStep.scala | 19 +++++++++++
.../optimize/S2GraphStepStrategy.scala | 19 +++++++++++
.../s2graph/core/index/IndexProviderTest.scala | 19 +++++++++++
9 files changed, 191 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/HasStepFolder.java
----------------------------------------------------------------------
diff --git a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/HasStepFolder.java b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/HasStepFolder.java
index 116f95d..49de054 100644
--- a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/HasStepFolder.java
+++ b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/HasStepFolder.java
@@ -1,5 +1,25 @@
package org.apache.s2graph.core.io.tinkerpop.optimize;
+/*
+ * 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.
+ */
+
+
import org.apache.tinkerpop.gremlin.process.traversal.Order;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStep.java
----------------------------------------------------------------------
diff --git a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStep.java b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStep.java
index e39bdd5..783f9b5 100644
--- a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStep.java
+++ b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStep.java
@@ -1,5 +1,25 @@
package org.apache.s2graph.core.io.tinkerpop.optimize;
+/*
+ * 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.
+ */
+
+
import org.apache.s2graph.core.EdgeId;
import org.apache.s2graph.core.QueryParam;
import org.apache.s2graph.core.S2Graph;
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStepStrategy.java
----------------------------------------------------------------------
diff --git a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStepStrategy.java b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStepStrategy.java
index 8f40d15..d38eff4 100644
--- a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStepStrategy.java
+++ b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphStepStrategy.java
@@ -1,5 +1,25 @@
package org.apache.s2graph.core.io.tinkerpop.optimize;
+/*
+ * 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.
+ */
+
+
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphTraversalUtil.java
----------------------------------------------------------------------
diff --git a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphTraversalUtil.java b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphTraversalUtil.java
index 81a1261..8bbf2e4 100644
--- a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphTraversalUtil.java
+++ b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphTraversalUtil.java
@@ -1,3 +1,22 @@
+/*
+ * 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.s2graph.core.io.tinkerpop.optimize;
//
//import org.apache.s2graph.core.S2Vertex;
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphVertexStep.java
----------------------------------------------------------------------
diff --git a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphVertexStep.java b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphVertexStep.java
index a637617..8f372c7 100644
--- a/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphVertexStep.java
+++ b/s2core/src/main/java/org/apache/s2graph/core/io/tinkerpop/optimize/S2GraphVertexStep.java
@@ -1,5 +1,25 @@
package org.apache.s2graph.core.io.tinkerpop.optimize;
+/*
+ * 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.
+ */
+
+
import org.apache.s2graph.core.Query;
import org.apache.s2graph.core.S2Vertex;
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/main/scala/org/apache/s2graph/core/index/IndexProvider.scala
----------------------------------------------------------------------
diff --git a/s2core/src/main/scala/org/apache/s2graph/core/index/IndexProvider.scala b/s2core/src/main/scala/org/apache/s2graph/core/index/IndexProvider.scala
index 0a3ac33..ed97ed9 100644
--- a/s2core/src/main/scala/org/apache/s2graph/core/index/IndexProvider.scala
+++ b/s2core/src/main/scala/org/apache/s2graph/core/index/IndexProvider.scala
@@ -1,5 +1,26 @@
+/*
+ * 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.s2graph.core.index
+import java.util
+
import com.typesafe.config.Config
import org.apache.lucene.analysis.standard.StandardAnalyzer
import org.apache.lucene.document.{Document, Field, StringField, TextField}
@@ -15,6 +36,8 @@ import org.apache.s2graph.core.utils.logger
import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer
import play.api.libs.json.Json
+import scala.concurrent.Future
+
object IndexProvider {
val vidField = "_vid_"
val eidField = "_eid_"
@@ -40,12 +63,16 @@ object IndexProvider {
trait IndexProvider {
//TODO: Seq nee do be changed into stream
def fetchEdgeIds(queryString: String): java.util.List[EdgeId]
+ def fetchEdgeIdsAsync(queryString: String): Future[java.util.List[EdgeId]]
def fetchVertexIds(queryString: String): java.util.List[VertexId]
+ def fetchVertexIdsAsync(queryString: String): Future[java.util.List[VertexId]]
def mutateVertices(vertices: Seq[S2Vertex]): Seq[Boolean]
+ def mutateVerticesAsync(vertices: Seq[S2Vertex]): Future[Seq[Boolean]]
def mutateEdges(edges: Seq[S2Edge]): Seq[Boolean]
+ def mutateEdgesAsync(edges: Seq[S2Edge]): Future[Seq[Boolean]]
def shutdown(): Unit
}
@@ -144,4 +171,11 @@ class LuceneIndexProvider(config: Config) extends IndexProvider {
writer.close()
}
-}
\ No newline at end of file
+ override def fetchEdgeIdsAsync(queryString: String): Future[util.List[EdgeId]] = Future.successful(fetchEdgeIds(queryString))
+
+ override def fetchVertexIdsAsync(queryString: String): Future[util.List[VertexId]] = Future.successful(fetchVertexIds(queryString))
+
+ override def mutateVerticesAsync(vertices: Seq[S2Vertex]): Future[Seq[Boolean]] = Future.successful(mutateVertices(vertices))
+
+ override def mutateEdgesAsync(edges: Seq[S2Edge]): Future[Seq[Boolean]] = Future.successful(mutateEdges(edges))
+}
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStep.scala
----------------------------------------------------------------------
diff --git a/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStep.scala b/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStep.scala
index 2bef368..962af30 100644
--- a/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStep.scala
+++ b/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStep.scala
@@ -1,3 +1,22 @@
+/*
+ * 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.s2graph.core.tinkerpop.optimize
//
//import org.apache.s2graph.core.utils.logger
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStepStrategy.scala
----------------------------------------------------------------------
diff --git a/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStepStrategy.scala b/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStepStrategy.scala
index 525d354..cd477cb 100644
--- a/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStepStrategy.scala
+++ b/s2core/src/main/scala/org/apache/s2graph/core/tinkerpop/optimize/S2GraphStepStrategy.scala
@@ -1,3 +1,22 @@
+/*
+ * 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.s2graph.core.tinkerpop.optimize
//
//import org.apache.s2graph.core.utils.logger
http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/33ed1d8d/s2core/src/test/scala/org/apache/s2graph/core/index/IndexProviderTest.scala
----------------------------------------------------------------------
diff --git a/s2core/src/test/scala/org/apache/s2graph/core/index/IndexProviderTest.scala b/s2core/src/test/scala/org/apache/s2graph/core/index/IndexProviderTest.scala
index b4e5ed2..ce030bb 100644
--- a/s2core/src/test/scala/org/apache/s2graph/core/index/IndexProviderTest.scala
+++ b/s2core/src/test/scala/org/apache/s2graph/core/index/IndexProviderTest.scala
@@ -1,3 +1,22 @@
+/*
+ * 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.s2graph.core.index
import org.apache.s2graph.core.Integrate.IntegrateCommon