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 |
create(String url,
int port) |
long |
getCount(String key)
Gets the count for the specified key.
|
static String |
getKeyNumInstances(String keyspace,
ConceptId conceptId)
All the valid keys which map to values in the redis cache
|
static String |
getKeyNumShards(String keyspace,
ConceptId conceptId) |
public static RedisConnection create(String url, int port)
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, ConceptId conceptId)
Copyright © 2017 Grakn Labs Ltd. All rights reserved.