Class ContextedRedisGraph
- java.lang.Object
-
- com.redislabs.redisgraph.impl.api.AbstractRedisGraph
-
- com.redislabs.redisgraph.impl.api.ContextedRedisGraph
-
- All Implemented Interfaces:
RedisGraphCacheHolder,RedisGraph,RedisGraphContext,Closeable,AutoCloseable
public class ContextedRedisGraph extends AbstractRedisGraph implements RedisGraphContext, RedisGraphCacheHolder
An implementation of RedisGraphContext. Allows sending RedisGraph and some Redis commands, within a specific connection context
-
-
Constructor Summary
Constructors Constructor Description ContextedRedisGraph(redis.clients.jedis.Jedis connectionContext)Generates a new instance with a specific Jedis connection
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()closes the Jedis connectionStringdeleteGraph(String graphId)Deletes the entire graphprotected redis.clients.jedis.JedisgetConnection()Overrides the abstract method.redis.clients.jedis.JedisgetConnectionContext()Returns implementing class connection contextRedisGraphTransactionmulti()Creates a new RedisGraphTransaction transactional objectRedisGraphPipelinepipelined()Creates a new RedisGraphPipeline pipeline objectprotected ResultSetsendQuery(String graphId, String preparedQuery)Sends the query over the instance only connectionprotected ResultSetsendQuery(String graphId, String preparedQuery, long timeout)Sends the query over the instance only connectionprotected ResultSetsendReadOnlyQuery(String graphId, String preparedQuery)Sends the read-only query over the instance only connectionprotected ResultSetsendReadOnlyQuery(String graphId, String preparedQuery, long timeout)Sends the read-only query over the instance only connectionvoidsetRedisGraphCaches(RedisGraphCaches caches)Stringunwatch()Removes watch from all keysStringwatch(String... keys)Perfrom watch over given Redis keys-
Methods inherited from class com.redislabs.redisgraph.impl.api.AbstractRedisGraph
callProcedure, callProcedure, callProcedure, query, query, query, query, query, readOnlyQuery, readOnlyQuery, readOnlyQuery, readOnlyQuery
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.redislabs.redisgraph.RedisGraph
callProcedure, callProcedure, callProcedure, query, query, query, query, query, readOnlyQuery, readOnlyQuery, readOnlyQuery, readOnlyQuery
-
-
-
-
Method Detail
-
getConnection
protected redis.clients.jedis.Jedis getConnection()
Overrides the abstract method. Return the instance only connection- Specified by:
getConnectionin classAbstractRedisGraph- Returns:
-
sendQuery
protected ResultSet sendQuery(String graphId, String preparedQuery)
Sends the query over the instance only connection- Specified by:
sendQueryin classAbstractRedisGraph- Parameters:
graphId- graph to be queriedpreparedQuery- prepared query- Returns:
- Result set with the query answer
-
sendReadOnlyQuery
protected ResultSet sendReadOnlyQuery(String graphId, String preparedQuery)
Sends the read-only query over the instance only connection- Specified by:
sendReadOnlyQueryin classAbstractRedisGraph- Parameters:
graphId- graph to be queriedpreparedQuery- prepared query- Returns:
- Result set with the query answer
-
sendQuery
protected ResultSet sendQuery(String graphId, String preparedQuery, long timeout)
Sends the query over the instance only connection- Specified by:
sendQueryin classAbstractRedisGraph- Parameters:
graphId- graph to be queriedtimeout-preparedQuery- prepared query- Returns:
- Result set with the query answer
-
sendReadOnlyQuery
protected ResultSet sendReadOnlyQuery(String graphId, String preparedQuery, long timeout)
Sends the read-only query over the instance only connection- Specified by:
sendReadOnlyQueryin classAbstractRedisGraph- Parameters:
graphId- graph to be queriedtimeout-preparedQuery- prepared query- Returns:
- Result set with the query answer
-
getConnectionContext
public redis.clients.jedis.Jedis getConnectionContext()
Description copied from interface:RedisGraphContextReturns implementing class connection context- Specified by:
getConnectionContextin interfaceRedisGraphContext- Returns:
- Returns the instance Jedis connection.
-
multi
public RedisGraphTransaction multi()
Creates a new RedisGraphTransaction transactional object- Specified by:
multiin interfaceRedisGraphContext- Returns:
- new RedisGraphTransaction
-
pipelined
public RedisGraphPipeline pipelined()
Creates a new RedisGraphPipeline pipeline object- Specified by:
pipelinedin interfaceRedisGraphContext- Returns:
- new RedisGraphPipeline
-
watch
public String watch(String... keys)
Perfrom watch over given Redis keys- Specified by:
watchin interfaceRedisGraphContext- Parameters:
keys-- Returns:
- "OK"
-
unwatch
public String unwatch()
Removes watch from all keys- Specified by:
unwatchin interfaceRedisGraphContext- Returns:
-
deleteGraph
public String deleteGraph(String graphId)
Deletes the entire graph- Specified by:
deleteGraphin interfaceRedisGraph- Parameters:
graphId- graph to delete- Returns:
- delete running time statistics
-
close
public void close()
closes the Jedis connection- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceRedisGraph
-
setRedisGraphCaches
public void setRedisGraphCaches(RedisGraphCaches caches)
- Specified by:
setRedisGraphCachesin interfaceRedisGraphCacheHolder
-
-