當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。