@Override public void assign(String propertyKey, Object propertyValue, GiraphConfiguration giraphConfiguration) { giraphConfiguration.setInt(giraphConfigurationKey, Integer.parseInt(propertyValue.toString())); } }
/** * Set worker configuration for determining what is required for * a superstep. * * @param minWorkers Minimum workers to do a superstep * @param maxWorkers Maximum workers to do a superstep * (max map tasks in job) * @param minPercentResponded 0 - 100 % of the workers required to * have responded before continuing the superstep */ public final void setWorkerConfiguration(int minWorkers, int maxWorkers, float minPercentResponded) { setInt(MIN_WORKERS, minWorkers); setInt(MAX_WORKERS, maxWorkers); MIN_PERCENT_RESPONDED.set(this, minPercentResponded); }
/** * 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(RandomMessageComputation.class); conf.setVertexInputFormatClass(PseudoRandomVertexInputFormat.class); conf.setWorkerContextClass(RandomMessageBenchmarkWorkerContext.class); conf.setMasterComputeClass(RandomMessageBenchmarkMasterCompute.class); conf.setLong(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES, BenchmarkOption.VERTICES.getOptionLongValue(cmd)); conf.setLong(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, BenchmarkOption.EDGES_PER_VERTEX.getOptionLongValue(cmd)); conf.setInt(SUPERSTEP_COUNT, BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd)); conf.setInt(RandomMessageBenchmark.NUM_BYTES_PER_MESSAGE, BYTES_PER_MESSAGE.getOptionIntValue(cmd)); conf.setInt(RandomMessageBenchmark.NUM_MESSAGES_PER_EDGE, MESSAGES_PER_EDGE.getOptionIntValue(cmd)); if (FLUSH_THREADS.optionTurnedOn(cmd)) { conf.setInt(GiraphConstants.MSG_NUM_FLUSH_THREADS, FLUSH_THREADS.getOptionIntValue(cmd)); } }
@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)); }
@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); }
PseudoRandomIntNullVertexInputFormat.class); conf.setInt(PseudoRandomInputFormatConstants.AGGREGATE_VERTICES, BenchmarkOption.VERTICES.getOptionIntValue(cmd)); conf.setInt(PseudoRandomInputFormatConstants.EDGES_PER_VERTEX, BenchmarkOption.EDGES_PER_VERTEX.getOptionIntValue(cmd)); conf.setInt(PageRankComputation.SUPERSTEP_COUNT, BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd)); conf.setFloat(PseudoRandomInputFormatConstants.LOCAL_EDGES_MIN_RATIO,
configuration.setInt(WeightedPageRankComputation.SUPERSTEP_COUNT, BenchmarkOption.SUPERSTEPS.getOptionIntValue(cmd));