mirror of
https://github.com/google/nomulus.git
synced 2025-04-29 11:37:51 +02:00
Disable id preassignment when writing to sql (#1893)
* Disable id preassignment when writing to sql See b/264416932 for details.
This commit is contained in:
parent
34288a8a81
commit
34a0176f52
2 changed files with 1 additions and 12 deletions
|
@ -26,7 +26,6 @@ import google.registry.beam.common.RegistryJpaIO;
|
|||
import google.registry.beam.common.RegistryJpaIO.Read;
|
||||
import google.registry.beam.spec11.SafeBrowsingTransforms.EvaluateSafeBrowsingFn;
|
||||
import google.registry.config.RegistryConfig.ConfigModule;
|
||||
import google.registry.model.IdService;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.reporting.Spec11ThreatMatch;
|
||||
import google.registry.model.reporting.Spec11ThreatMatch.ThreatType;
|
||||
|
@ -175,7 +174,7 @@ public class Spec11Pipeline implements Serializable {
|
|||
.setDomainName(input.getKey().domainName())
|
||||
.setDomainRepoId(input.getKey().domainRepoId())
|
||||
.setRegistrarId(input.getKey().registrarId())
|
||||
.setId(IdService.allocateId())
|
||||
// TODO(b/264416932) Assign id to prevent duplicate inserts.
|
||||
.build();
|
||||
output.output(spec11ThreatMatch);
|
||||
}
|
||||
|
|
|
@ -133,16 +133,6 @@ public class Spec11ThreatMatch extends ImmutableObject implements Buildable, Ser
|
|||
return super.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually set the ID for testing or other special circumstances.
|
||||
*
|
||||
* <p>In general the ID is generated by SQL and there should be no need to set it manually.
|
||||
*/
|
||||
public Builder setId(Long id) {
|
||||
getInstance().id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDomainName(String domainName) {
|
||||
getInstance().domainName = domainName;
|
||||
getInstance().tld = DomainNameUtils.getTldFromDomainName(domainName);
|
||||
|
|
Loading…
Add table
Reference in a new issue