Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2302

Add isOnGraphComputer() field accessor to ElementMapStep



    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Done
    • 3.4.4, 3.5.0
    • 3.4.4, 3.5.0
    • process
    • None


      TINKERPOP-2284 added ElementMapStep.

      This step implements GraphComputing, so it defines that interface's onGraphComputer() method. The method sets a private boolean field.

      For any implementation that wants to alter ElementMapStep behavior by replacing instances of the step with an alternative implementation (maybe a subclass), it could be convenient to make the private onGraphComputer state accessible. I think the rest of ElementMapStep's public state is already accessible; it's just this field that is private.

      There are a few ways to go about this.

      • We could add an isOnGraphComputer() method to just ElementMapStep, or make onGraphComputer protected. This is the narrowest version of the change.
      • We could add an isOnGraphComputer() method to the GraphComputing interface. This would affect a bunch of implementing steps. Most implementations on tp34 have an internal boolean field storing this state, so it would be easy on those. However, GraphStep does not have a boolean onGraphComputer field:
            public void onGraphComputer() {
                this.iteratorSupplier = Collections::emptyIterator;

        We could maybe implement this without adding another field, but it would probably be simpler to add a field than to infer it from existing state.
        Altering this interface would also break any third-party implementations of GraphComputing.

      • We could create a GraphComputing subinterface that adds an isOnGraphComputer(), and only implement it where a preexisting boolean field makes the job easy. This somewhere in between the first two approaches in terms of scope.

      I'm going to open a PR taking the first, narrowest possible approach, where I'm only touching ElementMapStep. I'd be happy to rework it to one of the alternatives, if desired.




            spmallette Stephen Mallette
            dalaro Dan LaRocque
            0 Vote for this issue
            3 Start watching this issue