mirror of
https://github.com/google/nomulus
synced 2026-01-04 04:04:22 +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.Parameters;
|
||||
import com.google.common.collect.Iterators;
|
||||
import com.google.common.collect.Iterables;
|
||||
import google.registry.model.domain.DomainBase;
|
||||
import google.registry.util.Clock;
|
||||
import java.util.List;
|
||||
@@ -43,14 +43,13 @@ final class CountDomainsCommand implements CommandWithRemoteApi {
|
||||
}
|
||||
|
||||
private int getCountForTld(String tld, DateTime now) {
|
||||
return Iterators.size(
|
||||
return Iterables.size(
|
||||
ofy()
|
||||
.load()
|
||||
.type(DomainBase.class)
|
||||
.filter("tld", tld)
|
||||
.filter("deletionTime >", now)
|
||||
.chunkAll()
|
||||
.keys()
|
||||
.iterator());
|
||||
.keys());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user