public final class PrefetchingUserDAO extends Object implements UserDAO, Describable
User DAO that streams the events to get user information. The user set is fetched and memorized once for each instance of this class.
Constructor and Description |
---|
PrefetchingUserDAO(EventDAO events) |
Modifier and Type | Method and Description |
---|---|
void |
describeTo(DescriptionWriter writer)
Write this class’s description to a sink.
|
LongSet |
getUserIds()
Get all known user IDs.
|
static Function<EventDAO,UserDAO> |
wrapper()
A function that wraps an event DAO in a prefetching user DAO.
|
@Inject public PrefetchingUserDAO(EventDAO events)
public static Function<EventDAO,UserDAO> wrapper()
A function that wraps an event DAO in a prefetching user DAO. If the DAO already implements UserDAO
, it is returned unwrapped.
public LongSet getUserIds()
UserDAO
Get all known user IDs.
getUserIds
in interface UserDAO
public void describeTo(DescriptionWriter writer)
Describable
Write this class’s description to a sink. Anything relevant to this object’s identity should be digested; the idea is that, barring hash collisions, two objects with the same digest are equivalent. Used for things like deterministically generating cache file names.
describeTo
in interface Describable
writer
- The description writer to use.