当前位置: 首页>>代码示例>>Java>>正文


Java EntityNotFoundException.printStackTrace方法代码示例

本文整理汇总了Java中org.neo4j.kernel.api.exceptions.EntityNotFoundException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java EntityNotFoundException.printStackTrace方法的具体用法?Java EntityNotFoundException.printStackTrace怎么用?Java EntityNotFoundException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.neo4j.kernel.api.exceptions.EntityNotFoundException的用法示例。


在下文中一共展示了EntityNotFoundException.printStackTrace方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compute

import org.neo4j.kernel.api.exceptions.EntityNotFoundException; //导入方法依赖的package包/类
@Override
public void compute(int iterations) {

    final int[] src = new int[nodeCount];
    dst = new AtomicIntegerArray(nodeCount);

    try ( Transaction tx = db.beginTx()) {

        ThreadToStatementContextBridge ctx = this.db.getDependencyResolver().resolveDependency(ThreadToStatementContextBridge.class);
        final ReadOperations ops = ctx.get().readOperations();

        int[] degrees = computeDegrees(ops);

        final RelationshipVisitor<RuntimeException> visitor = new RelationshipVisitor<RuntimeException>() {
            public void visit(long relId, int relTypeId, long startNode, long endNode) throws RuntimeException {
                dst.addAndGet(((int) endNode), src[(int) startNode]);
            }
       };

        for (int iteration = 0; iteration < iterations; iteration++) {
            startIteration(src, dst, degrees);

            PrimitiveLongIterator rels = ops.relationshipsGetAll();
            runOperations(pool, rels, relCount , ops, new OpsRunner() {
                public void run(int id) throws EntityNotFoundException {
                    ops.relationshipVisit(id, visitor);
                }
            });
        }
        tx.success();
    } catch (EntityNotFoundException e) {
        e.printStackTrace();
    }
}
 
开发者ID:maxdemarzi,项目名称:pagerank_spi,代码行数:35,代码来源:PageRankArrayStorageParallelSPI.java

示例2: compute

import org.neo4j.kernel.api.exceptions.EntityNotFoundException; //导入方法依赖的package包/类
@Override
public void compute(String label, String type, int iterations) {

    int[] src = new int[nodeCount];
    dst = new AtomicIntegerArray(nodeCount);

    try ( Transaction tx = db.beginTx()) {

        ThreadToStatementContextBridge ctx = this.db.getDependencyResolver().resolveDependency(ThreadToStatementContextBridge.class);
        ReadOperations ops = ctx.get().readOperations();
        int labelId = ops.labelGetForName(label);
        int typeId = ops.relationshipTypeGetForName(type);

        int[] degrees = computeDegrees(ops,labelId, typeId);

        RelationshipVisitor<RuntimeException> visitor = new RelationshipVisitor<RuntimeException>() {
            public void visit(long relId, int relTypeId, long startNode, long endNode) throws RuntimeException {
                if (relTypeId == typeId) {
                    dst.addAndGet(((int) endNode),src[(int) startNode]);
                }
            }
        };

        for (int iteration = 0; iteration < iterations; iteration++) {
            startIteration(src, dst, degrees);

            PrimitiveLongIterator rels = ops.relationshipsGetAll();
            runOperations(pool, rels, relCount , ops, new OpsRunner() {
                public void run(int id) throws EntityNotFoundException {
                    ops.relationshipVisit(id, visitor);
                }
            });
        }
        tx.success();
    } catch (EntityNotFoundException e) {
        e.printStackTrace();
    }
}
 
开发者ID:maxdemarzi,项目名称:graph_processing,代码行数:39,代码来源:PageRankArrayStorageParallelSPI.java

示例3: compute

import org.neo4j.kernel.api.exceptions.EntityNotFoundException; //导入方法依赖的package包/类
@Override
public void compute(String label, String type, int iterations) {

    float[] src = new float[nodes];
    dst = new float[nodes];

    try ( Transaction tx = db.beginTx()) {

        ThreadToStatementContextBridge ctx = this.db.getDependencyResolver().resolveDependency(ThreadToStatementContextBridge.class);
        ReadOperations ops = ctx.get().readOperations();
        int labelId = ops.labelGetForName(label);
        int typeId = ops.relationshipTypeGetForName(type);

        int[] degrees = computeDegrees(ops,labelId, typeId);

        RelationshipVisitor<RuntimeException> visitor = new RelationshipVisitor<RuntimeException>() {
            public void visit(long relId, int relTypeId, long startNode, long endNode) throws RuntimeException {
                if (relTypeId == typeId) {
                    dst[((int) endNode)] += src[(int) startNode];
                }
            }
        };

        for (int iteration = 0; iteration < iterations; iteration++) {
            startIteration(src, dst, degrees);

            PrimitiveLongIterator rels = ops.relationshipsGetAll();
            while (rels.hasNext()) {
                ops.relationshipVisit(rels.next(), visitor);
            }
        }
        tx.success();
    } catch (EntityNotFoundException e) {
        e.printStackTrace();
    }
}
 
开发者ID:maxdemarzi,项目名称:graph_processing,代码行数:37,代码来源:PageRankArrayStorageSPI.java


注:本文中的org.neo4j.kernel.api.exceptions.EntityNotFoundException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。