tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [1/2] incubator-tinkerpop git commit: this is an intense commit. No more traverser species. There is now JUST DefaultTraverser. Its super ghetto rigged right now, but I will be able to make it cleaner. This completely changes the complexity of traversal
Date Tue, 01 Dec 2015 22:56:26 GMT
Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/TINKERPOP3-1014 [created] beebbbc7f


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/AbstractTraverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/AbstractTraverser.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/AbstractTraverser.java
deleted file mode 100644
index 1ced9ef..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/AbstractTraverser.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * 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.process.traversal.traverser.util;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.process.traversal.Step;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyPath;
-import org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversalSideEffects;
-import org.apache.tinkerpop.gremlin.structure.util.Attachable;
-import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory;
-
-import java.util.Set;
-import java.util.function.Function;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public abstract class AbstractTraverser<T> implements Traverser<T>, Traverser.Admin<T>
{
-
-    protected T t;
-
-    protected AbstractTraverser() {
-
-    }
-
-    public AbstractTraverser(final T t) {
-        this.t = t;
-    }
-
-    /////////////
-
-    @Override
-    public void merge(final Admin<?> other) {
-        throw new UnsupportedOperationException("This traverser does not support merging:
" + this.getClass().getCanonicalName());
-    }
-
-    @Override
-    public <R> Admin<R> split(final R r, final Step<T, R> step) {
-        try {
-            final AbstractTraverser<R> clone = (AbstractTraverser<R>) super.clone();
-            clone.t = r;
-            return clone;
-        } catch (final CloneNotSupportedException e) {
-            throw new IllegalStateException(e.getMessage(), e);
-        }
-    }
-
-    @Override
-    public Admin<T> split() {
-        try {
-            return (AbstractTraverser<T>) super.clone();
-        } catch (final CloneNotSupportedException e) {
-            throw new IllegalStateException(e.getMessage(), e);
-        }
-    }
-
-    @Override
-    public void addLabels(final Set<String> labels) {
-
-    }
-
-    @Override
-    public void set(final T t) {
-        this.t = t;
-    }
-
-    @Override
-    public void incrLoops(final String stepLabel) {
-
-    }
-
-    @Override
-    public void resetLoops() {
-
-    }
-
-    @Override
-    public String getStepId() {
-        throw new UnsupportedOperationException("This traverser does not support futures:
" + this.getClass().getCanonicalName());
-    }
-
-    @Override
-    public void setStepId(final String stepId) {
-
-    }
-
-    @Override
-    public void setBulk(final long count) {
-
-    }
-
-    @Override
-    public Admin<T> detach() {
-        this.t = ReferenceFactory.detach(this.t);
-        return this;
-    }
-
-    @Override
-    public T attach(final Function<Attachable<T>, T> method) {
-        // you do not want to attach a path because it will reference graph objects not at
the current vertex
-        if (this.t instanceof Attachable && !(((Attachable) this.t).get() instanceof
Path))
-            this.t = ((Attachable<T>) this.t).attach(method);
-        return this.t;
-    }
-
-    @Override
-    public void setSideEffects(final TraversalSideEffects sideEffects) {
-
-    }
-
-    @Override
-    public TraversalSideEffects getSideEffects() {
-        return EmptyTraversalSideEffects.instance();
-        //throw new UnsupportedOperationException("This traverser does not support sideEffects:
" + this.getClass().getCanonicalName());
-    }
-
-    @Override
-    public T get() {
-        return this.t;
-    }
-
-    @Override
-    public <S> S sack() {
-        throw new UnsupportedOperationException("This traverser does not support sacks: "
+ this.getClass().getCanonicalName());
-    }
-
-    @Override
-    public <S> void sack(final S object) {
-
-    }
-
-    @Override
-    public Path path() {
-        return EmptyPath.instance();
-    }
-
-    @Override
-    public int loops() {
-        throw new UnsupportedOperationException("This traverser does not support loops: "
+ this.getClass().getCanonicalName());
-    }
-
-    @Override
-    public long bulk() {
-        return 1l;
-    }
-
-    @Override
-    @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException")
-    public AbstractTraverser<T> clone() {
-        try {
-            return (AbstractTraverser<T>) super.clone();
-        } catch (final CloneNotSupportedException e) {
-            throw new IllegalStateException(e.getMessage(), e);
-        }
-    }
-
-    ///////////
-
-    @Override
-    public int hashCode() {
-        return this.t.hashCode();
-    }
-
-    @Override
-    public boolean equals(final Object object) {
-        return object instanceof AbstractTraverser && ((AbstractTraverser) object).get().equals(this.t);
-    }
-
-    @Override
-    public String toString() {
-        return this.t.toString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/DefaultTraverserGeneratorFactory.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/DefaultTraverserGeneratorFactory.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/DefaultTraverserGeneratorFactory.java
deleted file mode 100644
index 60a22ca..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/DefaultTraverserGeneratorFactory.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.process.traversal.traverser.util;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_P_S_SE_SL_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_S_SE_SL_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_O_S_SE_SL_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_O_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.LP_O_OB_P_S_SE_SL_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.LP_O_OB_S_SE_SL_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.O_OB_S_SE_SL_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.O_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
-
-import java.util.Set;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class DefaultTraverserGeneratorFactory implements TraverserGeneratorFactory {
-
-    private static DefaultTraverserGeneratorFactory INSTANCE = new DefaultTraverserGeneratorFactory();
-
-    public static DefaultTraverserGeneratorFactory instance() {
-        return INSTANCE;
-    }
-
-    private DefaultTraverserGeneratorFactory() {
-    }
-
-    @Override
-    public TraverserGenerator getTraverserGenerator(final Traversal.Admin<?, ?> traversal)
{
-        final Set<TraverserRequirement> requirements = traversal.getTraverserRequirements();
-
-        if (requirements.contains(TraverserRequirement.ONE_BULK)) {
-            if (O_OB_S_SE_SL_TraverserGenerator.instance().getProvidedRequirements().containsAll(requirements))
-                return O_OB_S_SE_SL_TraverserGenerator.instance();
-
-            if (LP_O_OB_S_SE_SL_TraverserGenerator.instance().getProvidedRequirements().containsAll(requirements))
-                return LP_O_OB_S_SE_SL_TraverserGenerator.instance();
-
-            if (LP_O_OB_P_S_SE_SL_TraverserGenerator.instance().getProvidedRequirements().containsAll(requirements))
-                return LP_O_OB_P_S_SE_SL_TraverserGenerator.instance();
-        } else {
-            if (O_TraverserGenerator.instance().getProvidedRequirements().containsAll(requirements))
-                return O_TraverserGenerator.instance();
-
-            if (B_O_TraverserGenerator.instance().getProvidedRequirements().containsAll(requirements))
-                return B_O_TraverserGenerator.instance();
-
-            if (B_O_S_SE_SL_TraverserGenerator.instance().getProvidedRequirements().containsAll(requirements))
-                return B_O_S_SE_SL_TraverserGenerator.instance();
-
-            if (B_LP_O_S_SE_SL_TraverserGenerator.instance().getProvidedRequirements().containsAll(requirements))
-                return B_LP_O_S_SE_SL_TraverserGenerator.instance();
-
-            if (B_LP_O_P_S_SE_SL_TraverserGenerator.instance().getProvidedRequirements().containsAll(requirements))
-                return B_LP_O_P_S_SE_SL_TraverserGenerator.instance();
-        }
-
-        throw new IllegalStateException("The provided traverser generator factory does not
support the requirements of the traversal: " + this.getClass().getCanonicalName() + requirements);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/EmptyTraverser.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/EmptyTraverser.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/EmptyTraverser.java
deleted file mode 100644
index da391f5..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/EmptyTraverser.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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.process.traversal.traverser.util;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.process.traversal.Step;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyPath;
-import org.apache.tinkerpop.gremlin.structure.util.Attachable;
-
-import java.util.Collections;
-import java.util.Set;
-import java.util.function.Function;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class EmptyTraverser<T> implements Traverser<T>, Traverser.Admin<T>
{
-
-    private static final EmptyTraverser INSTANCE = new EmptyTraverser();
-
-    public static <R> EmptyTraverser<R> instance() {
-        return INSTANCE;
-    }
-
-    private EmptyTraverser() {
-
-    }
-
-    @Override
-    public void addLabels(final Set<String> labels) {
-
-    }
-
-    @Override
-    public void set(final T t) {
-
-    }
-
-    @Override
-    public void incrLoops(final String stepLabel) {
-
-    }
-
-    @Override
-    public void resetLoops() {
-
-    }
-
-    @Override
-    public String getStepId() {
-        return HALT;
-    }
-
-    @Override
-    public void setStepId(final String stepId) {
-
-    }
-
-    @Override
-    public void setBulk(long count) {
-
-    }
-
-    @Override
-    public <R> Admin<R> split(final R r, final Step<T, R> step) {
-        return INSTANCE;
-    }
-
-    @Override
-    public Admin<T> split() {
-        return this;
-    }
-
-    @Override
-    public Admin<T> detach() {
-        return this;
-    }
-
-    @Override
-    public T attach(final Function<Attachable<T>, T> method) {
-        return null;
-    }
-
-    @Override
-    public void setSideEffects(final TraversalSideEffects sideEffects) {
-
-    }
-
-    @Override
-    public T get() {
-        return null;
-    }
-
-    @Override
-    public <S> S sack() {
-        return null;
-    }
-
-    @Override
-    public <S> void sack(final S object) {
-
-    }
-
-    @Override
-    public void merge(final Traverser.Admin<?> other) {
-
-    }
-
-    @Override
-    public Path path() {
-        return EmptyPath.instance();
-    }
-
-    @Override
-    public int loops() {
-        return 0;
-    }
-
-    @Override
-    public long bulk() {
-        return 0l;
-    }
-
-    @Override
-    public TraversalSideEffects getSideEffects() {
-        return null;
-    }
-
-    @Override
-    public Set<String> getTags() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public int hashCode() {
-        return 380473707;
-    }
-
-    @Override
-    public boolean equals(final Object object) {
-        return object instanceof EmptyTraverser;
-    }
-
-    @Override
-    @SuppressWarnings("CloneDoesntCallSuperClone")
-    public EmptyTraverser<T> clone() {
-        return this;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalStrategies.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalStrategies.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalStrategies.java
index 7eae1ea..ec63388 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalStrategies.java
@@ -22,7 +22,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.DefaultTraverserGeneratorFactory;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.DefaultTraverserGeneratorFactory;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalStrategies.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalStrategies.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalStrategies.java
index d79015e..c9f0578 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalStrategies.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/EmptyTraversalStrategies.java
@@ -22,7 +22,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserGeneratorFactory;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.DefaultTraverserGeneratorFactory;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.DefaultTraverserGeneratorFactory;
 
 import java.util.Collections;
 import java.util.List;

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
index 1fec5c8..50e76b9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java
@@ -24,14 +24,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Contains;
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_P_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_O_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_O_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.LP_O_OB_P_S_SE_SL_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.LP_O_OB_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.O_OB_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.O_Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.DefaultTraverser;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet;
 import org.apache.tinkerpop.gremlin.process.traversal.util.DependantMutableMetrics;
 import org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics;
@@ -228,7 +221,7 @@ public final class GryoMapper implements Mapper<Kryo> {
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(EnumSet.class,
null, 46));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(HashMap.class,
null, 11));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(HashMap.Entry.class,
null, 16));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(HASH_MAP_NODE,
null, 92));   // ***LAST ID**
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(HASH_MAP_NODE,
null, 92));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(KryoSerializable.class,
null, 36));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LinkedHashMap.class,
null, 47));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LinkedHashSet.class,
null, 71));
@@ -258,14 +251,8 @@ public final class GryoMapper implements Mapper<Kryo> {
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(VertexProperty.class,
kryo -> new GryoSerializers.VertexPropertySerializer(), 68));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Path.class,
kryo -> new GryoSerializers.PathSerializer(), 59));
             // skip 55
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(B_O_Traverser.class,
null, 75));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(O_Traverser.class,
null, 76));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(B_LP_O_P_S_SE_SL_Traverser.class,
null, 77));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(B_O_S_SE_SL_Traverser.class,
null, 78));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(B_LP_O_S_SE_SL_Traverser.class,
null, 87));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(O_OB_S_SE_SL_Traverser.class,
null, 89));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LP_O_OB_S_SE_SL_Traverser.class,
null, 90));
-            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(LP_O_OB_P_S_SE_SL_TraverserGenerator.class,
null, 91));
+            // skip 75, 76, 77, 78, 87, 89, 90, 91 (old traverser species)
+            add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(DefaultTraverser.class,
null, 93)); // ***LAST ID**
 
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(TraverserSet.class,
null, 58));
             add(Triplet.<Class, Function<Kryo, Serializer>, Integer>with(Tree.class,
null, 61));

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
index 7360e24..3d827e4 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStepTest.java
@@ -29,8 +29,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.ConnectiveStep
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WherePredicateStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTraversalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.EmptyStep;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_P_S_SE_SL_TraverserGenerator;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.EmptyTraverser;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.ImmutablePath;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.DefaultTraverser;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.EmptyTraverser;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.junit.Test;
 
@@ -361,7 +362,7 @@ public class MatchStepTest extends StepTest {
         countMatchAlgorithm.recordEnd(EmptyTraverser.instance(), forthPattern);
         countMatchAlgorithm.recordEnd(EmptyTraverser.instance(), forthPattern);
         //
-        Traverser.Admin traverser = B_LP_O_P_S_SE_SL_TraverserGenerator.instance().generate(1,
EmptyStep.instance(), 1l);
+        Traverser.Admin traverser = new DefaultTraverser<>(1, EmptyStep.instance(),
1l, ImmutablePath.make().extend(1, Collections.emptySet()), false, false); // TODO: SHOULD
WORK WITH ONLY LABELED PATHS
         traverser.addLabels(Collections.singleton("a"));
         assertEquals(firstPattern, countMatchAlgorithm.apply(traverser));
         traverser = traverser.split(1, EmptyStep.instance());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/DefaultTraverserGeneratorFactoryTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/DefaultTraverserGeneratorFactoryTest.java
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/DefaultTraverserGeneratorFactoryTest.java
deleted file mode 100644
index bdf5def..0000000
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/traverser/util/DefaultTraverserGeneratorFactoryTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.process.traversal.traverser.util;
-
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_P_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_O_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_O_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.LP_O_OB_P_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.LP_O_OB_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.O_OB_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.O_Traverser;
-import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public class DefaultTraverserGeneratorFactoryTest {
-
-    @Test
-    public void shouldProduceExpectedTraverser() {
-        final GraphTraversalSource traversalSource = EmptyGraph.instance().traversal();
-        final Object start = new Object();
-
-        Traversal.Admin traversal = traversalSource.V().out().asAdmin();
-        traversal.applyStrategies();
-        assertEquals(O_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-        //
-        traversal = traversalSource.V().out().barrier().asAdmin();
-        traversal.applyStrategies();
-        assertEquals(B_O_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-        //
-        traversal = traversalSource.V().repeat(__.out()).times(10).asAdmin();
-        traversal.applyStrategies();
-        assertEquals(B_O_S_SE_SL_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-        //
-        traversal = traversalSource.V().out().sack().asAdmin();
-        traversal.applyStrategies();
-        assertEquals(B_O_S_SE_SL_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-        //
-        traversal = traversalSource.V().out().sack().as("a").select("a").asAdmin();
-        traversal.applyStrategies();
-        assertEquals(B_LP_O_S_SE_SL_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-        //
-        traversal = traversalSource.V().out().path().asAdmin();
-        traversal.applyStrategies();
-        assertEquals(B_LP_O_P_S_SE_SL_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-        //
-        traversal = traversalSource.withBulk(false).V().out().asAdmin();
-        traversal.applyStrategies();
-        assertEquals(O_OB_S_SE_SL_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-        //
-        traversal = traversalSource.withBulk(false).V().as("a").out().select("a").asAdmin();
-        traversal.applyStrategies();
-        assertEquals(LP_O_OB_S_SE_SL_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-        //
-        traversal = traversalSource.withBulk(false).V().out().path().asAdmin();
-        traversal.applyStrategies();
-        assertEquals(LP_O_OB_P_S_SE_SL_Traverser.class, traversal.getTraverserGenerator().generate(start,
traversal.getStartStep(), 1l).getClass());
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/beebbbc7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
index 1941ac4..a3111f3 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/GraphProvider.java
@@ -29,11 +29,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.process.traversal.engine.StandardTraversalEngine;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_P_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_LP_O_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_O_S_SE_SL_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.B_O_Traverser;
-import org.apache.tinkerpop.gremlin.process.traversal.traverser.O_Traverser;
+import org.apache.tinkerpop.gremlin.process.traversal.traverser.DefaultTraverser;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Element;
 import org.apache.tinkerpop.gremlin.structure.Graph;
@@ -78,11 +74,7 @@ public interface GraphProvider {
         add(__.class);
         add(DefaultGraphTraversal.class);
         add(GraphTraversalSource.class);
-        add(B_O_S_SE_SL_Traverser.class);
-        add(B_LP_O_P_S_SE_SL_Traverser.class);
-        add(B_LP_O_S_SE_SL_Traverser.class);
-        add(B_O_Traverser.class);
-        add(O_Traverser.class);
+        add(DefaultTraverser.class);
     }};
 
     /**
@@ -238,9 +230,8 @@ public interface GraphProvider {
      * <li>{@link Graph}</li>
      * <li>{@link org.apache.tinkerpop.gremlin.structure.Graph.Variables}</li>
      * <li>{@link GraphTraversal}</li>
-     * <li>{@link B_LP_O_P_S_SE_SL_Traverser}</li>
+     * <li>{@link DefaultTraverser}</li>
      * <li>{@link Property}</li>
-     * <li>{@link B_O_S_SE_SL_Traverser}</li>
      * <li>{@link Traversal}</li>
      * <li>{@link Traverser}</li>
      * <li>{@link Vertex}</li>


Mime
View raw message