This project has retired. For details please refer to its Attic page.
GiraphClasses xref
View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.giraph.conf;
19  
20  import org.apache.giraph.aggregators.AggregatorWriter;
21  import org.apache.giraph.aggregators.TextAggregatorWriter;
22  import org.apache.giraph.comm.messages.MessageEncodeAndStoreType;
23  import org.apache.giraph.edge.ByteArrayEdges;
24  import org.apache.giraph.edge.OutEdges;
25  import org.apache.giraph.factories.ComputationFactory;
26  import org.apache.giraph.factories.DefaultComputationFactory;
27  import org.apache.giraph.factories.DefaultMessageValueFactory;
28  import org.apache.giraph.graph.Computation;
29  import org.apache.giraph.graph.DefaultVertexResolver;
30  import org.apache.giraph.graph.DefaultVertexValueCombiner;
31  import org.apache.giraph.graph.Vertex;
32  import org.apache.giraph.graph.VertexResolver;
33  import org.apache.giraph.graph.VertexValueCombiner;
34  import org.apache.giraph.io.EdgeInputFormat;
35  import org.apache.giraph.io.EdgeOutputFormat;
36  import org.apache.giraph.io.MappingInputFormat;
37  import org.apache.giraph.io.VertexInputFormat;
38  import org.apache.giraph.io.VertexOutputFormat;
39  import org.apache.giraph.io.filters.DefaultEdgeInputFilter;
40  import org.apache.giraph.io.filters.DefaultVertexInputFilter;
41  import org.apache.giraph.io.filters.EdgeInputFilter;
42  import org.apache.giraph.io.filters.VertexInputFilter;
43  import org.apache.giraph.master.DefaultMasterCompute;
44  import org.apache.giraph.master.MasterCompute;
45  import org.apache.giraph.partition.GraphPartitionerFactory;
46  import org.apache.giraph.partition.HashPartitionerFactory;
47  import org.apache.giraph.partition.Partition;
48  import org.apache.giraph.partition.SimplePartition;
49  import org.apache.giraph.types.NoMessage;
50  import org.apache.giraph.worker.DefaultWorkerContext;
51  import org.apache.giraph.worker.WorkerContext;
52  import org.apache.hadoop.conf.Configuration;
53  import org.apache.hadoop.io.Writable;
54  import org.apache.hadoop.io.WritableComparable;
55  
56  /**
57   * Holder for classes used by Giraph.
58   *
59   * @param <I> Vertex ID class
60   * @param <V> Vertex Value class
61   * @param <E> Edge class
62   */
63  @SuppressWarnings("unchecked")
64  public class GiraphClasses<I extends WritableComparable,
65      V extends Writable, E extends Writable>
66      implements GiraphConstants {
67    /** ComputationFactory class - cached for fast access */
68    protected Class<? extends ComputationFactory<I, V, E,
69        ? extends Writable, ? extends Writable>>
70    computationFactoryClass;
71    /** Computation class - cached for fast access */
72    protected Class<? extends Computation<I, V, E,
73        ? extends Writable, ? extends Writable>>
74    computationClass;
75    /** Generic types used to describe graph */
76    protected GiraphTypes<I, V, E> giraphTypes;
77    /** Vertex edges class - cached for fast access */
78    protected Class<? extends OutEdges<I, E>> outEdgesClass;
79    /** Input vertex edges class - cached for fast access */
80    protected Class<? extends OutEdges<I, E>> inputOutEdgesClass;
81  
82    /** Graph partitioner factory class - cached for fast access */
83    protected Class<? extends GraphPartitionerFactory<I, V, E>>
84    graphPartitionerFactoryClass;
85  
86    /** Vertex input format class - cached for fast access */
87    protected Class<? extends VertexInputFormat<I, V, E>>
88    vertexInputFormatClass;
89    /** Vertex output format class - cached for fast access */
90    protected Class<? extends VertexOutputFormat<I, V, E>>
91    vertexOutputFormatClass;
92    /** Mapping input format - cached for fast access */
93    protected Class<? extends MappingInputFormat<I, V, E, ? extends Writable>>
94    mappingInputFormatClass;
95    /** Edge input format class - cached for fast access */
96    protected Class<? extends EdgeInputFormat<I, E>>
97    edgeInputFormatClass;
98    /** Edge output format class - cached for fast access */
99    protected Class<? extends EdgeOutputFormat<I, V, E>>
100   edgeOutputFormatClass;
101 
102   /** Aggregator writer class - cached for fast access */
103   protected Class<? extends AggregatorWriter> aggregatorWriterClass;
104 
105   /** Incoming message classes */
106   protected MessageClasses<I, ? extends Writable> incomingMessageClasses;
107   /** Outgoing message classes */
108   protected MessageClasses<I, ? extends Writable> outgoingMessageClasses;
109 
110   /** Vertex resolver class - cached for fast access */
111   protected Class<? extends VertexResolver<I, V, E>> vertexResolverClass;
112   /** Vertex value combiner class - cached for fast access */
113   protected Class<? extends VertexValueCombiner<V>> vertexValueCombinerClass;
114   /** Worker context class - cached for fast access */
115   protected Class<? extends WorkerContext> workerContextClass;
116   /** Master compute class - cached for fast access */
117   protected Class<? extends MasterCompute> masterComputeClass;
118 
119   /** Partition class - cached for fast accesss */
120   protected Class<? extends Partition<I, V, E>> partitionClass;
121 
122   /** Edge Input Filter class */
123   protected Class<? extends EdgeInputFilter<I, E>> edgeInputFilterClass;
124   /** Vertex Input Filter class */
125   protected Class<? extends VertexInputFilter<I, V, E>> vertexInputFilterClass;
126 
127   /**
128    * Empty constructor. Initialize with default classes or null.
129    */
130   public GiraphClasses() {
131     computationFactoryClass = (Class) DefaultComputationFactory.class;
132     giraphTypes = new GiraphTypes<I, V, E>();
133     outEdgesClass = (Class) ByteArrayEdges.class;
134     inputOutEdgesClass = (Class) ByteArrayEdges.class;
135     graphPartitionerFactoryClass = (Class) HashPartitionerFactory.class;
136     aggregatorWriterClass = TextAggregatorWriter.class;
137     vertexResolverClass = (Class) DefaultVertexResolver.class;
138     vertexValueCombinerClass = (Class) DefaultVertexValueCombiner.class;
139     workerContextClass = DefaultWorkerContext.class;
140     masterComputeClass = DefaultMasterCompute.class;
141     partitionClass = (Class) SimplePartition.class;
142     edgeInputFilterClass = (Class) DefaultEdgeInputFilter.class;
143     vertexInputFilterClass = (Class) DefaultVertexInputFilter.class;
144   }
145 
146   /**
147    * Constructor that reads classes from a Configuration object.
148    *
149    * @param conf Configuration object to read from.
150    */
151   public GiraphClasses(Configuration conf) {
152     giraphTypes = GiraphTypes.readFrom(conf);
153     computationFactoryClass =
154         (Class<? extends ComputationFactory<I, V, E,
155             ? extends Writable, ? extends Writable>>)
156             COMPUTATION_FACTORY_CLASS.get(conf);
157     computationClass =
158         (Class<? extends Computation<I, V, E,
159             ? extends Writable, ? extends Writable>>)
160             COMPUTATION_CLASS.get(conf);
161 
162     outEdgesClass = (Class<? extends OutEdges<I, E>>)
163         VERTEX_EDGES_CLASS.get(conf);
164     inputOutEdgesClass = (Class<? extends OutEdges<I, E>>)
165         INPUT_VERTEX_EDGES_CLASS.getWithDefault(conf, outEdgesClass);
166 
167     graphPartitionerFactoryClass =
168         (Class<? extends GraphPartitionerFactory<I, V, E>>)
169             GRAPH_PARTITIONER_FACTORY_CLASS.get(conf);
170 
171     vertexInputFormatClass = (Class<? extends VertexInputFormat<I, V, E>>)
172         VERTEX_INPUT_FORMAT_CLASS.get(conf);
173     vertexOutputFormatClass = (Class<? extends VertexOutputFormat<I, V, E>>)
174         VERTEX_OUTPUT_FORMAT_CLASS.get(conf);
175     edgeInputFormatClass = (Class<? extends EdgeInputFormat<I, E>>)
176         EDGE_INPUT_FORMAT_CLASS.get(conf);
177     edgeOutputFormatClass = (Class<? extends EdgeOutputFormat<I, V, E>>)
178         EDGE_OUTPUT_FORMAT_CLASS.get(conf);
179     mappingInputFormatClass = (Class<? extends MappingInputFormat<I, V, E,
180         ? extends Writable>>)
181         MAPPING_INPUT_FORMAT_CLASS.get(conf);
182 
183     aggregatorWriterClass = AGGREGATOR_WRITER_CLASS.get(conf);
184 
185     // incoming messages shouldn't be used in first iteration at all
186     // but empty message stores are created, etc, so using NoMessage
187     // to enforce not a single message is read/written
188     incomingMessageClasses = new DefaultMessageClasses(
189         NoMessage.class,
190         DefaultMessageValueFactory.class,
191         null,
192         MessageEncodeAndStoreType.BYTEARRAY_PER_PARTITION);
193     outgoingMessageClasses = new DefaultMessageClasses(
194         giraphTypes.getInitialOutgoingMessageValueClass(),
195         OUTGOING_MESSAGE_VALUE_FACTORY_CLASS.get(conf),
196         MESSAGE_COMBINER_CLASS.get(conf),
197         MESSAGE_ENCODE_AND_STORE_TYPE.get(conf));
198 
199     vertexResolverClass = (Class<? extends VertexResolver<I, V, E>>)
200         VERTEX_RESOLVER_CLASS.get(conf);
201     vertexValueCombinerClass = (Class<? extends VertexValueCombiner<V>>)
202         VERTEX_VALUE_COMBINER_CLASS.get(conf);
203     workerContextClass = WORKER_CONTEXT_CLASS.get(conf);
204     masterComputeClass =  MASTER_COMPUTE_CLASS.get(conf);
205     partitionClass = (Class<? extends Partition<I, V, E>>)
206         PARTITION_CLASS.get(conf);
207 
208     edgeInputFilterClass = (Class<? extends EdgeInputFilter<I, E>>)
209         EDGE_INPUT_FILTER_CLASS.get(conf);
210     vertexInputFilterClass = (Class<? extends VertexInputFilter<I, V, E>>)
211         VERTEX_INPUT_FILTER_CLASS.get(conf);
212   }
213 
214   public Class<? extends ComputationFactory<I, V, E,
215       ? extends Writable, ? extends Writable>> getComputationFactoryClass() {
216     return computationFactoryClass;
217   }
218 
219   /**
220    * Get Computation class
221    *
222    * @return Computation class.
223    */
224   public Class<? extends Computation<I, V, E,
225       ? extends Writable, ? extends Writable>>
226   getComputationClass() {
227     return computationClass;
228   }
229 
230   public GiraphTypes<I, V, E> getGiraphTypes() {
231     return giraphTypes;
232   }
233 
234   /**
235    * Get Vertex ID class
236    *
237    * @return Vertex ID class
238    */
239   public Class<I> getVertexIdClass() {
240     return giraphTypes.getVertexIdClass();
241   }
242 
243 
244   /**
245    * Get Vertex implementation class
246    *
247    * @return Vertex implementation class
248    */
249   public Class<? extends Vertex> getVertexClass() {
250     return giraphTypes.getVertexClass();
251   }
252 
253 
254   /**
255    * Get Vertex Value class
256    *
257    * @return Vertex Value class
258    */
259   public Class<V> getVertexValueClass() {
260     return giraphTypes.getVertexValueClass();
261   }
262 
263   /**
264    * Get Edge Value class
265    *
266    * @return Edge Value class
267    */
268   public Class<E> getEdgeValueClass() {
269     return giraphTypes.getEdgeValueClass();
270   }
271 
272 
273   public MessageClasses<? extends WritableComparable, ? extends Writable>
274   getIncomingMessageClasses() {
275     return incomingMessageClasses;
276   }
277 
278   public MessageClasses<? extends WritableComparable, ? extends Writable>
279   getOutgoingMessageClasses() {
280     return outgoingMessageClasses;
281   }
282 
283   /**
284    * Get Vertex edges class
285    *
286    * @return Vertex edges class.
287    */
288   public Class<? extends OutEdges<I, E>> getOutEdgesClass() {
289     return outEdgesClass;
290   }
291 
292   /**
293    * Get Vertex edges class used during edge-based input
294    *
295    * @return Vertex edges class.
296    */
297   public Class<? extends OutEdges<I, E>> getInputOutEdgesClass() {
298     return inputOutEdgesClass;
299   }
300 
301   /**
302    * Get the GraphPartitionerFactory
303    *
304    * @return GraphPartitionerFactory
305    */
306   public Class<? extends GraphPartitionerFactory<I, V, E>>
307   getGraphPartitionerFactoryClass() {
308     return graphPartitionerFactoryClass;
309   }
310 
311   public Class<? extends EdgeInputFilter<I, E>>
312   getEdgeInputFilterClass() {
313     return edgeInputFilterClass;
314   }
315 
316   public Class<? extends VertexInputFilter<I, V, E>>
317   getVertexInputFilterClass() {
318     return vertexInputFilterClass;
319   }
320 
321   /**
322    * Check if VertexInputFormat class is set
323    *
324    * @return true if VertexInputFormat class is set
325    */
326   public boolean hasVertexInputFormat() {
327     return vertexInputFormatClass != null;
328   }
329 
330   /**
331    * Get VertexInputFormat held
332    *
333    * @return VertexInputFormat
334    */
335   public Class<? extends VertexInputFormat<I, V, E>>
336   getVertexInputFormatClass() {
337     return vertexInputFormatClass;
338   }
339 
340   /**
341    * Check if VertexOutputFormat is set
342    *
343    * @return true if VertexOutputFormat is set
344    */
345   public boolean hasVertexOutputFormat() {
346     return vertexOutputFormatClass != null;
347   }
348 
349   /**
350    * Check if MappingInputFormat is set
351    *
352    * @return true if MappingInputFormat is set
353    */
354   public boolean hasMappingInputFormat() {
355     return mappingInputFormatClass != null;
356   }
357 
358   /**
359    * Get VertexOutputFormat set
360    *
361    * @return VertexOutputFormat
362    */
363   public Class<? extends VertexOutputFormat<I, V, E>>
364   getVertexOutputFormatClass() {
365     return vertexOutputFormatClass;
366   }
367 
368   public Class<? extends MappingInputFormat<I, V, E, ? extends Writable>>
369   getMappingInputFormatClass() {
370     return mappingInputFormatClass;
371   }
372 
373   /**
374    * Check if EdgeInputFormat is set
375    *
376    * @return true if EdgeInputFormat is set
377    */
378   public boolean hasEdgeInputFormat() {
379     return edgeInputFormatClass != null;
380   }
381 
382   /**
383    * Get EdgeInputFormat used
384    *
385    * @return EdgeInputFormat
386    */
387   public Class<? extends EdgeInputFormat<I, E>> getEdgeInputFormatClass() {
388     return edgeInputFormatClass;
389   }
390 
391   /**
392    * Check if EdgeOutputFormat is set
393    *
394    * @return true if EdgeOutputFormat is set
395    */
396   public boolean hasEdgeOutputFormat() {
397     return edgeOutputFormatClass != null;
398   }
399 
400   /**
401    * Get VertexOutputFormat set
402    *
403    * @return VertexOutputFormat
404    */
405   public Class<? extends EdgeOutputFormat<I, V, E>>
406   getEdgeOutputFormatClass() {
407     return edgeOutputFormatClass;
408   }
409 
410   /**
411    * Check if AggregatorWriter is set
412    *
413    * @return true if AggregatorWriter is set
414    */
415   public boolean hasAggregatorWriterClass() {
416     return aggregatorWriterClass != null;
417   }
418 
419   /**
420    * Get AggregatorWriter used
421    *
422    * @return AggregatorWriter
423    */
424   public Class<? extends AggregatorWriter> getAggregatorWriterClass() {
425     return aggregatorWriterClass;
426   }
427 
428   /**
429    * Check if VertexResolver is set
430    *
431    * @return true if VertexResolver is set
432    */
433   public boolean hasVertexResolverClass() {
434     return vertexResolverClass != null;
435   }
436 
437   /**
438    * Get VertexResolver used
439    *
440    * @return VertexResolver
441    */
442   public Class<? extends VertexResolver<I, V, E>> getVertexResolverClass() {
443     return vertexResolverClass;
444   }
445 
446   /**
447    * Get VertexValueCombiner used
448    *
449    * @return VertexValueCombiner
450    */
451   public Class<? extends VertexValueCombiner<V>> getVertexValueCombinerClass() {
452     return vertexValueCombinerClass;
453   }
454 
455   /**
456    * Check if WorkerContext is set
457    *
458    * @return true if WorkerContext is set
459    */
460   public boolean hasWorkerContextClass() {
461     return workerContextClass != null;
462   }
463 
464   /**
465    * Get WorkerContext used
466    *
467    * @return WorkerContext
468    */
469   public Class<? extends WorkerContext> getWorkerContextClass() {
470     return workerContextClass;
471   }
472 
473   /**
474    * Check if MasterCompute is set
475    *
476    * @return true MasterCompute is set
477    */
478   public boolean hasMasterComputeClass() {
479     return masterComputeClass != null;
480   }
481 
482   /**
483    * Get MasterCompute used
484    *
485    * @return MasterCompute
486    */
487   public Class<? extends MasterCompute> getMasterComputeClass() {
488     return masterComputeClass;
489   }
490 
491   /**
492    * Check if Partition is set
493    *
494    * @return true if Partition is set
495    */
496   public boolean hasPartitionClass() {
497     return partitionClass != null;
498   }
499 
500   /**
501    * Get Partition
502    *
503    * @return Partition
504    */
505   public Class<? extends Partition<I, V, E>> getPartitionClass() {
506     return partitionClass;
507   }
508 
509   /**
510    * Set Computation class held, and update message types
511    *
512    * @param computationClass Computation class to set
513    * @return this
514    */
515   public GiraphClasses setComputationClass(Class<? extends
516       Computation<I, V, E, ? extends Writable, ? extends Writable>>
517       computationClass) {
518     this.computationClass = computationClass;
519     return this;
520   }
521 
522   /**
523    * Set Vertex ID class held
524    *
525    * @param vertexIdClass Vertex ID to set
526    * @return this
527    */
528   public GiraphClasses setVertexIdClass(Class<I> vertexIdClass) {
529     giraphTypes.setVertexIdClass(vertexIdClass);
530     return this;
531   }
532 
533   /**
534    * Set Vertex Value class held
535    *
536    * @param vertexValueClass Vertex Value class to set
537    * @return this
538    */
539   public GiraphClasses setVertexValueClass(Class<V> vertexValueClass) {
540     giraphTypes.setVertexValueClass(vertexValueClass);
541     return this;
542   }
543 
544   /**
545    * Set Edge Value class held
546    *
547    * @param edgeValueClass Edge Value class to set
548    * @return this
549    */
550   public GiraphClasses setEdgeValueClass(Class<E> edgeValueClass) {
551     giraphTypes.setEdgeValueClass(edgeValueClass);
552     return this;
553   }
554 
555   /**
556    * Set incoming Message Value class held - messages which have been sent in
557    * the previous superstep and are processed in the current one
558    *
559    * @param incomingMessageClasses Message classes value to set
560    * @return this
561    */
562   public GiraphClasses setIncomingMessageClasses(
563       MessageClasses<I, ? extends Writable> incomingMessageClasses) {
564     this.incomingMessageClasses = incomingMessageClasses;
565     return this;
566   }
567 
568   /**
569    * Set outgoing Message Value class held - messages which are going to be sent
570    * during current superstep
571    *
572    * @param outgoingMessageClasses Message classes value to set
573    * @return this
574    */
575   public GiraphClasses setOutgoingMessageClasses(
576       MessageClasses<I, ? extends Writable> outgoingMessageClasses) {
577     this.outgoingMessageClasses = outgoingMessageClasses;
578     return this;
579   }
580 
581   /**
582    * Set OutEdges class held
583    *
584    * @param outEdgesClass Vertex edges class to set
585    * @return this
586    */
587   public GiraphClasses setOutEdgesClass(
588       Class<? extends OutEdges> outEdgesClass) {
589     this.outEdgesClass =
590         (Class<? extends OutEdges<I, E>>) outEdgesClass;
591     return this;
592   }
593 
594   /**
595    * Set OutEdges class used during edge-input (if different from the one
596    * used for computation)
597    *
598    * @param inputOutEdgesClass Input vertex edges class to set
599    * @return this
600    */
601   public GiraphClasses setInputOutEdgesClass(
602       Class<? extends OutEdges> inputOutEdgesClass) {
603     this.inputOutEdgesClass =
604         (Class<? extends OutEdges<I, E>>) inputOutEdgesClass;
605     return this;
606   }
607 
608   /**
609    * Set GraphPartitionerFactory class held
610    *
611    * @param klass GraphPartitionerFactory to set
612    * @return this
613    */
614   public GiraphClasses setGraphPartitionerFactoryClass(
615       Class<? extends GraphPartitionerFactory<I, V, E>> klass) {
616     this.graphPartitionerFactoryClass = klass;
617     return this;
618   }
619 
620   /**
621    * Set MappingInputFormat held
622    *
623    * @param mappingInputFormatClass MappingInputFormat to set
624    * @return this
625    */
626   public GiraphClasses setMappingInputFormatClass(
627     Class<? extends MappingInputFormat<I, V, E, Writable>>
628       mappingInputFormatClass) {
629     this.mappingInputFormatClass = mappingInputFormatClass;
630     return this;
631   }
632 
633   /**
634    * Set VertexInputFormat held
635    *
636    * @param vertexInputFormatClass VertexInputFormat to set
637    * @return this
638    */
639   public GiraphClasses setVertexInputFormatClass(
640       Class<? extends VertexInputFormat<I, V, E>> vertexInputFormatClass) {
641     this.vertexInputFormatClass = vertexInputFormatClass;
642     return this;
643   }
644 
645   /**
646    * Set VertexOutputFormat held
647    *
648    * @param vertexOutputFormatClass VertexOutputFormat to set
649    * @return this
650    */
651   public GiraphClasses setVertexOutputFormatClass(
652       Class<? extends VertexOutputFormat<I, V, E>> vertexOutputFormatClass) {
653     this.vertexOutputFormatClass = vertexOutputFormatClass;
654     return this;
655   }
656 
657   /**
658    * Set EdgeInputFormat class held
659    *
660    * @param edgeInputFormatClass EdgeInputFormat to set
661    * @return this
662    */
663   public GiraphClasses setEdgeInputFormatClass(
664       Class<? extends EdgeInputFormat<I, E>> edgeInputFormatClass) {
665     this.edgeInputFormatClass = edgeInputFormatClass;
666     return this;
667   }
668 
669   /**
670    * Set AggregatorWriter class used
671    *
672    * @param aggregatorWriterClass AggregatorWriter to set
673    * @return this
674    */
675   public GiraphClasses setAggregatorWriterClass(
676       Class<? extends AggregatorWriter> aggregatorWriterClass) {
677     this.aggregatorWriterClass = aggregatorWriterClass;
678     return this;
679   }
680 
681   /**
682    * Set VertexResolver used
683    *
684    * @param vertexResolverClass VertexResolver to set
685    * @return this
686    */
687   public GiraphClasses setVertexResolverClass(
688       Class<? extends VertexResolver<I, V, E>> vertexResolverClass) {
689     this.vertexResolverClass = vertexResolverClass;
690     return this;
691   }
692 
693   /**
694    * Set WorkerContext used
695    *
696    * @param workerContextClass WorkerContext class to set
697    * @return this
698    */
699   public GiraphClasses setWorkerContextClass(
700       Class<? extends WorkerContext> workerContextClass) {
701     this.workerContextClass = workerContextClass;
702     return this;
703   }
704 
705   /**
706    * Set MasterCompute class used
707    *
708    * @param masterComputeClass MasterCompute class to set
709    * @return this
710    */
711   public GiraphClasses setMasterComputeClass(
712       Class<? extends MasterCompute> masterComputeClass) {
713     this.masterComputeClass = masterComputeClass;
714     return this;
715   }
716 
717   /**
718    * Set Partition class to use
719    *
720    * @param partitionClass Partition class to set
721    * @return this
722    */
723   public GiraphClasses setPartitionClass(
724       Class<? extends Partition<I, V, E>> partitionClass) {
725     this.partitionClass = partitionClass;
726     return this;
727   }
728 }