public class RedisFieldValueCounterRepository extends java.lang.Object implements FieldValueCounterRepository
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
metricPrefix |
protected org.springframework.data.redis.core.StringRedisTemplate |
redisTemplate |
Constructor and Description |
---|
RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory) |
RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
java.lang.String metricPrefix) |
Modifier and Type | Method and Description |
---|---|
long |
count() |
void |
decrement(java.lang.String counterName,
java.lang.String fieldName) |
void |
decrement(java.lang.String counterName,
java.lang.String fieldName,
double score) |
void |
delete(FieldValueCounter fieldValueCounter) |
void |
delete(java.lang.Iterable<? extends FieldValueCounter> fvcs) |
void |
delete(java.lang.String name) |
void |
deleteAll() |
boolean |
exists(java.lang.String s) |
java.util.List<FieldValueCounter> |
findAll() |
java.lang.Iterable<FieldValueCounter> |
findAll(java.lang.Iterable<java.lang.String> keys) |
FieldValueCounter |
findOne(java.lang.String name) |
protected java.lang.String |
getMetricKey(java.lang.String metricName)
Provides the key for a named metric.
|
protected java.util.Map<java.lang.String,java.lang.Double> |
getZSetData(java.lang.String counterKey) |
void |
increment(java.lang.String counterName,
java.lang.String fieldName) |
void |
increment(java.lang.String counterName,
java.lang.String fieldName,
double score) |
void |
reset(java.lang.String counterName,
java.lang.String fieldName) |
<S extends FieldValueCounter> |
save(java.lang.Iterable<S> metrics) |
<S extends FieldValueCounter> |
save(S fieldValueCounter) |
protected final java.lang.String metricPrefix
protected final org.springframework.data.redis.core.StringRedisTemplate redisTemplate
public RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
public RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, java.lang.String metricPrefix)
public <S extends FieldValueCounter> S save(S fieldValueCounter)
save
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public <S extends FieldValueCounter> java.lang.Iterable<S> save(java.lang.Iterable<S> metrics)
save
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public void delete(java.lang.String name)
delete
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public void delete(FieldValueCounter fieldValueCounter)
delete
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public void delete(java.lang.Iterable<? extends FieldValueCounter> fvcs)
delete
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public FieldValueCounter findOne(java.lang.String name)
findOne
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public boolean exists(java.lang.String s)
exists
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public java.util.List<FieldValueCounter> findAll()
findAll
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public java.lang.Iterable<FieldValueCounter> findAll(java.lang.Iterable<java.lang.String> keys)
findAll
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public long count()
count
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public void deleteAll()
deleteAll
in interface org.springframework.data.repository.CrudRepository<FieldValueCounter,java.lang.String>
public void increment(java.lang.String counterName, java.lang.String fieldName)
public void increment(java.lang.String counterName, java.lang.String fieldName, double score)
public void decrement(java.lang.String counterName, java.lang.String fieldName)
public void decrement(java.lang.String counterName, java.lang.String fieldName, double score)
public void reset(java.lang.String counterName, java.lang.String fieldName)
protected java.lang.String getMetricKey(java.lang.String metricName)
metricName
- the name of the metricprotected java.util.Map<java.lang.String,java.lang.Double> getZSetData(java.lang.String counterKey)