GiraphConfiguration extends Configuration implements GiraphConstants { public final void setClasses(String name, Class<?> xface, Class<?> ... klasses) { String[] klassNames = new String[klasses.length]; for (int i = 0; i < klasses.length; ++i) { Class<?> klass = klasses[i]; if (!xface.isAssignableFrom(klass)) { throw new RuntimeException(klass + " does not implement " + xface.getName()); } klassNames[i] = klasses[i].getName(); } setStrings(name, klassNames); } GiraphConfiguration();  GiraphConfiguration(Configuration conf); String getComputationName(); Class<? extends ComputationFactory> getComputationFactoryClass(); Class<? extends Computation> getComputationClass(); void setComputationClass(
      Class<? extends Computation> computationClass); final void setVertexValueFactoryClass(
      Class<? extends VertexValueFactory> vertexValueFactoryClass); void setEdgeInputFilterClass(
      Class<? extends EdgeInputFilter> edgeFilterClass); void setVertexInputFilterClass(
      Class<? extends VertexInputFilter> vertexFilterClass); Class<? extends OutEdges> getOutEdgesClass(); final void setOutEdgesClass(
      Class<? extends OutEdges> outEdgesClass); final void setVertexClass(Class<? extends Vertex> vertexClass); final void setInputOutEdgesClass(
      Class<? extends OutEdges> inputOutEdgesClass); boolean reuseEdgeObjects(); boolean reuseVertexObjects(); Class<? extends Partition> getPartitionClass(); boolean hasVertexInputFormat(); void setVertexInputFormatClass(
      Class<? extends VertexInputFormat> vertexInputFormatClass); boolean hasEdgeInputFormat(); void setEdgeInputFormatClass(
      Class<? extends EdgeInputFormat> edgeInputFormatClass); void setMappingInputFormatClass(
    Class<? extends MappingInputFormat> mappingInputFormatClass); final void setMasterComputeClass(
      Class<? extends MasterCompute> masterComputeClass); final void addMasterObserverClass(
      Class<? extends MasterObserver> masterObserverClass); final void addWorkerObserverClass(
      Class<? extends WorkerObserver> workerObserverClass); final void addMapperObserverClass(
      Class<? extends MapperObserver> mapperObserverClass); final void addGcObserverClass(
      Class<? extends GcObserver> gcObserverClass); Class<? extends GiraphJobObserver> getJobObserverClass(); void setJobObserverClass(Class<? extends GiraphJobObserver> klass); Class<? extends GiraphJobRetryChecker> getJobRetryCheckerClass(); void setJobRetryCheckerClass(
      Class<? extends GiraphJobRetryChecker> klass); boolean isJMapHistogramDumpEnabled(); boolean isReactiveJmapHistogramDumpEnabled(); final void setClasses(String name, Class<?> xface,
                               Class<?> ... klasses); boolean hasVertexOutputFormat(); final void setVertexOutputFormatClass(
      Class<? extends VertexOutputFormat> vertexOutputFormatClass); boolean hasVertexOutputFormatSubdir(); final void setVertexOutputFormatSubdir(String path); final boolean doOutputDuringComputation(); final void setDoOutputDuringComputation(
      boolean doOutputDuringComputation); final boolean vertexOutputFormatThreadSafe(); final void setVertexOutputFormatThreadSafe(
      boolean vertexOutputFormatThreadSafe); boolean hasEdgeOutputFormat(); final void setEdgeOutputFormatClass(
      Class<? extends EdgeOutputFormat> edgeOutputFormatClass); boolean hasEdgeOutputFormatSubdir(); final void setEdgeOutputFormatSubdir(String path); final int getNumOutputThreads(); void setNumOutputThreads(int numOutputThreads); void setMessageCombinerClass(
      Class<? extends MessageCombiner> messageCombinerClass); final void setGraphPartitionerFactoryClass(
      Class<? extends GraphPartitionerFactory> graphPartitionerFactoryClass); final void setVertexResolverClass(
      Class<? extends VertexResolver> vertexResolverClass); final boolean getResolverCreateVertexOnMessages(); final void setResolverCreateVertexOnMessages(boolean v); final void setVertexValueCombinerClass(
      Class<? extends VertexValueCombiner> vertexValueCombinerClass); final void setWorkerContextClass(
      Class<? extends WorkerContext> workerContextClass); final void setAggregatorWriterClass(
      Class<? extends AggregatorWriter> aggregatorWriterClass); final void setPartitionClass(
      Class<? extends Partition> partitionClass); final void setWorkerConfiguration(int minWorkers,
                                           int maxWorkers,
                                           float minPercentResponded); final int getMinWorkers(); final int getMaxWorkers(); final float getMinPercentResponded(); final int getMaxMappers(); final void setZooKeeperConfiguration(String serverList); final boolean getSplitMasterWorker(); Class<? extends MasterObserver>[] getMasterObserverClasses(); Class<? extends WorkerObserver>[] getWorkerObserverClasses(); Class<? extends MapperObserver>[] getMapperObserverClasses(); Class<? extends GcObserver>[] getGcObserverClasses(); boolean metricsEnabled(); int getTaskPartition(); boolean isPureYarnJob(); String getYarnLibJars(); void setYarnLibJars(String jarList); int getYarnTaskHeapMb(); void setYarnTaskHeapMb(int heapMb); String getZookeeperList(); void setZookeeperList(String zkList); boolean isZookeeperExternal(); String getLocalLevel(); boolean useLogThreadLayout(); boolean getLocalTestMode(); void setLocalTestMode(boolean flag); int getZooKeeperSessionTimeout(); int getZookeeperOpsMaxAttempts(); int getZookeeperOpsRetryWaitMsecs(); boolean getNettyServerUseExecutionHandler(); int getNettyServerThreads(); int getNettyServerExecutionThreads(); int getNettyServerExecutionConcurrency(); ByteBufAllocator getNettyAllocator(); int getZookeeperConnectionAttempts(); int getZooKeeperMinSessionTimeout(); int getZooKeeperMaxSessionTimeout(); int getMapTasks(); boolean authenticate(); void setNumComputeThreads(int numComputeThreads); int getNumComputeThreads(); void setNumInputSplitsThreads(int numInputSplitsThreads); int getNumInputSplitsThreads(); long getInputSplitMaxVertices(); long getInputSplitMaxEdges(); void useUnsafeSerialization(boolean useUnsafeSerialization); void setCheckpointFrequency(int checkpointFrequency); int getCheckpointFrequency(); boolean useCheckpointing(); void setCheckpointSupportedChecker(
      Class<? extends CheckpointSupportedChecker> clazz); void setMaxTaskAttempts(int maxTaskAttempts); int getMaxTaskAttempts(); int getEventWaitMsecs(); void setEventWaitMsecs(int eventWaitMsecs); int getMaxMasterSuperstepWaitMsecs(); int getMaxCounterWaitMsecs(); void setMaxMasterSuperstepWaitMsecs(int maxMasterSuperstepWaitMsecs); void configureHadoopSecurity(); boolean useInputSplitLocality(); String getLocalHostname(); String getLocalHostOrIp(); void setMaxNumberOfSupersteps(int maxNumberOfSupersteps); int getMaxNumberOfSupersteps(); String getYourKitOutputDir(Mapper.Context context); String getStringVars(String key, Mapper.Context context); String getStringVars(String key, String defaultValue,
                              Mapper.Context context); boolean getCreateSourceVertex(); void setCreateSourceVertex(boolean createVertex); int getWaitTaskDoneTimeoutMs(); void setWaitTaskDoneTimeoutMs(int ms); boolean trackJobProgressOnClient(); int getHdfsFileCreationRetries(); int getHdfsFileCreationRetryWaitMs();  }
@Test public void testSetClasses() { GiraphConfiguration conf = new GiraphConfiguration(); conf.setClasses("foo", If.class, A.class, B.class); Class<?>[] klasses = conf.getClasses("foo"); assertEquals(2, klasses.length); assertEquals(A.class, klasses[0]); assertEquals(B.class, klasses[1]); try { conf.setClasses("foo", A.class, B.class); fail(); } catch (RuntimeException e) { assertEquals(2, conf.getClasses("foo").length); } Class<? extends If>[] klasses2 = getClassesOfType(conf, "foo", If.class); assertEquals(2, klasses2.length); assertEquals(A.class, klasses2[0]); assertEquals(B.class, klasses2[1]); }
@Test public void testAddToClasses() { GiraphConfiguration conf = new GiraphConfiguration(); conf.setClasses("foo", If.class, A.class, B.class); ClassConfOption.addToClasses(conf, "foo", C.class, If.class); Class<?>[] klasses = conf.getClasses("foo"); assertEquals(3, klasses.length); assertEquals(A.class, klasses[0]); assertEquals(B.class, klasses[1]); assertEquals(C.class, klasses[2]); ClassConfOption.addToClasses(conf, "bar", B.class, If.class); klasses = conf.getClasses("bar"); assertEquals(1, klasses.length); assertEquals(B.class, klasses[0]); }