mirror of
https://github.com/google/nomulus
synced 2026-07-22 16:02:38 +00:00
Improve Datastore efficiency of duplicate contact messages
I should have caught this in the review, but [] is loading *ALL* contacts individually from Datastore on every domain update. This will add a large number of Datastore round trips and thus significantly reduce update performance. This CL changes the behavior to *ONLY* load contacts when there is a duplicate (which is needed to determine the contact's display name to generate the error message), and loads all of them in a single batch rather than individually. This also makes some minor changes around domain getters returning empty sets instead of null. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=233128140
This commit is contained in:
@@ -43,6 +43,7 @@ import google.registry.model.host.HostResource;
|
||||
import google.registry.model.index.ForeignKeyIndex;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
@@ -90,6 +91,7 @@ public class DomainCommand {
|
||||
return registrantContactId;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Key<ContactResource> getRegistrant() {
|
||||
return registrant;
|
||||
}
|
||||
@@ -153,15 +155,15 @@ public class DomainCommand {
|
||||
}
|
||||
|
||||
public ImmutableSet<String> getNameserverFullyQualifiedHostNames() {
|
||||
return nullSafeImmutableCopy(nameserverFullyQualifiedHostNames);
|
||||
return nullToEmptyImmutableCopy(nameserverFullyQualifiedHostNames);
|
||||
}
|
||||
|
||||
public ImmutableSet<Key<HostResource>> getNameservers() {
|
||||
return nullSafeImmutableCopy(nameservers);
|
||||
return nullToEmptyImmutableCopy(nameservers);
|
||||
}
|
||||
|
||||
public ImmutableSet<DesignatedContact> getContacts() {
|
||||
return nullSafeImmutableCopy(contacts);
|
||||
return nullToEmptyImmutableCopy(contacts);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user