This topic describes the classes of MaxCompute Graph SDK for Java and how to configure the SDK.

If you use Maven, you can search for odps-sdk-graph in the Maven repository to find the latest version of the SDK for Java. You can declare the SDK in your project by using the following Maven dependency:
Class Description
GraphJob Defines, submits, and manages a MaxCompute Graph job. The class inherits JobConf.
Vertex Defines a vertex in a graph. A vertex has the following properties: id, value, halted, and edges. You can specify this class by using the setVertexClass method of GraphJob.
Edge Defines an edge in a graph. An edge has the following properties: destVertexId and value. MaxCompute Graph uses the adjacency list as the data structure. The outbound edges of a vertex are specified by the edges property of the vertex.
GraphLoader Loads a graph. You can specify this class by using the setGraphLoaderClass method of GraphJob.
VertexResolver Defines the custom logic for handling conflicts during graph topology modification. You can specify this class by using the setLoadingVertexResolverClass and setComputingVertexResolverClass methods of GraphJob. The setLoadingVertexResolverClass method specifies the class that is used during graph loading, whereas the setComputingVertexResolverClass method specifies the class that is used during iterative computing.
Partitioner Specifies how to distribute vertices to workers. This way, computing can be performed by multiple workers at the same time. You can specify this class by using the setPartitionerClass method of GraphJob. By default, the HashPartitioner class is used. HashPartitioner computes the hash value of a vertex ID and divides the hash value by the number of workers to obtain the remainder of the hash value. This remainder specifies the worker to which the vertex is distributed.
WorkerComputer Defines the custom operations to perform when a worker starts and stops. You can specify this class by using the setWorkerComputerClass method of GraphJob.
Aggregator Processes and summarizes global information. You can specify multiple Aggregator classes by using the setAggregatorClass(Class…) method of GraphJob.
Combiner Summarizes the output records with the same key. You can specify this class by using the setCombinerClass method of GraphJob.
Counters Defines a counter that is used for counting workers. In the operating logic of a job, you can use the WorkerContext class to obtain the counter and count workers. The framework then automatically calculates the sum of the workers.
WorkerContext Defines the context that encapsulates the features provided by the framework, such as the features that allow workers to modify the graph topology, send messages, write results, and read resources.