Package io.trino.plugin.prometheus
Class PrometheusSplitManager
java.lang.Object
io.trino.plugin.prometheus.PrometheusSplitManager
- All Implemented Interfaces:
ConnectorSplitManager
-
Constructor Summary
ConstructorsConstructorDescriptionPrometheusSplitManager(PrometheusClient prometheusClient, PrometheusClock prometheusClock, PrometheusConnectorConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected static Optional<PrometheusPredicateTimeInfo>determinePredicateTimes(TupleDomain<ColumnHandle> predicate) generateTimesForSplits(Instant defaultUpperBound, io.airlift.units.Duration maxQueryRangeDurationRequested, io.airlift.units.Duration queryChunkSizeDurationRequested, PrometheusTableHandle tableHandle) Utility method to get the end times in decimal seconds that divide up the query into chunks The times will be used in queries to Prometheus like: `http://localhost:9090/api/v1/query?query=up[21d]&time=1568229904.000"` ** NOTE: Prometheus instant query wants the duration and end time specified.getSplits(ConnectorTransactionHandle transaction, ConnectorSession session, ConnectorTableHandle connectorTableHandle, DynamicFilter dynamicFilter, Constraint constraint) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.trino.spi.connector.ConnectorSplitManager
getSplits
-
Constructor Details
-
PrometheusSplitManager
@Inject public PrometheusSplitManager(PrometheusClient prometheusClient, PrometheusClock prometheusClock, PrometheusConnectorConfig config)
-
-
Method Details
-
getSplits
public ConnectorSplitSource getSplits(ConnectorTransactionHandle transaction, ConnectorSession session, ConnectorTableHandle connectorTableHandle, DynamicFilter dynamicFilter, Constraint constraint) - Specified by:
getSplitsin interfaceConnectorSplitManager
-
generateTimesForSplits
protected static List<String> generateTimesForSplits(Instant defaultUpperBound, io.airlift.units.Duration maxQueryRangeDurationRequested, io.airlift.units.Duration queryChunkSizeDurationRequested, PrometheusTableHandle tableHandle) Utility method to get the end times in decimal seconds that divide up the query into chunks The times will be used in queries to Prometheus like: `http://localhost:9090/api/v1/query?query=up[21d]&time=1568229904.000"` ** NOTE: Prometheus instant query wants the duration and end time specified. We use now() for the defaultUpperBound when none is specified, for instance, from predicate push down- Returns:
- list of end times as decimal epoch seconds, like ["1568053244.143", "1568926595.321"]
-
determinePredicateTimes
protected static Optional<PrometheusPredicateTimeInfo> determinePredicateTimes(TupleDomain<ColumnHandle> predicate)
-