throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraphMode, this.persistMode); if (this.numThreads > this.features().getMaxWorkers()) throw GraphComputer.Exceptions.computerRequiresMoreWorkersThanSupported(this.numThreads, this.features().getMaxWorkers());
@Test @LoadGraphWith(GRATEFUL) public void shouldSupportWorkerCount() throws Exception { int maxWorkers = graphProvider.getGraphComputer(graph).features().getMaxWorkers(); if (maxWorkers != Integer.MAX_VALUE) { for (int i = maxWorkers + 1; i < maxWorkers + 10; i++) { try { graphProvider.getGraphComputer(graph).program(new VertexProgramL()).workers(i).submit().get(); fail("Should throw a GraphComputer.Exceptions.computerRequiresMoreWorkersThanSupported() exception"); } catch (final IllegalArgumentException e) { assertTrue(e.getMessage().contains("computer requires more workers")); } } } if (maxWorkers > 25) maxWorkers = 25; for (int i = 1; i <= maxWorkers; i++) { ComputerResult result = graphProvider.getGraphComputer(graph).program(new VertexProgramL()).workers(i).submit().get(); assertEquals(Integer.valueOf(i).longValue(), (long) result.memory().get("workerCount")); } }
throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraph, this.persist); if (this.workers > this.features().getMaxWorkers()) throw GraphComputer.Exceptions.computerRequiresMoreWorkersThanSupported(this.workers, this.features().getMaxWorkers());
throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraph, this.persist); if (this.workers > this.features().getMaxWorkers()) throw GraphComputer.Exceptions.computerRequiresMoreWorkersThanSupported(this.workers, this.features().getMaxWorkers());
throw GraphComputer.Exceptions.resultGraphPersistCombinationNotSupported(this.resultGraph, this.persist); if (this.workers > this.features().getMaxWorkers()) throw GraphComputer.Exceptions.computerRequiresMoreWorkersThanSupported(this.workers, this.features().getMaxWorkers());
@Test @LoadGraphWith(GRATEFUL) public void shouldSupportWorkerCount() throws Exception { int maxWorkers = graphProvider.getGraphComputer(graph).features().getMaxWorkers(); if (maxWorkers != Integer.MAX_VALUE) { for (int i = maxWorkers + 1; i < maxWorkers + 10; i++) { try { graphProvider.getGraphComputer(graph).program(new VertexProgramL()).workers(i).submit().get(); fail("Should throw a GraphComputer.Exceptions.computerRequiresMoreWorkersThanSupported() exception"); } catch (final IllegalArgumentException e) { assertTrue(e.getMessage().contains("computer requires more workers")); } } } if (maxWorkers > 25) maxWorkers = 25; for (int i = 1; i <= maxWorkers; i++) { ComputerResult result = graphProvider.getGraphComputer(graph).program(new VertexProgramL()).workers(i).submit().get(); assertEquals(Integer.valueOf(i).longValue(), (long) result.memory().get("workerCount")); } }