org.neo4j.kernel.api.query.QuerySnapshot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neo4j-kernel Show documentation
Show all versions of neo4j-kernel Show documentation
Neo4j kernel is a lightweight, embedded Java database designed to
store data structured as graphs rather than tables. For more
information, see http://neo4j.org.
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package org.neo4j.kernel.api.query;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.OptionalLong;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.neo4j.graphdb.ExecutionPlanDescription;
import org.neo4j.graphdb.InputPosition;
import org.neo4j.internal.kernel.api.connectioninfo.ClientConnectionInfo;
import org.neo4j.kernel.database.NamedDatabaseId;
import org.neo4j.lock.ActiveLock;
import org.neo4j.values.virtual.MapValue;
public class QuerySnapshot
{
private final ExecutingQuery query;
private final CompilerInfo compilerInfo;
private final long compilationTimeMicros;
private final long elapsedTimeMicros;
private final long cpuTimeMicros;
private final long waitTimeMicros;
private final String status;
private final Map resourceInfo;
private final List waitingLocks;
private final long activeLockCount;
private final long allocatedBytes;
private final long pageHits;
private final long pageFaults;
private final Optional obfuscatedQueryText;
private final Optional> obfuscatedPosition;
private final Optional obfuscatedQueryParameters;
private final long transactionId;
QuerySnapshot( ExecutingQuery query, CompilerInfo compilerInfo, long pageHits, long pageFaults, long compilationTimeMicros,
long elapsedTimeMicros, long cpuTimeMicros, long waitTimeMicros, String status,
Map resourceInfo, List waitingLocks, long activeLockCount, long allocatedBytes,
Optional obfuscatedQueryText, Optional> obfuscatedPosition,
Optional obfuscatedQueryParameters, long transactionId )
{
this.query = query;
this.compilerInfo = compilerInfo;
this.pageHits = pageHits;
this.pageFaults = pageFaults;
this.compilationTimeMicros = compilationTimeMicros;
this.elapsedTimeMicros = elapsedTimeMicros;
this.cpuTimeMicros = cpuTimeMicros;
this.waitTimeMicros = waitTimeMicros;
this.status = status;
this.resourceInfo = resourceInfo;
this.waitingLocks = waitingLocks;
this.activeLockCount = activeLockCount;
this.allocatedBytes = allocatedBytes;
this.obfuscatedQueryText = obfuscatedQueryText;
this.obfuscatedPosition = obfuscatedPosition;
this.obfuscatedQueryParameters = obfuscatedQueryParameters;
this.transactionId = transactionId;
}
public long internalQueryId()
{
return query.internalQueryId();
}
public String id()
{
return query.id();
}
public String rawQueryText()
{
return query.rawQueryText();
}
public Optional obfuscatedQueryText()
{
return obfuscatedQueryText;
}
public Optional> obfuscatedPosition()
{
return obfuscatedPosition;
};
public MapValue rawQueryParameters()
{
return query.rawQueryParameters();
}
public Optional obfuscatedQueryParameters()
{
return obfuscatedQueryParameters;
}
public Supplier queryPlanSupplier()
{
return query.planDescriptionSupplier();
}
public DeprecationNotificationsProvider deprecationNotificationsProvider()
{
return query.getDeprecationNotificationsProvider();
}
public DeprecationNotificationsProvider fabricDeprecationNotificationsProvider()
{
return query.getFabricDeprecationNotificationsProvider();
}
public String executingUsername()
{
return query.executingUsername();
}
public String authenticatedUsername()
{
return query.authenticatedUsername();
}
public Optional databaseId()
{
return query.databaseId();
}
public ClientConnectionInfo clientConnection()
{
return query.clientConnection();
}
public Map transactionAnnotationData()
{
return query.transactionAnnotationData();
}
public long activeLockCount()
{
return activeLockCount;
}
public String planner()
{
return compilerInfo == null ? null : compilerInfo.planner();
}
public String runtime()
{
return compilerInfo == null ? null : compilerInfo.runtime();
}
public List