You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/04/17 22:25:19 UTC
[2/4] incubator-tinkerpop git commit: Fixed data files after the gryo
refactoring a few commits back.
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d3a04e46/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo
index f4786ec..30677c3 100644
Binary files a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo and b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/structure/io/gryo/grateful-dead-vertices.kryo differ
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d3a04e46/tinkergraph-gremlin/pom.xml
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml
index 0dc1474..e65038d 100644
--- a/tinkergraph-gremlin/pom.xml
+++ b/tinkergraph-gremlin/pom.xml
@@ -109,6 +109,7 @@ limitations under the License.
<filtering>false</filtering>
<excludes>
<exclude>**/*-normalized.json</exclude>
+ <exclude>**/sample.kryo</exclude>
</excludes>
</resource>
</resources>
@@ -131,6 +132,33 @@ limitations under the License.
<includes>
<include>**/*.kryo</include>
</includes>
+ <excludes>
+ <exclude>**/sample.kryo</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <nonFilteredFileExtensions>
+ <nonFilteredFileExtension>kryo</nonFilteredFileExtension>
+ </nonFilteredFileExtensions>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-gio-from-tmp-to-gremlinserver</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ../gremlin-server/data
+ </outputDirectory>
+ <resources>
+ <resource>
+ <directory>${io.tmp.dir}</directory>
+ <filtering>false</filtering>
+ <includes>
+ <include>**/sample.kryo</include>
+ </includes>
</resource>
</resources>
<nonFilteredFileExtensions>
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d3a04e46/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
index 3845053..107b3a7 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java
@@ -21,6 +21,8 @@ package org.apache.tinkerpop.gremlin.tinkergraph.structure;
import org.apache.commons.io.FileUtils;
import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
import org.apache.tinkerpop.gremlin.TestHelper;
+import org.apache.tinkerpop.gremlin.algorithm.generator.DistributionGenerator;
+import org.apache.tinkerpop.gremlin.algorithm.generator.PowerLawDistribution;
import org.apache.tinkerpop.gremlin.structure.util.star.StarGraph;
import org.apache.tinkerpop.gremlin.process.traversal.T;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
@@ -50,6 +52,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.function.Supplier;
+import java.util.stream.IntStream;
import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
import static org.junit.Assert.assertEquals;
@@ -619,6 +622,22 @@ public class TinkerGraphTest {
}, 0.5).has("oid", "1").count().next());
}
+ @Test
+ public void shouldWriteSampleForGremlinServer() throws IOException {
+ final Graph g = TinkerGraph.open();
+ IntStream.range(0, 10000).forEach(i -> g.addVertex("oid", i));
+ DistributionGenerator.build(g)
+ .label("knows")
+ .seedGenerator(() -> 987654321l)
+ .outDistribution(new PowerLawDistribution(2.1))
+ .inDistribution(new PowerLawDistribution(2.1))
+ .expectedNumEdges(100000).create().generate();
+
+ final OutputStream os = new FileOutputStream(tempPath + "sample.kryo");
+ GryoWriter.build().create().writeGraph(os, g);
+ os.close();
+ }
+
/**
* This test helps with data conversions on Grateful Dead. No Assertions...run as needed. Never read from the
* GraphML source as it will always use a String identifier.