public class RedisFieldValueCounterRepository extends java.lang.Object implements FieldValueCounterRepository
Constructor and Description |
---|
RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
org.springframework.retry.RetryOperations retryOperations) |
RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
java.lang.String metricPrefix,
org.springframework.retry.RetryOperations retryOperations) |
Modifier and Type | Method and Description |
---|---|
long |
count() |
void |
decrement(java.lang.String counterName,
java.lang.String fieldName)
Decrement the FieldValueCounter for a given field name by one, creating missing counters.
|
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)
Increment the FieldValueCounter for a given field name by one, creating missing counters.
|
void |
increment(java.lang.String counterName,
java.lang.String fieldName,
double score) |
void |
reset(java.lang.String counterName,
java.lang.String fieldName)
Reset the FieldValueCounter to zero for the given field name, creating missing counters.
|
<S extends FieldValueCounter> |
save(java.lang.Iterable<S> metrics) |
<S extends FieldValueCounter> |
save(S fieldValueCounter) |
public RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, org.springframework.retry.RetryOperations retryOperations)
public RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory, java.lang.String metricPrefix, org.springframework.retry.RetryOperations retryOperations)
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)
FieldValueCounterRepository
increment
in interface FieldValueCounterRepository
counterName
- the FieldValueCounter namefieldName
- the name of the fieldpublic void increment(java.lang.String counterName, java.lang.String fieldName, double score)
public void decrement(java.lang.String counterName, java.lang.String fieldName)
FieldValueCounterRepository
decrement
in interface FieldValueCounterRepository
counterName
- the FieldValueCounter namefieldName
- the name of the fieldpublic void decrement(java.lang.String counterName, java.lang.String fieldName, double score)
public void reset(java.lang.String counterName, java.lang.String fieldName)
FieldValueCounterRepository
reset
in interface FieldValueCounterRepository
counterName
- the FieldValueCounter namefieldName
- the name of the fieldprotected 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)