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