mirror of
https://github.com/google/nomulus
synced 2026-09-08 00:57:25 +00:00
Use simpler Iterables helper when counting domains
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=230955066
This commit is contained in:
@@ -19,7 +19,7 @@ import static google.registry.model.registry.Registries.assertTldsExist;
|
|||||||
|
|
||||||
import com.beust.jcommander.Parameter;
|
import com.beust.jcommander.Parameter;
|
||||||
import com.beust.jcommander.Parameters;
|
import com.beust.jcommander.Parameters;
|
||||||
import com.google.common.collect.Iterators;
|
import com.google.common.collect.Iterables;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.util.Clock;
|
import google.registry.util.Clock;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -43,14 +43,13 @@ final class CountDomainsCommand implements CommandWithRemoteApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getCountForTld(String tld, DateTime now) {
|
private int getCountForTld(String tld, DateTime now) {
|
||||||
return Iterators.size(
|
return Iterables.size(
|
||||||
ofy()
|
ofy()
|
||||||
.load()
|
.load()
|
||||||
.type(DomainBase.class)
|
.type(DomainBase.class)
|
||||||
.filter("tld", tld)
|
.filter("tld", tld)
|
||||||
.filter("deletionTime >", now)
|
.filter("deletionTime >", now)
|
||||||
.chunkAll()
|
.chunkAll()
|
||||||
.keys()
|
.keys());
|
||||||
.iterator());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user