Skip to content

Commit

Permalink
Addition compile error fixes
Browse files Browse the repository at this point in the history
The only remaining compile errors in TitanGraphTest following this
commit should be inside testTinkerPopOptimizationStrategies and the
private helper method called only by that method (assertNumStep).  It
is possible to refactor this test to be TP3-strategy-oblivious, but
then much of its distinctive value would be lost.  Leaving it broken
for the time being.

I gave this only one close read through the git-diff before
committing.  This hasn't been tested at all.  There could easily be
some runtime errors in here that I missed.
  • Loading branch information
dalaro committed Apr 9, 2015
1 parent e163a07 commit bc80e70
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 84 deletions.
@@ -1,11 +1,13 @@
package com.thinkaurelius.titan.graphdb; package com.thinkaurelius.titan.graphdb;


import com.google.common.collect.Iterables;
import com.thinkaurelius.titan.core.*; import com.thinkaurelius.titan.core.*;
import com.thinkaurelius.titan.core.schema.EdgeLabelMaker; import com.thinkaurelius.titan.core.schema.EdgeLabelMaker;
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration; import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration;
import com.thinkaurelius.titan.testcategory.PerformanceTests; import com.thinkaurelius.titan.testcategory.PerformanceTests;
import com.thinkaurelius.titan.testutil.JUnitBenchmarkProvider; import com.thinkaurelius.titan.testutil.JUnitBenchmarkProvider;
import com.thinkaurelius.titan.testutil.RandomGenerator; import com.thinkaurelius.titan.testutil.RandomGenerator;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.After; import org.junit.After;
Expand Down Expand Up @@ -370,8 +372,8 @@ public FixedRelationshipMaker(TitanTransaction tx,
public void run() { public void run() {
while (true) { while (true) {
// Make or break relType between two (possibly same) random nodes // Make or break relType between two (possibly same) random nodes
TitanVertex source = getOnlyElement(tx.query().has(idKey, 0).vertices()); TitanVertex source = Iterables.<TitanVertex>getOnlyElement(tx.query().has(idKey, 0).vertices());
TitanVertex sink = getOnlyElement(tx.query().has(idKey, 1).vertices()); TitanVertex sink = Iterables.<TitanVertex>getOnlyElement(tx.query().has(idKey, 1).vertices());
for (Edge r : source.outE(elabel).toList()) { for (Edge r : source.outE(elabel).toList()) {
if (getId(r.inV().next()) == getId(sink)) { if (getId(r.inV().next()) == getId(sink)) {
r.remove(); r.remove();
Expand Down Expand Up @@ -405,12 +407,12 @@ public SimpleReader(TitanTransaction tx, CountDownLatch startLatch,


@Override @Override
protected void doRun() throws Exception { protected void doRun() throws Exception {
TitanVertex v = getOnlyElement(tx.query().has(idKey, vertexid).vertices()); TitanVertex v = Iterables.<TitanVertex>getOnlyElement(tx.query().has(idKey, vertexid).vertices());


for (int i = 0; i < nodeTraversalCount; i++) { for (int i = 0; i < nodeTraversalCount; i++) {
assertCount(expectedEdges, v.bothE(label2Traverse)); assertCount(expectedEdges, v.query().labels(label2Traverse).direction(Direction.BOTH).edges());
for (Edge r : v.outE(label2Traverse).toList()) { for (TitanEdge r : v.query().direction(Direction.OUT).labels(label2Traverse).edges()) {
v = r.inV().next(); v = r.vertex(Direction.IN);
} }
} }
} }
Expand Down Expand Up @@ -465,7 +467,7 @@ public VertexPropertyQuerier(int propCount, int vertexCount) {
public void run() { public void run() {
for (int i = 0; i < vertexCount; i++) { for (int i = 0; i < vertexCount; i++) {
for (int p = 0; p < propCount; p++) { for (int p = 0; p < propCount; p++) {
tx.V().has("p" + p, i).count().next(); Iterables.size(tx.query().has("p" + p, i).vertices());
} }
} }
} }
Expand Down

0 comments on commit bc80e70

Please sign in to comment.