throw GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers();
throw GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers();
protected void validateStatePriorToExecution() { // a graph computer can only be executed one time if (this.executed) throw Exceptions.computerHasAlreadyBeenSubmittedAVertexProgram(); else this.executed = true; // it is not possible execute a computer if it has no vertex program nor mapreducers if (null == this.vertexProgram && this.mapReducers.isEmpty()) throw GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers(); // it is possible to run mapreducers without a vertex program if (null != this.vertexProgram) { GraphComputerHelper.validateProgramOnComputer(this, vertexProgram); this.mapReducers.addAll(this.vertexProgram.getMapReducers()); } // if the user didn't set desired persistence/resultgraph, then get from vertex program or else, no persistence this.persist = GraphComputerHelper.getPersistState(Optional.ofNullable(this.vertexProgram), Optional.ofNullable(this.persist)); this.resultGraph = GraphComputerHelper.getResultGraphState(Optional.ofNullable(this.vertexProgram), Optional.ofNullable(this.resultGraph)); // determine persistence and result graph options if (!this.features().supportsResultGraphPersistCombination(this.resultGraph, this.persist)) throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraph, this.persist); // if too many workers are requested, throw appropriate exception if (this.workers > this.features().getMaxWorkers()) throw GraphComputer.Exceptions.computerRequiresMoreWorkersThanSupported(this.workers, this.features().getMaxWorkers()); }
throw GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers();
throw GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers();
throw GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers();
protected void validateStatePriorToExecution() { // a graph computer can only be executed one time if (this.executed) throw Exceptions.computerHasAlreadyBeenSubmittedAVertexProgram(); else this.executed = true; // it is not possible execute a computer if it has no vertex program nor mapreducers if (null == this.vertexProgram && this.mapReducers.isEmpty()) throw GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers(); // it is possible to run mapreducers without a vertex program if (null != this.vertexProgram) { GraphComputerHelper.validateProgramOnComputer(this, vertexProgram); this.mapReducers.addAll(this.vertexProgram.getMapReducers()); } // if the user didn't set desired persistence/resultgraph, then get from vertex program or else, no persistence this.persist = GraphComputerHelper.getPersistState(Optional.ofNullable(this.vertexProgram), Optional.ofNullable(this.persist)); this.resultGraph = GraphComputerHelper.getResultGraphState(Optional.ofNullable(this.vertexProgram), Optional.ofNullable(this.resultGraph)); // determine persistence and result graph options if (!this.features().supportsResultGraphPersistCombination(this.resultGraph, this.persist)) throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraph, this.persist); // if too many workers are requested, throw appropriate exception if (this.workers > this.features().getMaxWorkers()) throw GraphComputer.Exceptions.computerRequiresMoreWorkersThanSupported(this.workers, this.features().getMaxWorkers()); }
@Test @LoadGraphWith(MODERN) public void shouldNotAllowWithNoVertexProgramNorMapReducers() throws Exception { try { graphProvider.getGraphComputer(graph).submit().get(); fail("Should throw an IllegalStateException when there is no vertex program nor map reducers"); } catch (Exception ex) { validateException(GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers(), ex); } }
throw GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers();
@Test @LoadGraphWith(MODERN) public void shouldNotAllowWithNoVertexProgramNorMapReducers() throws Exception { try { graphProvider.getGraphComputer(graph).submit().get(); fail("Should throw an IllegalStateException when there is no vertex program nor map reducers"); } catch (Exception ex) { validateException(GraphComputer.Exceptions.computerHasNoVertexProgramNorMapReducers(), ex); } }