public abstract class AbstractJDBCDiffStorage extends AbstractJDBCComponent implements DiffStorage
A DiffStorage which stores diffs in a database. Database-specific implementations subclass this
abstract class. Note that this implementation has a fairly particular dependence on the
DataModel used; it needs a JDBCDataModel attached to the
same database since its efficient operation depends on accessing preference data in the database directly.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_AVERAGE_DIFF_COLUMN |
static String |
DEFAULT_COUNT_COLUMN |
static String |
DEFAULT_DIFF_TABLE |
static String |
DEFAULT_ITEM_A_COLUMN |
static String |
DEFAULT_ITEM_B_COLUMN |
static String |
DEFAULT_STDEV_COLUMN |
DEFAULT_DATASOURCE_NAME| Modifier | Constructor and Description |
|---|---|
protected |
AbstractJDBCDiffStorage(JDBCDataModel dataModel,
String getDiffSQL,
String getDiffsSQL,
String getAverageItemPrefSQL,
String getDiffsAffectedByUserSQL,
String[] updateDiffSQLs,
String updateOneDiffSQL,
String addDiffSQL,
String removeDiffSQL,
String getRecommendableItemsSQL,
String deleteDiffsSQL,
String createDiffsSQL,
String diffsExistSQL,
int minDiffCount) |
| Modifier and Type | Method and Description |
|---|---|
void |
addItemPref(long userID,
long itemID,
float prefValue) |
RunningAverage |
getAverageItemPref(long itemID) |
RunningAverage |
getDiff(long itemID1,
long itemID2) |
RunningAverage[] |
getDiffs(long userID,
long itemID,
PreferenceArray prefs) |
FastIDSet |
getRecommendableItemIDs(long userID) |
void |
refresh(Collection<Refreshable> alreadyRefreshed) |
void |
removeItemPref(long userID,
long itemID,
float prefValue) |
void |
updateItemPref(long itemID,
float prefDelta)
Note that this implementation does not update standard deviations.
|
checkNotNullAndLog, checkNotNullAndLog, getFetchSize, lookupDataSourcepublic static final String DEFAULT_DIFF_TABLE
public static final String DEFAULT_ITEM_A_COLUMN
public static final String DEFAULT_ITEM_B_COLUMN
public static final String DEFAULT_COUNT_COLUMN
public static final String DEFAULT_AVERAGE_DIFF_COLUMN
public static final String DEFAULT_STDEV_COLUMN
protected AbstractJDBCDiffStorage(JDBCDataModel dataModel, String getDiffSQL, String getDiffsSQL, String getAverageItemPrefSQL, String getDiffsAffectedByUserSQL, String[] updateDiffSQLs, String updateOneDiffSQL, String addDiffSQL, String removeDiffSQL, String getRecommendableItemsSQL, String deleteDiffsSQL, String createDiffsSQL, String diffsExistSQL, int minDiffCount) throws TasteException
TasteExceptionpublic RunningAverage getDiff(long itemID1, long itemID2) throws TasteException
getDiff in interface DiffStorageTasteExceptionpublic RunningAverage[] getDiffs(long userID, long itemID, PreferenceArray prefs) throws TasteException
getDiffs in interface DiffStorageTasteExceptionpublic RunningAverage getAverageItemPref(long itemID) throws TasteException
getAverageItemPref in interface DiffStorageTasteExceptionpublic void addItemPref(long userID,
long itemID,
float prefValue)
throws TasteException
addItemPref in interface DiffStorageTasteExceptionpublic void updateItemPref(long itemID,
float prefDelta)
throws TasteException
updateItemPref in interface DiffStorageTasteExceptionpublic void removeItemPref(long userID,
long itemID,
float prefValue)
throws TasteException
removeItemPref in interface DiffStorageTasteExceptionpublic FastIDSet getRecommendableItemIDs(long userID) throws TasteException
getRecommendableItemIDs in interface DiffStorageTasteExceptionpublic void refresh(Collection<Refreshable> alreadyRefreshed)
refresh in interface RefreshableCopyright © 2008–2013 The Apache Software Foundation. All rights reserved.