GAS API implementation and usage

橙三吉。 提交于 2019-12-06 10:16:44
Brad Bebee

Take a look at the TestBFS class in the bigdata-gas package:

final IGASEngine gasEngine = getGraphFixture()
        .newGASEngine(1/* nthreads */);

try {

    final SailConnection cxn = getGraphFixture().getSail()
            .getConnection();

    try {

        final IGraphAccessor graphAccessor = getGraphFixture()
                .newGraphAccessor(cxn);

        final IGASContext<BFS.VS, BFS.ES, Void> gasContext = gasEngine
                .newGASContext(graphAccessor, new BFS());

        final IGASState<BFS.VS, BFS.ES, Void> gasState = gasContext
                .getGASState();

        // Initialize the froniter.
        gasState.setFrontier(gasContext, p.getMike());

        // Converge.
        gasContext.call();

[snip]

To use it outside of the test case context, you need to create a SailConnection of some sort. See the blazegraph-samples GitHub project for examples. Then you need to create a SAILGASEngine. This should get you started in terms of calling the GASEngine directly at the Java layer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!