public class IDReader extends Object
UserVectorSplitterMapper
and
AggregateAndRecommendReducer
.Constructor and Description |
---|
IDReader(org.apache.hadoop.conf.Configuration conf)
Creates a new IDReader
|
Modifier and Type | Method and Description |
---|---|
FastIDSet |
getItemIds() |
FastIDSet |
getItemsToRecommendForUser(Long userId)
Gets a collection of items which should be recommended for a user
|
FastIDSet |
getUserIds() |
boolean |
isItemsFileSpecified() |
boolean |
isUserItemFileSpecified() |
boolean |
isUserItemFilterSpecified() |
boolean |
isUsersFileSpecified() |
void |
readIDs()
Reads user ids and item ids from files specified in a job configuration
|
public IDReader(org.apache.hadoop.conf.Configuration conf)
conf
- Job configurationpublic void readIDs() throws IOException, IllegalStateException
IOException
- if an error occurs during file read operationIllegalStateException
- if userItemFile option is specified together with usersFile or itemsFilepublic FastIDSet getItemsToRecommendForUser(Long userId)
userId
- ID of a user we are interested inFastIDSet
object populated with item IDs. Otherwise, this
method returns an empty set.public boolean isUsersFileSpecified()
public boolean isItemsFileSpecified()
public boolean isUserItemFileSpecified()
public boolean isUserItemFilterSpecified()
public FastIDSet getUserIds()
public FastIDSet getItemIds()
Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.