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 void
close()
Closes the Jedis poolString
deleteGraph(String graphId)
Deletes the entire graphprotected redis.clients.jedis.Jedis
getConnection()
Overrides the abstract function.RedisGraphContext
getContext()
Returns a new ContextedRedisGraph bounded to a Jedis connection from the Jedis poolprotected ResultSet
sendQuery(String graphId, String preparedQuery)
Overrides the abstract function.protected ResultSet
sendQuery(String graphId, String preparedQuery, long timeout)
Overrides the abstract function.protected ResultSet
sendReadOnlyQuery(String graphId, String preparedQuery)
Overrides the abstract function.protected ResultSet
sendReadOnlyQuery(String graphId, String preparedQuery, long timeout)
Overrides the abstract function.-
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
-
-
-
-
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:
getConnection
in 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:
sendQuery
in classAbstractRedisGraph
- Parameters:
graphId
- graph to be queriedpreparedQuery
- prepared query- Returns:
- Result set with the query answer
-
sendReadOnlyQuery
protected ResultSet sendReadOnlyQuery(String graphId, String preparedQuery)
Overrides the abstract function. Sends the read-only query from any Jedis connection received from the Jedis pool and closes it once done- Specified by:
sendReadOnlyQuery
in 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)
Overrides the abstract function. Sends the query from any Jedis connection received from the Jedis pool and closes it once done- Specified by:
sendQuery
in classAbstractRedisGraph
- Parameters:
graphId
- graph to be queriedpreparedQuery
- prepared querytimeout
-- Returns:
- Result set with the query answer
-
sendReadOnlyQuery
protected ResultSet sendReadOnlyQuery(String graphId, String preparedQuery, long timeout)
Overrides the abstract function. Sends the read-only query from any Jedis connection received from the Jedis pool and closes it once done- Specified by:
sendReadOnlyQuery
in classAbstractRedisGraph
- Parameters:
graphId
- graph to be queriedpreparedQuery
- prepared querytimeout
-- Returns:
- Result set with the query answer
-
close
public void close()
Closes the Jedis pool- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceRedisGraph
-
deleteGraph
public String deleteGraph(String graphId)
Deletes the entire graph- Specified by:
deleteGraph
in 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:
getContext
in interfaceRedisGraphContextGenerator
- Returns:
- ContextedRedisGraph
-
-