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 -
Method Summary
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Field Details
-
INTERVAL_DAY
- See Also:
-
INTERVAL_WEEK
- See Also:
-
INTERVAL_MONTH
- See Also:
-
-
Method Details
-
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)
-