Class RedisGraph
- java.lang.Object
-
- com.redislabs.redisgraph.impl.api.AbstractRedisGraph
-
- com.redislabs.redisgraph.impl.api.RedisGraph
-
- All Implemented Interfaces:
RedisGraph,RedisGraphContextGenerator,Closeable,AutoCloseable
public class RedisGraph extends AbstractRedisGraph implements RedisGraphContextGenerator
-
-
Constructor Summary
Constructors Constructor Description RedisGraph()Creates a client running on the local machineRedisGraph(String host, int port)Creates a client running on the specific host/postRedisGraph(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> jedis)Creates a client using provided Jedis pool
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the Jedis poolStringdeleteGraph(String graphId)Deletes the entire graphprotected redis.clients.jedis.JedisgetConnection()Overrides the abstract function.RedisGraphContextgetContext()Returns a new ContextedRedisGraph bounded to a Jedis connection from the Jedis poolprotected ResultSetsendQuery(String graphId, String preparedQuery)Overrides the abstract function.-
Methods inherited from class com.redislabs.redisgraph.impl.api.AbstractRedisGraph
callProcedure, callProcedure, callProcedure, query, query, query
-
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
-
-
-
-
Constructor Detail
-
RedisGraph
public RedisGraph()
Creates a client running on the local machine
-
RedisGraph
public RedisGraph(String host, int port)
Creates a client running on the specific host/post- Parameters:
host- Redis hostport- Redis port
-
RedisGraph
public RedisGraph(redis.clients.jedis.util.Pool<redis.clients.jedis.Jedis> jedis)
Creates a client using provided Jedis pool- Parameters:
jedis- bring your own Jedis pool
-
-
Method Detail
-
getConnection
protected redis.clients.jedis.Jedis getConnection()
Overrides the abstract function. Gets and returns a Jedis connection from the Jedis pool- Specified by:
getConnectionin classAbstractRedisGraph- Returns:
- a Jedis connection
-
sendQuery
protected ResultSet sendQuery(String graphId, String preparedQuery)
Overrides the abstract function. Sends the query from any Jedis connection received from the Jedis pool and closes it once done- Specified by:
sendQueryin classAbstractRedisGraph- Parameters:
graphId- graph to be queriedpreparedQuery- prepared query- Returns:
- Result set with the query answer
-
close
public void close()
Closes the Jedis pool- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceRedisGraph
-
deleteGraph
public String deleteGraph(String graphId)
Deletes the entire graph- Specified by:
deleteGraphin interfaceRedisGraph- Parameters:
graphId- graph to delete- Returns:
- delete running time statistics
-
getContext
public RedisGraphContext getContext()
Returns a new ContextedRedisGraph bounded to a Jedis connection from the Jedis pool- Specified by:
getContextin interfaceRedisGraphContextGenerator- Returns:
- ContextedRedisGraph
-
-