Interface ParallelAppBase<OID_T,​VID_T,​VDATA_T,​EDATA_T,​C extends ParallelContextBase<OID_T,​VID_T,​VDATA_T,​EDATA_T>>

  • Type Parameters:
    OID_T - original id type
    VID_T - vertex id type
    VDATA_T - vertex data type
    EDATA_T - edge data type
    C - context type
    All Superinterfaces:
    AppBase<OID_T,​VID_T,​VDATA_T,​EDATA_T,​C>
    All Known Implementing Classes:
    BFS, GraphXParallelAdaptor, PageRank, SSSP, StringApp, Traverse, WCC

    public interface ParallelAppBase<OID_T,​VID_T,​VDATA_T,​EDATA_T,​C extends ParallelContextBase<OID_T,​VID_T,​VDATA_T,​EDATA_T>>
    extends AppBase<OID_T,​VID_T,​VDATA_T,​EDATA_T,​C>
    The base interface for all parallel PIE apps which work along with ImmutableEdgecutFragment and ParallelMessageManager

    To define your sequential graph algorithms, you should implement this interface and provide the corresponding implementation for PEval(IFragment, ParallelContextBase, ParallelMessageManager) and IncEval(IFragment, ParallelContextBase, ParallelMessageManager)

    User-defined app shall work along with user-defined context, which should be an implementation of ParallelContextBase.

    For example, you can implement your app like this.

    {
     class MyContext implements ParallelContextBase<Long, Long, Long, Double>{
          public void Init(ImmutableEdgecutFragment<Long, Long, Long, Double>
     frag, ParallelMessageManager messageManager, StdVector<FFIByteString> args) {
    
          }
    
          public void Output(ImmutableEdgecutFragment<Long, Long, Long, Double>
     frag) {
    
          }
      }
      class MyApp implements ParallelAppBase<Long,Long,Long,Double, MyContext>{
          public void PEval(ImmutableEdgecutFragment<Long, Long, Long, Double>
     graph, ParallelContextBase<Long,Long,Long,Double> context,
     ParallelMessageManager messageManager) {
    
          }
          public void IncEval(ImmutableEdgecutFragment<Long, Long, Long, Double>
     graph, ParallelContextBase<Long,Long,Long,Double> context,
     ParallelMessageManager messageManager) {
    
          }
      }
     }
    For more examples, please refer to module com.alibaba.graphscope.graphscope-demo