public class RedisConnection extends Object
Connection To Redis Server
A class which manages the connection to the central Redis cache. This serves as a cache for keeping track of the counts of concepts which may be in need of sharding.
| Modifier and Type | Method and Description |
|---|---|
long |
adjustCount(String key,
long count)
Adjusts the count for a specific key.
|
static RedisConnection |
getConnection()
Returns and possibly initliases a connection pool to the redis server.
|
long |
getCount(String key)
Gets the count for the specified key.
|
static String |
getKeyNumInstances(String keyspace,
ai.grakn.concept.ConceptId conceptId)
All the valid keys which map to values in the redis cache
|
static String |
getKeyNumShards(String keyspace,
ai.grakn.concept.ConceptId conceptId) |
public static RedisConnection getConnection()
public long adjustCount(String key, long count)
key - the key of the value to adjustcount - the number to adjust the key bypublic long getCount(String key)
key - the key stored in redispublic static String getKeyNumInstances(String keyspace, ai.grakn.concept.ConceptId conceptId)
Copyright © 2017 Grakn Labs Ltd. All rights reserved.