net.ravendb.client.documents.queries.facets.AggregationQueryBase Maven / Gradle / Ivy
package net.ravendb.client.documents.queries.facets;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.Stopwatch;
import net.ravendb.client.documents.Lazy;
import net.ravendb.client.documents.commands.QueryCommand;
import net.ravendb.client.documents.queries.IndexQuery;
import net.ravendb.client.documents.queries.QueryResult;
import net.ravendb.client.documents.session.DocumentSession;
import net.ravendb.client.documents.session.InMemoryDocumentSessionOperations;
import net.ravendb.client.documents.session.operations.QueryOperation;
import net.ravendb.client.documents.session.operations.lazy.LazyAggregationQueryOperation;
import net.ravendb.client.extensions.JsonExtensions;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
public abstract class AggregationQueryBase {
private final InMemoryDocumentSessionOperations _session;
private IndexQuery _query;
private Stopwatch _duration;
protected AggregationQueryBase(InMemoryDocumentSessionOperations session) {
_session = session;
}
public Map execute() {
QueryCommand command = getCommand();
_duration = Stopwatch.createStarted();
_session.incrementRequestCount();
_session.getRequestExecutor().execute(command);
return processResults(command.getResult());
}
public Lazy
© 2015 - 2024 Weber Informatics LLC | Privacy Policy