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

Add Memory.reduce() as option to Memory implementations.

    Details

      Description

      Currently Memory supports incr, and, or, ... These are great and what people will typically use. However, we should also provide the generalization which is simply Memory.reduce. In this situation, incr, or, and, etc. are just specifications of Memory.reduce.

      How would it work?

      When memory is initialized in a VertexProgram, it would be like this:

      memory.set("myReduction", new MyReducingFunction(0))
      

      Then ReducingFunction would look like this:

      public class ReducingFunction implements UnaryOperator<A> {
      
        public A getInitialValue();
      
        public A apply(A first, A second);
      }
      

      Easy peasy. Note that both Spark and Giraph support such types of function-based reduction in their respective "memory engines." TinkerGraphComputer will, of course, be easy to add this functionality too.

      Why do this? For two reasons:

      1. We get extra flexibility in Memory.
      2. https://issues.apache.org/jira/browse/TINKERPOP-1164

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                okram Marko A. Rodriguez
                Reporter:
                okram Marko A. Rodriguez
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: