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

Allow default GraphComputer configuration

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: 3.2.0-incubating
    • Fix Version/s: 3.2.0-incubating
    • Component/s: hadoop
    • Labels:
      None

      Description

      so that the user can simply do graph.compute()... without having to specify the graph computer.

      As of 3.0, we HadoopGraph does NOT have a default graph computer. This was done to not favor one technology over the other. We could allow the configuration to have a gremlin.hadoop.defaultGraphComputer=org.tinkerpop.SparkGRaphcomputer

      That configuration would be carried through the various result sets so that the user would only have to choose the graph computer initially (or it is pre-selected by the graph implementation) and from that point on would be defaulted.

        Activity

        Hide
        okram Marko A. Rodriguez added a comment - - edited

        This is the logic. This will go into an upcoming PR that has a bunch of other Hadoop configuration related work.

            @Override
            public GraphComputer compute() {
                if (this.configuration.containsKey(Constants.GREMLIN_HADOOP_DEFAULT_GRAPH_COMPUTER)) {
                    try {
                        return this.compute((Class<? extends GraphComputer>) Class.forName(this.configuration.getString(Constants.GREMLIN_HADOOP_DEFAULT_GRAPH_COMPUTER)));
                    } catch (final Exception e) {
                        throw new IllegalStateException(e.getMessage(), e);
                    }
                } else
                    throw new IllegalArgumentException("There is no default GraphComputer for HadoopGraph. Use HadoopGraph.compute(class) or gremlin.hadoop.defaultGraphComputer to specify the GraphComputer to use.");
            }
        
        Show
        okram Marko A. Rodriguez added a comment - - edited This is the logic. This will go into an upcoming PR that has a bunch of other Hadoop configuration related work. @Override public GraphComputer compute() { if ( this .configuration.containsKey(Constants.GREMLIN_HADOOP_DEFAULT_GRAPH_COMPUTER)) { try { return this .compute(( Class <? extends GraphComputer>) Class .forName( this .configuration.getString(Constants.GREMLIN_HADOOP_DEFAULT_GRAPH_COMPUTER))); } catch ( final Exception e) { throw new IllegalStateException(e.getMessage(), e); } } else throw new IllegalArgumentException( "There is no default GraphComputer for HadoopGraph. Use HadoopGraph.compute(class) or gremlin.hadoop.defaultGraphComputer to specify the GraphComputer to use." ); }

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development