Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMMON: #1613

Merged
merged 1 commit into from Apr 24, 2019
Merged

COMMON: #1613

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,6 +24,7 @@
import net.opentsdb.query.QueryNodeFactory;
import net.opentsdb.query.TimeSeriesDataSourceConfig;
import net.opentsdb.query.TimeSeriesQuery;
import net.opentsdb.rollup.RollupConfig;
import net.opentsdb.stats.Span;

/**
Expand Down Expand Up @@ -104,4 +105,10 @@ public Deferred<List<byte[]>> encodeJoinMetrics(
final List<String> join_metrics,
final Span span);

/**
* Return a rollup config for the source.
* @return A potentially null rollup config for the source.
*/
public RollupConfig rollupConfig();

}
Expand Up @@ -53,6 +53,7 @@
import net.opentsdb.query.processor.BaseQueryNodeFactory;
import net.opentsdb.query.processor.merge.MergerConfig;
import net.opentsdb.query.processor.timeshift.TimeShiftConfig;
import net.opentsdb.rollup.RollupConfig;
import net.opentsdb.stats.Span;
import net.opentsdb.utils.DateTime;
import net.opentsdb.utils.Pair;
Expand Down Expand Up @@ -630,6 +631,12 @@ public Deferred<List<byte[]>> encodeJoinMetrics(
throw new UnsupportedOperationException();
}

@Override
public RollupConfig rollupConfig() {
// TODO - need to make sure downstream returns identical configs.
throw new UnsupportedOperationException();
}

/**
* Helper to build the config key with a factory id.
* @param suffix The non-null and non-empty config suffix.
Expand Down
Expand Up @@ -49,6 +49,7 @@
import net.opentsdb.query.processor.BaseQueryNodeFactory;
import net.opentsdb.query.processor.merge.MergerConfig;
import net.opentsdb.query.router.TimeRouterConfigEntry.MatchType;
import net.opentsdb.rollup.RollupConfig;
import net.opentsdb.stats.Span;

/**
Expand Down Expand Up @@ -211,6 +212,11 @@ public Deferred<List<byte[]>> encodeJoinMetrics(
"This node should have been removed from the graph."));
}

@Override
public RollupConfig rollupConfig() {
return null;
}

@Override
public Deferred<Object> initialize(final TSDB tsdb, final String id) {
this.id = Strings.isNullOrEmpty(id) ? TYPE : id;
Expand Down
Expand Up @@ -39,6 +39,7 @@
import net.opentsdb.query.WrappedTimeSeriesDataSourceConfig;
import net.opentsdb.query.plan.QueryPlanner;
import net.opentsdb.query.processor.timeshift.TimeShiftConfig;
import net.opentsdb.rollup.RollupConfig;
import net.opentsdb.stats.Span;

/**
Expand Down Expand Up @@ -168,4 +169,8 @@ public Deferred<List<byte[]>> encodeJoinMetrics(
return Deferred.fromError(new UnsupportedOperationException());
}

@Override
public RollupConfig rollupConfig() {
return null;
}
}
Expand Up @@ -41,6 +41,7 @@
import net.opentsdb.query.plan.QueryPlanner;
import net.opentsdb.query.processor.timeshift.TimeShiftConfig;
import net.opentsdb.rollup.DefaultRollupConfig;
import net.opentsdb.rollup.RollupConfig;
import net.opentsdb.stats.Span;
import net.opentsdb.storage.WritableTimeSeriesDataStore;
import net.opentsdb.storage.WritableTimeSeriesDataStoreFactory;
Expand Down Expand Up @@ -228,6 +229,11 @@ public Deferred<List<byte[]>> encodeJoinMetrics(
return schema.getIds(UniqueIdType.METRIC, join_metrics, span);
}

@Override
public RollupConfig rollupConfig() {
return rollup_config;
}

void registerConfigs(final TSDB tsdb) {
if (!tsdb.getConfig().hasProperty(getConfigKey(ROLLUP_KEY))) {
tsdb.getConfig().register(
Expand Down
Expand Up @@ -69,6 +69,7 @@
import net.opentsdb.query.processor.groupby.GroupBy;
import net.opentsdb.query.processor.groupby.GroupByConfig;
import net.opentsdb.query.processor.merge.Merger;
import net.opentsdb.rollup.RollupConfig;
import net.opentsdb.stats.QueryStats;
import net.opentsdb.stats.Span;
import net.opentsdb.utils.DateTime;
Expand Down Expand Up @@ -1606,6 +1607,12 @@ public String type() {
public String version() {
return "3.0.0";
}

@Override
public RollupConfig rollupConfig() {
// TODO Auto-generated method stub
return null;
}

}
}
Expand Up @@ -63,6 +63,7 @@
import net.opentsdb.query.processor.groupby.GroupByConfig;
import net.opentsdb.query.processor.merge.Merger;
import net.opentsdb.query.router.TimeRouterConfigEntry.MatchType;
import net.opentsdb.rollup.RollupConfig;
import net.opentsdb.stats.QueryStats;
import net.opentsdb.stats.Span;

Expand Down Expand Up @@ -420,6 +421,12 @@ public String type() {
public String version() {
return "3.0.0";
}

@Override
public RollupConfig rollupConfig() {
// TODO Auto-generated method stub
return null;
}

}
}
Expand Up @@ -136,7 +136,8 @@ public QueryNode newNode(final QueryPipelineContext context,
endpoint);
}

RollupConfig rollupConfig() {
@Override
public RollupConfig rollupConfig() {
return rollup_config;
}

Expand Down
Expand Up @@ -20,6 +20,7 @@
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import net.opentsdb.common.Const;
import net.opentsdb.data.TimeSeriesDataSourceFactory;
import net.opentsdb.data.TimeStamp;
import net.opentsdb.exceptions.QueryExecutionCanceled;
import net.opentsdb.exceptions.QueryExecutionException;
Expand Down Expand Up @@ -414,7 +415,7 @@ public void completed(final HttpResponse response) {

for (final JsonNode result : results) {
sendUpstream(new HttpQueryV3Result(HttpQueryV3Source.this, result,
((HttpQueryV3Factory) factory).rollupConfig()));
((TimeSeriesDataSourceFactory) factory).rollupConfig()));
}
}
} catch (Throwable t) {
Expand Down
Expand Up @@ -46,6 +46,7 @@
import net.opentsdb.query.DefaultTimeSeriesDataSourceConfig;
import net.opentsdb.query.processor.downsample.DownsampleConfig;
import net.opentsdb.query.serdes.PBufSerdesFactory;
import net.opentsdb.rollup.RollupConfig;
import net.opentsdb.stats.Span;

/**
Expand Down Expand Up @@ -163,6 +164,11 @@ public Deferred<List<byte[]>> encodeJoinMetrics(
throw new UnsupportedOperationException();
}

@Override
public RollupConfig rollupConfig() {
return null;
}

void registerConfig(final TSDB tsdb) {
if (!tsdb.getConfig().hasProperty(PORT_KEY)) {
tsdb.getConfig().register(PORT_KEY, 4243, false,
Expand Down