@Test(expected = IllegalArgumentException.class) public void testGetNumberOfForksDoubleFunction() { ParallelSplitFunction.getNumberOfForksFromFunctionArgument("select * where {?s ?p ?o. filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(5, ?s) filter <" + PARALLEL_SPLIT_FUNCTION.toString() + ">(3, ?s)}", false, 0); }
public static int getNumberOfForksFromFunctionArgument(String query, boolean sparqlUpdate, int stage) throws IllegalArgumentException{ ParallelSplitFunctionVisitor psfv = new ParallelSplitFunctionVisitor(); if (sparqlUpdate) { List<UpdateExpr> exprs = QueryParserUtil.parseUpdate(QueryLanguage.SPARQL, query, null).getUpdateExprs(); if (exprs.size() > stage) { exprs.get(stage).visit(psfv); } } else { QueryParserUtil.parseQuery(QueryLanguage.SPARQL, query, null).getTupleExpr().visit(psfv); } return psfv.forks; }
ParallelSplitFunction implements Function { public static int getNumberOfForksFromFunctionArgument(String query, boolean sparqlUpdate, int stage) throws IllegalArgumentException{ ParallelSplitFunctionVisitor psfv = new ParallelSplitFunctionVisitor(); if (sparqlUpdate) { List<UpdateExpr> exprs = QueryParserUtil.parseUpdate(QueryLanguage.SPARQL, query, null).getUpdateExprs(); if (exprs.size() > stage) { exprs.get(stage).visit(psfv); } } else { QueryParserUtil.parseQuery(QueryLanguage.SPARQL, query, null).getTupleExpr().visit(psfv); } return psfv.forks; } }
ParallelSplitFunction implements Function { public static int getNumberOfForksFromFunctionArgument(String query, boolean sparqlUpdate, int stage) throws IllegalArgumentException{ ParallelSplitFunctionVisitor psfv = new ParallelSplitFunctionVisitor(); if (sparqlUpdate) { List<UpdateExpr> exprs = QueryParserUtil.parseUpdate(QueryLanguage.SPARQL, query, null).getUpdateExprs(); if (exprs.size() > stage) { exprs.get(stage).visit(psfv); } } else { QueryParserUtil.parseQuery(QueryLanguage.SPARQL, query, null).getTupleExpr().visit(psfv); } return psfv.forks; } ParallelSplitFunction(int forkIndex); }
ParallelSplitFunction implements Function { public static int getNumberOfForksFromFunctionArgument(String query, boolean sparqlUpdate, int stage) throws IllegalArgumentException{ ParallelSplitFunctionVisitor psfv = new ParallelSplitFunctionVisitor(); if (sparqlUpdate) { List<UpdateExpr> exprs = QueryParserUtil.parseUpdate(QueryLanguage.SPARQL, query, null).getUpdateExprs(); if (exprs.size() > stage) { exprs.get(stage).visit(psfv); } } else { QueryParserUtil.parseQuery(QueryLanguage.SPARQL, query, null).getTupleExpr().visit(psfv); } return psfv.forks; } ParallelSplitFunction(int forkIndex); @Override String getURI(); @Override Value evaluate(ValueFactory valueFactory, Value... args); static int getNumberOfForksFromFunctionArgument(String query, boolean sparqlUpdate, int stage); }
ParallelSplitFunction implements Function { public static int getNumberOfForksFromFunctionArgument(String query, boolean sparqlUpdate, int stage) throws IllegalArgumentException{ ParallelSplitFunctionVisitor psfv = new ParallelSplitFunctionVisitor(); if (sparqlUpdate) { List<UpdateExpr> exprs = QueryParserUtil.parseUpdate(QueryLanguage.SPARQL, query, null).getUpdateExprs(); if (exprs.size() > stage) { exprs.get(stage).visit(psfv); } } else { QueryParserUtil.parseQuery(QueryLanguage.SPARQL, query, null).getTupleExpr().visit(psfv); } return psfv.forks; } ParallelSplitFunction(int forkIndex); @Override String getURI(); @Override Value evaluate(ValueFactory valueFactory, Value... args); static int getNumberOfForksFromFunctionArgument(String query, boolean sparqlUpdate, int stage);  }