|
Spring Data Key-Value | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RedisConnection
A connection to a Redis server. Acts as an common abstraction across various Redis client libraries (or drivers). Additionally performs exception translation between the underlying Redis client library and Spring DAO exceptions. The methods follow as much as possible the Redis names and conventions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.springframework.data.keyvalue.redis.connection.RedisListCommands |
---|
RedisListCommands.Position |
Nested classes/interfaces inherited from interface org.springframework.data.keyvalue.redis.connection.RedisZSetCommands |
---|
RedisZSetCommands.Aggregate, RedisZSetCommands.Tuple |
Method Summary | |
---|---|
void |
close()
Closes (or quits) the connection. |
List<Object> |
closePipeline()
Executes the commands in the pipeline and returns their result. |
Object |
getNativeConnection()
Returns the native connection (the underlying library/driver object). |
boolean |
isClosed()
Indicates whether the underlying connection is closed or not. |
boolean |
isPipelined()
Indicates whether the connection is currently pipelined or not. |
boolean |
isQueueing()
Indicates whether the connection is in "queue"(or "MULTI") mode or not. |
void |
openPipeline()
Activates the pipeline mode for this connection. |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisCommands |
---|
del, echo, exists, expire, expireAt, keys, persist, ping, randomKey, rename, renameNX, select, sort, sort, ttl, type |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisTxCommands |
---|
discard, exec, multi, unwatch, watch |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisStringCommands |
---|
append, decr, decrBy, get, getBit, getRange, getSet, incr, incrBy, mGet, mSet, mSetNX, set, setBit, setEx, setNX, setRange, strLen |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisListCommands |
---|
bLPop, bRPop, bRPopLPush, lIndex, lInsert, lLen, lPop, lPush, lPushX, lRange, lRem, lSet, lTrim, rPop, rPopLPush, rPush, rPushX |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisSetCommands |
---|
sAdd, sCard, sDiff, sDiffStore, sInter, sInterStore, sIsMember, sMembers, sMove, sPop, sRandMember, sRem, sUnion, sUnionStore |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisZSetCommands |
---|
zAdd, zCard, zCount, zIncrBy, zInterStore, zInterStore, zRange, zRangeByScore, zRangeByScore, zRangeByScoreWithScore, zRangeByScoreWithScore, zRangeWithScore, zRank, zRem, zRemRange, zRemRangeByScore, zRevRange, zRevRangeWithScore, zRevRank, zScore, zUnionStore, zUnionStore |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisHashCommands |
---|
hDel, hExists, hGet, hGetAll, hIncrBy, hKeys, hLen, hMGet, hMSet, hSet, hSetNX, hVals |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisServerCommands |
---|
bgSave, bgWriteAof, dbSize, flushAll, flushDb, getConfig, info, lastSave, resetConfigStats, save, setConfig, shutdown |
Methods inherited from interface org.springframework.data.keyvalue.redis.connection.RedisPubSubCommands |
---|
getSubscription, isSubscribed, pSubscribe, publish, subscribe |
Method Detail |
---|
void close() throws DataAccessException
DataAccessException
boolean isClosed()
Object getNativeConnection()
boolean isQueueing()
boolean isPipelined()
openPipeline()
,
isQueueing()
void openPipeline()
closePipeline()
.
Calling this method when the connection is already pipelined has no effect.
Pipelining is used for issuing commands without requesting the response right away but rather
at the end of the batch. While somewhat similar to MULTI, pipelining does not
guarantee atomicity - it only tries to improve performance when issuing a lot of
commands (such as in batching scenarios).
Note:
Consider doing some performance testing before using this feature since in many cases the performance benefits are minimal yet the impact on usage are not.
RedisTxCommands.multi()
List<Object> closePipeline()
|
Spring Data Key-Value | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |