mirror of
https://github.com/google/nomulus.git
synced 2025-06-28 15:23:34 +02: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:
parent
5a8760570c
commit
5b0c61dad3
1 changed files with 3 additions and 4 deletions
|
@ -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());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue