Interface DefaultContextBase<OID_T,​VID_T,​VDATA_T,​EDATA_T>

  • Type Parameters:
    OID_T - Original vertex id type
    VID_T - inner vertex id type
    VDATA_T - Vertex data type
    EDATA_T - edge data type
    All Superinterfaces:
    ContextBase
    All Known Implementing Classes:
    GiraphComputationAdaptorContext

    public interface DefaultContextBase<OID_T,​VID_T,​VDATA_T,​EDATA_T>
    extends ContextBase
    DefaultContextBase is the base class for user-defined contexts for sequential apps. A context manages data through the whole computation. The data won't be cleared during supersteps.

    Apart from data structures provided by java.lang, you can also use java wrappers for grape data structures provided com.alibaba.graphscope.ds and com.alibaba.graphscope.stdcxx.

    • Method Detail

      • Init

        void Init​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag,
                  DefaultMessageManager messageManager,
                  com.alibaba.fastjson.JSONObject jsonObject)
        Called by grape framework, before any PEval. You can initiating data structures need during super steps here.
        Parameters:
        frag - The graph fragment providing accesses to graph data.
        messageManager - The message manger which manages messages between fragments.
        jsonObject - String args from cmdline.
        See Also:
        IFragment, DefaultMessageManager, JSONObject
      • Output

        void Output​(IFragment<OID_T,​VID_T,​VDATA_T,​EDATA_T> frag)
        Output will be executed when the computations finalizes. Data maintained in this context shall be outputted here.
        Parameters:
        frag - The graph fragment contains the graph info.
        See Also:
        IFragment