/** * Get the task partition * * @return The task partition or -1 if not set */ public int getTaskPartition() { return getInt("mapred.task.partition", -1); }
public final int getMinWorkers() { return getInt(MIN_WORKERS, -1); }
public final int getMaxWorkers() { return getInt(MAX_WORKERS, -1); }
/** * Get the number of map tasks in this job * * @return Number of map tasks in this job */ public int getMapTasks() { int mapTasks = getInt("mapred.map.tasks", -1); if (mapTasks == -1) { throw new IllegalStateException("getMapTasks: Failed to get the map " + "tasks!"); } return mapTasks; }
/** * Check whether a specified int conf value is set and if not, set it. * * @param param Conf value to check * @param defaultValue Assign to value if not set */ private void setIntConfIfDefault(String param, int defaultValue) { if (giraphConfiguration.getInt(param, Integer.MIN_VALUE) == Integer.MIN_VALUE) { giraphConfiguration.setInt(param, defaultValue); } }
@Override protected void prepareConfiguration(GiraphConfiguration conf, CommandLine cmd) { conf.setComputationClass(ReducersBenchmarkComputation.class); conf.setMasterComputeClass(ReducersBenchmarkMasterCompute.class); conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class); conf.setWorkerContextClass(ReducersBenchmarkWorkerContext.class); conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES, BenchmarkOption.VERTICES.getOptionLongValue(cmd)); conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, 1); conf.setInt(REDUCERS_NUM, REDUCERS.getOptionIntValue(cmd)); conf.setInt("workers", conf.getInt(GiraphConstants.MAX_WORKERS, -1)); }
int workers = conf.getInt(GiraphConstants.MIN_WORKERS, -1); Preconditions.checkArgument(workers > 0, "Number of workers not set"); int cores = MAPPER_CORES.get(conf);
@Override protected void prepareConfiguration(GiraphConfiguration conf, CommandLine cmd) { conf.setComputationClass(AggregatorsBenchmarkComputation.class); conf.setMasterComputeClass(AggregatorsBenchmarkMasterCompute.class); conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class); conf.setWorkerContextClass(AggregatorsBenchmarkWorkerContext.class); conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES, BenchmarkOption.VERTICES.getOptionLongValue(cmd)); conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, 1); conf.setInt(AGGREGATORS_NUM, AGGREGATORS.getOptionIntValue(cmd)); conf.setInt("workers", conf.getInt(GiraphConstants.MAX_WORKERS, -1)); MasterLoggingAggregator.setUseMasterLoggingAggregator(true, conf); }