本文整理汇总了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();
}
}
示例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();
}
}
示例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();
}
}