@Qualifier(value="aggregate") public class RedisAggregateCounterRepository extends RedisCounterRepository implements AggregateCounterRepository
AggregateCounterRepository. Subclasses and intercepts calls to
RedisCounterRepository to also track counts in various redis hashes.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.data.redis.core.HashOperations<java.lang.String,java.lang.String,java.lang.Long> |
hashOperations |
protected org.springframework.data.redis.core.SetOperations<java.lang.String,java.lang.String> |
setOperations |
longOperationsredisOperations, repoPrefix, zSetOperations| Constructor and Description |
|---|
RedisAggregateCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory,
org.springframework.retry.RetryOperations retryOperations) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(java.lang.String id) |
AggregateCount |
getCounts(java.lang.String name,
int nCounts,
AggregateCountResolution resolution)
Query function which returns the last 'n' points for a particular resolution.
|
AggregateCount |
getCounts(java.lang.String name,
int nCounts,
org.joda.time.DateTime endDate,
AggregateCountResolution resolution)
Queries by requesting a number of points, ending on the given date (inclusive).
|
AggregateCount |
getCounts(java.lang.String name,
org.joda.time.Interval interval,
AggregateCountResolution resolution)
For each query, we need to convert the interval into two variations.
|
long |
increment(java.lang.String name)
Increment the given counter by one, creating it if it did not exist.
|
long |
increment(java.lang.String name,
long amount)
Increment the given counter by the specified amount, creating it if it did not exist.
|
long |
increment(java.lang.String name,
long amount,
org.joda.time.DateTime dateTime)
Increments the named counter by a specific amount for the given instant.
|
decrement, deserialize, deserializeId, keyFor, reset, serialize, serializeIdcount, delete, delete, deleteAll, exists, findAll, findAll, findAll, findAll, findAllInRange, findOne, getPrefix, idFromRedisKey, redisKeyFromId, save, save, setPrefix, trackMembershipclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecrement, resetfindAll, findAllcount, delete, delete, deleteAll, exists, findAll, findAll, findOne, save, savefindAllInRangeprotected org.springframework.data.redis.core.HashOperations<java.lang.String,java.lang.String,java.lang.Long> hashOperations
protected org.springframework.data.redis.core.SetOperations<java.lang.String,java.lang.String> setOperations
public RedisAggregateCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory,
org.springframework.retry.RetryOperations retryOperations)
public long increment(java.lang.String name)
CounterRepositoryincrement in interface CounterRepositoryincrement in class RedisCounterRepositorypublic long increment(java.lang.String name,
long amount)
CounterRepositoryincrement in interface CounterRepositoryincrement in class RedisCounterRepositorypublic long increment(java.lang.String name,
long amount,
org.joda.time.DateTime dateTime)
AggregateCounterRepositoryincrement in interface AggregateCounterRepositorypublic AggregateCount getCounts(java.lang.String name, int nCounts, AggregateCountResolution resolution)
AggregateCounterRepositorygetCounts in interface AggregateCounterRepositoryname - the counter to querynCounts - the number of data points to returnresolution - the resolution at which the data should be returned (minute, hour, day, month)public AggregateCount getCounts(java.lang.String name, int nCounts, org.joda.time.DateTime endDate, AggregateCountResolution resolution)
AggregateCounterRepositorygetCounts in interface AggregateCounterRepositoryname - the counter to querynCounts - the number of data points to returnendDate - the end of the query interval (inclusive). Cannot be null.resolution - the resolution at which the data should be returned (minute, hour, day, month)public AggregateCount getCounts(java.lang.String name, org.joda.time.Interval interval, AggregateCountResolution resolution)
getCounts in interface AggregateCounterRepositoryname - the counter to queryinterval - the time interval to return data for. Includes start and end.resolution - the resolution at which the data should be returned (minute, hour, day, month)public void delete(java.lang.String id)
delete in interface org.springframework.data.repository.CrudRepository<Counter,java.lang.String>delete in class AbstractRedisRepository<Counter,java.lang.String>