Java Code Examples for redis.clients.jedis.Jedis#sendCommand()

The following examples show how to use redis.clients.jedis.Jedis#sendCommand() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContextedRedisGraph.java    From JRedisGraph with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Deletes the entire graph
 * @param graphId graph to delete
 * @return delete running time statistics
 */
@Override
public String deleteGraph(String graphId) {
    Jedis conn = getConnection();
    Object response;
    try {
        response = conn.sendCommand(RedisGraphCommand.DELETE, graphId);
    }
    catch (Exception e) {
        conn.close();
        throw e;
    }
    //clear local state
    caches.removeGraphCache(graphId);
    return SafeEncoder.encode((byte[]) response);
}
 
Example 2
Source File: ContextedRedisGraph.java    From JRedisGraph with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Sends the query over the instance only connection
 * @param graphId graph to be queried
 * @param preparedQuery prepared query
 * @return Result set with the query answer
 */
@Override
protected ResultSet sendQuery(String graphId, String preparedQuery) {
    Jedis conn = getConnection();
    try {
        List<Object> rawResponse = (List<Object>) conn.sendCommand(RedisGraphCommand.QUERY, graphId, preparedQuery, Utils.COMPACT_STRING);
        return new ResultSetImpl(rawResponse, this, caches.getGraphCache(graphId));
    }
    catch (JRedisGraphRunTimeException rt) {
        throw rt;
    }
    catch (JedisDataException j) {
        throw new JRedisGraphCompileTimeException(j);
    }
}