public class RedisFieldValueCounterRepository extends 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,
String metricPrefix,
org.springframework.retry.RetryOperations retryOperations) |
| Modifier and Type | Method and Description |
|---|---|
void |
decrement(String counterName,
String fieldName,
double score)
Decrement the FieldValueCounter for a given field name by score, creating missing counters.
|
FieldValueCounter |
findOne(String name)
Retrieve a single counter by name.
|
protected String |
getMetricKey(String metricName)
Provides the key for a named metric.
|
protected Map<String,Double> |
getZSetData(String counterKey) |
void |
increment(String counterName,
String fieldName,
double score)
Increment the FieldValueCounter for a given field name by score, creating missing counters.
|
Collection<String> |
list()
List the names of all available counters.
|
void |
reset(String counterName)
Reset the given FieldValueCounter.
|
public RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
org.springframework.retry.RetryOperations retryOperations)
public RedisFieldValueCounterRepository(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
String metricPrefix,
org.springframework.retry.RetryOperations retryOperations)
public FieldValueCounter findOne(String name)
FieldValueCounterReaderfindOne in interface FieldValueCounterReadername - the name of the counterpublic Collection<String> list()
FieldValueCounterReaderlist in interface FieldValueCounterReaderpublic void increment(String counterName, String fieldName, double score)
FieldValueCounterWriterincrement in interface FieldValueCounterWritercounterName - the FieldValueCounter namefieldName - the name of the fieldscore - the incremental valuepublic void decrement(String counterName, String fieldName, double score)
FieldValueCounterWriterdecrement in interface FieldValueCounterWritercounterName - the FieldValueCounter namefieldName - the name of the fieldscore - the decremental valuepublic void reset(String counterName)
FieldValueCounterWriterreset in interface FieldValueCounterWritercounterName - the FieldValueCounter nameprotected String getMetricKey(String metricName)
metricName - the name of the metricCopyright © 2016 Pivotal Software, Inc.. All rights reserved.