Skip to content

Architecture of Graft

semihsalihoglu edited this page May 30, 2014 · 3 revisions

Under construction.

Context Reproduction

The context of Computation.compute() or MasterCompute.compute() functions are reproduced through a JUnit test case that Graft generates for a particular vertex or master in a particular superstep. Specifically, we use Mockito to mock the context that Graft has captured for the vertex or a master: GiraphConfiguration, the GraphState and the input arguments on which the compute() functions were run. Together, these objects form the context of the compute() function and allows the user to perform debugging with the same context the compute() was run on the cluster.

Furthermore, we also use Mockito's mock object (technically, a WorkerClientRequestProcessor mock object) to capture the actions of the compute() function on the underlying graph (e.g. send a message to other nodes). Thus, our test case also includes codes to verify the outputs of the compute() function. However, since we do not know the desirable outputs, the validation code is generated using the actual output of the compute() function and commented out. The user could uncomment these codes and provide their own desirable results for testing.

To perform code generation, Graft leverage Apache Velocity which uses template-based code generation model.

Required library to execute our test cases:

  • The user's code.
  • Giraph + Hadoop
  • JUnit 4
  • Mockito

Limitations: Since our code generation is executed at the server with minimal user input, we lack capability to fully understand the user's machine configuration and current testing environment which leads to a few limitations. First, the user needs to manually add the required libraries into their build path. Second, the package name of the java file Graft generates is empty and the user needs to add an appropriate package name manually. Note however, if you download the test case from the GUI (by clicking download) instead of copy and pasting, and then drag the downloaded java file to your IDE, IDEs will usually automatically fix the package name for you.

Clone this wiki locally