public interface RedisConnection extends RedisCommands
RedisStringCommands.BitOperation, RedisStringCommands.SetOption
RedisListCommands.Position
RedisZSetCommands.Aggregate, RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.Tuple
RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOption
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs
Modifier and Type | Method and Description |
---|---|
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).
|
RedisSentinelConnection |
getSentinelConnection() |
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.
|
execute
del, dump, exists, expire, expireAt, keys, move, persist, pExpire, pExpireAt, pTtl, pTtl, randomKey, rename, renameNX, restore, scan, sort, sort, ttl, ttl, type
append, bitCount, bitCount, bitOp, decr, decrBy, get, getBit, getRange, getSet, incr, incrBy, incrBy, mGet, mSet, mSetNX, pSetEx, set, set, setBit, setEx, setNX, setRange, strLen
bLPop, bRPop, bRPopLPush, lIndex, lInsert, lLen, lPop, lPush, lPushX, lRange, lRem, lSet, lTrim, rPop, rPopLPush, rPush, rPushX
sAdd, sCard, sDiff, sDiffStore, sInter, sInterStore, sIsMember, sMembers, sMove, sPop, sRandMember, sRandMember, sRem, sScan, sUnion, sUnionStore
zAdd, zAdd, zCard, zCount, zCount, zIncrBy, zInterStore, zInterStore, zRange, zRangeByLex, zRangeByLex, zRangeByLex, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScore, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeByScoreWithScores, zRangeWithScores, zRank, zRem, zRemRange, zRemRangeByScore, zRemRangeByScore, zRevRange, zRevRangeByScore, zRevRangeByScore, zRevRangeByScore, zRevRangeByScore, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeByScoreWithScores, zRevRangeWithScores, zRevRank, zScan, zScore, zUnionStore, zUnionStore
hDel, hExists, hGet, hGetAll, hIncrBy, hIncrBy, hKeys, hLen, hMGet, hMSet, hScan, hSet, hSetNX, hVals
discard, exec, multi, unwatch, watch
getSubscription, isSubscribed, pSubscribe, publish, subscribe
echo, ping, select
bgReWriteAof, bgSave, bgWriteAof, dbSize, flushAll, flushDb, getClientList, getClientName, getConfig, info, info, killClient, lastSave, migrate, migrate, resetConfigStats, save, setClientName, setConfig, shutdown, shutdown, slaveOf, slaveOfNoOne, time
eval, evalSha, evalSha, scriptExists, scriptFlush, scriptKill, scriptLoad
geoAdd, geoAdd, geoAdd, geoAdd, geoDist, geoDist, geoHash, geoPos, geoRadius, geoRadius, geoRadiusByMember, geoRadiusByMember, geoRadiusByMember, geoRemove
pfAdd, pfCount, pfMerge
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() throws RedisPipelineException
RedisPipelineException
- if the pipeline contains any incorrect/invalid statementsRedisSentinelConnection getSentinelConnection()
Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.