mirror of
https://github.com/google/nomulus.git
synced 2025-08-02 16:02:10 +02:00
Pass the ICANN reporting BQ dataset to the DNS query coordinator (#1405)
This commit is contained in:
parent
7fedd40739
commit
e0dc2e43bb
3 changed files with 12 additions and 4 deletions
|
@ -35,14 +35,19 @@ public interface DnsCountQueryCoordinator {
|
|||
* <p>If your report query requires any additional parameters, add them here.
|
||||
*/
|
||||
class Params {
|
||||
|
||||
public BigqueryConnection bigquery;
|
||||
|
||||
/** The Google Cloud project id. */
|
||||
public String projectId;
|
||||
|
||||
public Params(BigqueryConnection bigquery, String projectId) {
|
||||
/** The BigQuery dataset from which to query. */
|
||||
public String icannReportingDataSet;
|
||||
|
||||
public Params(BigqueryConnection bigquery, String projectId, String icannReportingDataSet) {
|
||||
this.bigquery = bigquery;
|
||||
this.projectId = projectId;
|
||||
this.icannReportingDataSet = icannReportingDataSet;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.reporting.icann;
|
||||
|
||||
import static google.registry.reporting.icann.IcannReportingModule.ICANN_REPORTING_DATA_SET;
|
||||
import static google.registry.util.TypeUtils.getClassFromString;
|
||||
import static google.registry.util.TypeUtils.instantiate;
|
||||
|
||||
|
@ -21,6 +22,7 @@ import dagger.Module;
|
|||
import dagger.Provides;
|
||||
import google.registry.bigquery.BigqueryConnection;
|
||||
import google.registry.config.RegistryConfig.Config;
|
||||
import javax.inject.Named;
|
||||
|
||||
/** Dagger module to provide the DnsCountQueryCoordinator. */
|
||||
@Module
|
||||
|
@ -30,9 +32,10 @@ public class DnsCountQueryCoordinatorModule {
|
|||
static DnsCountQueryCoordinator provideDnsCountQueryCoordinator(
|
||||
@Config("dnsCountQueryCoordinatorClass") String customClass,
|
||||
BigqueryConnection bigquery,
|
||||
@Config("projectId") String projectId) {
|
||||
@Config("projectId") String projectId,
|
||||
@Named(ICANN_REPORTING_DATA_SET) String icannReportingDataSet) {
|
||||
DnsCountQueryCoordinator.Params params =
|
||||
new DnsCountQueryCoordinator.Params(bigquery, projectId);
|
||||
new DnsCountQueryCoordinator.Params(bigquery, projectId, icannReportingDataSet);
|
||||
return instantiate(getClassFromString(customClass, DnsCountQueryCoordinator.class), params);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class ActivityReportingQueryBuilderTest {
|
|||
"domain-registry-alpha",
|
||||
datasetName,
|
||||
new BasicDnsCountQueryCoordinator(
|
||||
new BasicDnsCountQueryCoordinator.Params(null, "domain-registry-alpha")));
|
||||
new BasicDnsCountQueryCoordinator.Params(null, "domain-registry-alpha", datasetName)));
|
||||
}
|
||||
|
||||
@TestOfyOnly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue