public class PageViewSqlDao extends AbstractSqlDao<PageView> implements PageViewDao
Modifier and Type | Class and Description |
---|---|
static class |
PageViewSqlDao.Provider |
Modifier and Type | Field and Description |
---|---|
static String |
LOADED_CACHE_KEY |
cache, DEFAULT_FETCH_SIZE, dialect, LOG, wpDs
Constructor and Description |
---|
PageViewSqlDao(WpDataSource dataSource,
MetaInfoDao metaDao,
LocalPageDao pageDao,
File downloadDir) |
Modifier and Type | Method and Description |
---|---|
protected PageView |
buildPageView(org.jooq.Record record) |
void |
clear() |
void |
ensureLoaded(org.joda.time.DateTime start,
org.joda.time.DateTime end,
LanguageSet langs)
Ensure the pageviews for the specified languages and time interval are loaded.
|
void |
ensureLoaded(List<org.joda.time.Interval> intervals,
LanguageSet langs)
Ensure the pageviews for the specified languages and time interval are loaded.
|
Iterable<PageView> |
get(DaoFilter daoFilter)
Returns all pageviews that meet the filter criteria specified by an input PageViewDaoFilter
|
gnu.trove.map.TIntIntMap |
getAllViews(Language language,
org.joda.time.DateTime startDate,
org.joda.time.DateTime endDate)
Calculates and returns non-zero views for every page in the date range.
|
int |
getCount(DaoFilter daoFilter)
Shilad: I'm not sure this makes sense for this dao.
|
Map<Language,SortedSet<org.joda.time.DateTime>> |
getLoadedHours() |
int |
getNumViews(Language lang,
int pageId,
org.joda.time.DateTime startDate,
org.joda.time.DateTime endDate) |
int |
getNumViews(Language lang,
int pageId,
org.joda.time.DateTime startDate,
int numberOfHours) |
Map<Integer,Integer> |
getNumViews(Language lang,
Iterable<Integer> ids,
ArrayList<org.joda.time.DateTime[]> dates)
Returns the total number of views for the requested page.
|
Map<Integer,Integer> |
getNumViews(Language lang,
Iterable<Integer> ids,
org.joda.time.DateTime startTime,
org.joda.time.DateTime endTime)
Returns the total number of views for the requested page.
|
int |
getNumViews(LocalId pageId,
org.joda.time.DateTime startDate,
org.joda.time.DateTime endDate)
Returns the total number of views for the requested page.
|
int |
getNumViews(LocalId pageId,
org.joda.time.DateTime startDate,
int numberOfHours)
Returns the total number of views for the requested page.
|
void |
save(PageView view) |
beginLoad, endLoad, executeSqlResource, executeSqlScriptWithSuffix, freeJooq, getFetchSize, getJooq, getLoadedLanguages, insert, quietlyCloseConn, setFetchSize, useCache
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
beginLoad, endLoad, getLoadedLanguages
public static final String LOADED_CACHE_KEY
public PageViewSqlDao(WpDataSource dataSource, MetaInfoDao metaDao, LocalPageDao pageDao, File downloadDir) throws DaoException
dataSource
- Data source for jdbc connectionsDaoException
public void clear() throws DaoException
clear
in interface Dao<PageView>
clear
in class AbstractSqlDao<PageView>
DaoException
public void save(PageView view) throws DaoException
save
in interface Dao<PageView>
DaoException
public gnu.trove.map.TIntIntMap getAllViews(Language language, org.joda.time.DateTime startDate, org.joda.time.DateTime endDate) throws DaoException
PageViewDao
getAllViews
in interface PageViewDao
DaoException
public int getNumViews(LocalId pageId, org.joda.time.DateTime startDate, int numberOfHours) throws DaoException
PageViewDao
getNumViews
in interface PageViewDao
DaoException
public int getNumViews(Language lang, int pageId, org.joda.time.DateTime startDate, int numberOfHours) throws DaoException
getNumViews
in interface PageViewDao
DaoException
public int getNumViews(Language lang, int pageId, org.joda.time.DateTime startDate, org.joda.time.DateTime endDate) throws DaoException
getNumViews
in interface PageViewDao
DaoException
public int getNumViews(LocalId pageId, org.joda.time.DateTime startDate, org.joda.time.DateTime endDate) throws DaoException
PageViewDao
getNumViews
in interface PageViewDao
DaoException
public Map<Integer,Integer> getNumViews(Language lang, Iterable<Integer> ids, org.joda.time.DateTime startTime, org.joda.time.DateTime endTime) throws org.wikibrain.conf.ConfigurationException, DaoException
PageViewDao
getNumViews
in interface PageViewDao
org.wikibrain.conf.ConfigurationException
DaoException
public Map<Integer,Integer> getNumViews(Language lang, Iterable<Integer> ids, ArrayList<org.joda.time.DateTime[]> dates) throws org.wikibrain.conf.ConfigurationException, DaoException
PageViewDao
getNumViews
in interface PageViewDao
org.wikibrain.conf.ConfigurationException
DaoException
public Iterable<PageView> get(DaoFilter daoFilter) throws DaoException
get
in interface Dao<PageView>
daoFilter
- a set of filters to limit the search
must be a PageViewDaoFilter or DaoException will be thrownDaoException
for a typical example
public int getCount(DaoFilter daoFilter) throws DaoException
getCount
in interface Dao<PageView>
daoFilter
- a set of filters to limit the searchDaoException
public void ensureLoaded(org.joda.time.DateTime start, org.joda.time.DateTime end, LanguageSet langs) throws DaoException
PageViewDao
ensureLoaded
in interface PageViewDao
DaoException
public void ensureLoaded(List<org.joda.time.Interval> intervals, LanguageSet langs) throws DaoException
PageViewDao
ensureLoaded
in interface PageViewDao
DaoException
public Map<Language,SortedSet<org.joda.time.DateTime>> getLoadedHours() throws DaoException
DaoException
protected PageView buildPageView(org.jooq.Record record) throws DaoException
DaoException
Copyright © 2015. All rights reserved.