Interface DefaultAppBase<OID_T,​VID_T,​VDATA_T,​EDATA_T,​C extends DefaultContextBase<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:
    GiraphComputationAdaptor

    public interface DefaultAppBase<OID_T,​VID_T,​VDATA_T,​EDATA_T,​C extends DefaultContextBase<OID_T,​VID_T,​VDATA_T,​EDATA_T>>
    extends AppBase<OID_T,​VID_T,​VDATA_T,​EDATA_T,​C>
    The base interface for all sequential PIE apps which work along with IFragment and DefaultMessageManager

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

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

    For example, you can implement your app like this.

     {
             class MyContext implements DefaultContextBase<Long, Long, Long, Double> {
                     public void Init(IFragment<Long, Long, Long, Double> frag,
                                     DefaultMessageManager messageManager, StdVector<FFIByteString> args) {
    
                     }
    
                     public void Output(IFragment<Long, Long, Long, Double> frag) {
    
                     }
             }
             class MyApp implements DefaultAppBase<Long, Long, Long, Double, MyContext> {
                     public void PEval(IFragment<Long, Long, Long, Double> graph,
                                     DefaultContextBase context, DefaultMessageManager messageManager) {
    
                     }
    
                     public void IncEval(IFragment<Long, Long, Long, Double> graph,
                                     DefaultContextBase context, DefaultMessageManager messageManager) {
    
                     }
             }
     }
     

    For more examples, please refer to module com.alibaba.graphscope.grape-demo