Package org.duracloud.mill.db.repo
Interface JpaSpaceStatsRepo
-
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<SpaceStats,Long>,org.springframework.data.jpa.repository.JpaRepository<SpaceStats,Long>,org.springframework.data.repository.PagingAndSortingRepository<SpaceStats,Long>,org.springframework.data.repository.query.QueryByExampleExecutor<SpaceStats>,org.springframework.data.repository.Repository<SpaceStats,Long>
@Repository("spaceStatsRepo") public interface JpaSpaceStatsRepo extends org.springframework.data.jpa.repository.JpaRepository<SpaceStats,Long>- Author:
- Daniel Bernstein
-
-
Field Summary
Fields Modifier and Type Field Description static StringINTERVAL_DAYstatic StringINTERVAL_MONTHstatic StringINTERVAL_WEEK
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Object[]>getByAccountIdAndStoreId(String accountId, String storeId, Date start, Date end, String interval)List<Object[]>getByAccountIdAndStoreIdAndDay(String accountId, String storeId, Date start, Date end)List<Object[]>getByAccountIdAndStoreIdAndSpaceId(String accountId, String storeId, String spaceId, Date start, Date end, String interval)-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, delete, delete, deleteAll, exists, findOne, save
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlush
-
-
-
-
Field Detail
-
INTERVAL_DAY
static final String INTERVAL_DAY
- See Also:
- Constant Field Values
-
INTERVAL_WEEK
static final String INTERVAL_WEEK
- See Also:
- Constant Field Values
-
INTERVAL_MONTH
static final String INTERVAL_MONTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getByAccountIdAndStoreIdAndSpaceId
@Query(nativeQuery=true, value="select unix_timestamp(date_format(min(modified), \'%Y-%m-%d 23:59:59\')) as modified, account_id, store_id, space_id, avg(byte_count) as byte_count, avg(object_count) as object_count, date_format(modified, :interval) from space_stats where account_id = :accountId and store_id = :storeId and space_id = :spaceId and modified between :start and :end group by date_format(modified, :interval), account_id, store_id, space_id") List<Object[]> getByAccountIdAndStoreIdAndSpaceId(@Param("accountId") String accountId, @Param("storeId") String storeId, @Param("spaceId") String spaceId, @Param("start") Date start, @Param("end") Date end, @Param("interval") String interval)
-
getByAccountIdAndStoreId
@Query(nativeQuery=true, value="select a.modified, a.account_id, a.store_id, sum(a.byte_count), sum(a.object_count) from (select unix_timestamp(date_format(min(modified), \'%Y-%m-%d 23:59:59\')) as modified, account_id, store_id, space_id, avg(byte_count) as byte_count, avg(object_count) as object_count, date_format(modified, :interval) from space_stats where account_id = :accountId and store_id = :storeId and modified between :start and :end group by date_format(modified, :interval), account_id, store_id, space_id) a group by a.modified, a.account_id, a.store_id") List<Object[]> getByAccountIdAndStoreId(@Param("accountId") String accountId, @Param("storeId") String storeId, @Param("start") Date start, @Param("end") Date end, @Param("interval") String interval)
-
getByAccountIdAndStoreIdAndDay
@Query(nativeQuery=true, value="select unix_timestamp(date_format(min(modified), \'%Y-%m-%d 23:59:59\')) as modified, account_id, store_id, space_id, avg(byte_count) as byte_count, avg(object_count) as object_count, date_format(modified, \'%Y-%m-%d 00:00:00\') from space_stats where account_id = :accountId and store_id = :storeId and modified between :start and :end group by date_format(modified, \'%Y-%m-%d\'), account_id, store_id, space_id") List<Object[]> getByAccountIdAndStoreIdAndDay(@Param("accountId") String accountId, @Param("storeId") String storeId, @Param("start") Date start, @Param("end") Date end)
-
-