本文整理匯總了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();
}
}