use of org.neo4j.kernel.api.query.QuerySnapshot in project neo4j by neo4j.
the class QueryCollector method endSuccess.
@Override
public void endSuccess(ExecutingQuery query) {
if (isCollecting) {
QuerySnapshot snapshot = query.snapshot();
var databaseId = query.databaseId().orElse(null);
var queryText = snapshot.obfuscatedQueryText().orElse(null);
var parameters = snapshot.obfuscatedQueryParameters().orElse(null);
if (databaseId != null && queryText != null && parameters != null) {
recentQueryBuffer.produce(new TruncatedQuerySnapshot(databaseId, queryText, snapshot.queryPlanSupplier(), parameters, snapshot.elapsedTimeMicros(), snapshot.compilationTimeMicros(), snapshot.startTimestampMillis(), maxQueryTextSize));
}
}
}
use of org.neo4j.kernel.api.query.QuerySnapshot in project neo4j by neo4j.
the class TransactionDependenciesResolver method initDirectDependencies.
private Map<KernelTransactionHandle, Set<KernelTransactionHandle>> initDirectDependencies() {
Map<KernelTransactionHandle, Set<KernelTransactionHandle>> directDependencies = new HashMap<>();
Map<KernelTransactionHandle, List<ActiveLock>> transactionLocksMap = handleSnapshotsMap.keySet().stream().collect(toMap(identity(), getTransactionLocks()));
for (Map.Entry<KernelTransactionHandle, Optional<QuerySnapshot>> entry : handleSnapshotsMap.entrySet()) {
Optional<QuerySnapshot> snapshot = entry.getValue();
if (snapshot.isPresent()) {
KernelTransactionHandle txHandle = entry.getKey();
evaluateDirectDependencies(directDependencies, transactionLocksMap, txHandle, snapshot.get());
}
}
return directDependencies;
}
Aggregations