当前位置: 首页>>代码示例>>Java>>正文


Java Pipeline.hdel方法代码示例

本文整理汇总了Java中redis.clients.jedis.Pipeline.hdel方法的典型用法代码示例。如果您正苦于以下问题:Java Pipeline.hdel方法的具体用法?Java Pipeline.hdel怎么用?Java Pipeline.hdel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在redis.clients.jedis.Pipeline的用法示例。


在下文中一共展示了Pipeline.hdel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteFile

import redis.clients.jedis.Pipeline; //导入方法依赖的package包/类
/**
 * Use transactions to delete index file
 *
 * @param fileLengthKey
 * @param fileDataKey
 * @param field
 * @param blockSize
 */
@Override
public void deleteFile(String fileLengthKey, String fileDataKey, String field, long blockSize) {
    Jedis jedis = null;
    try {
        jedis = jedisPool.getResource();
        Pipeline pipelined = jedis.pipelined();
        //delete file length
        pipelined.hdel(fileLengthKey.getBytes(), field.getBytes());
        //delete file content
        for (int i = 0; i < blockSize; i++) {
            byte[] blockName = getBlockName(field, i);
            pipelined.hdel(fileDataKey.getBytes(), blockName);
        }
        pipelined.sync();
    } finally {
        jedis.close();
    }
}
 
开发者ID:shijiebei2009,项目名称:RedisDirectory,代码行数:27,代码来源:JedisPoolStream.java

示例2: battleEnd

import redis.clients.jedis.Pipeline; //导入方法依赖的package包/类
/**
 * After the Battle's reward is processed, the battle ends and all
 * data in Redis should be cleaned.
 * 
 * @param status
 */
public void battleEnd() {
	Pipeline pipeline = JedisFactory.getJedis().pipelined();
	
	Collection<BattleUser> battleUsers = battleUserMap.values();
	
	for (Iterator<BattleUser> iterator = battleUsers.iterator(); iterator.hasNext();) {
		BattleUser battleUser = iterator.next();
		if ( !battleUser.isLeaveBattle() ) {
			pipeline.hdel(battleUser.getUserSessionKey().toString(), BATTLE_SERVER_KEY);
			pipeline.hdel(battleUser.getUserSessionKey().toString(), BATTLE_SESSION_KEY);
		}
	}
	
	pipeline.sync();

}
 
开发者ID:wangqi,项目名称:gameserver,代码行数:23,代码来源:Battle.java

示例3: deleteFile

import redis.clients.jedis.Pipeline; //导入方法依赖的package包/类
@Override
public void deleteFile(String fileLengthKey, String fileDataKey, String field, long blockSize) {
    Jedis jedis = openJedis();
    Pipeline pipelined = jedis.pipelined();
    //delete file length
    pipelined.hdel(fileLengthKey.getBytes(), field.getBytes());
    //delete file content
    for (int i = 0; i < blockSize; i++) {
        byte[] blockName = getBlockName(field, i);
        pipelined.hdel(fileDataKey.getBytes(), blockName);
    }
    pipelined.sync();
    jedis.close();
}
 
开发者ID:shijiebei2009,项目名称:RedisDirectory,代码行数:15,代码来源:JedisStream.java

示例4: doOrderNotSafe

import redis.clients.jedis.Pipeline; //导入方法依赖的package包/类
/**
 * 当无竞争情况时下单
 *
 * @param bracketMap bracket
 * @param jedis      redis连接
 */
public void doOrderNotSafe(Map<String, String> bracketMap, String userId, String bracketId, Jedis jedis) {
    int size = bracketMap.size();
    String sha;
    if (this.scriptSHA.get(size) == null) {
        StringBuilder updateBuilder = new StringBuilder();
        for (int i = 1; i <= size; i++) {
            updateBuilder.append(" redis.call('decrby',KEYS[").append(i).append("],ARGV[").append(i).append("])");
        }
        sha = jedis.scriptLoad(updateBuilder.substring(1));
        this.scriptSHA.put(3 + size, sha);
    } else {
        sha = this.scriptSHA.get(3 + size);
    }
    List<String> keyList = new ArrayList<>();
    List<String> paramList = new ArrayList<>();

    for (String key : bracketMap.keySet()) {
        keyList.add(Const.FOOD_STOCKS + key);
        paramList.add(bracketMap.get(key));
    }
    Pipeline pipeline = jedis.pipelined();
    pipeline.evalsha(sha, keyList, paramList);
    pipeline.hdel(Const.BRACKET_ID_BUFFER, bracketId);
    pipeline.hset(Const.ORDER_ID_BUFFER, userId, bracketId);
    pipeline.sync();
}
 
开发者ID:WhiteBlue,项目名称:eleme-hackathon,代码行数:33,代码来源:CoreService.java

示例5: cleanUpPlayer

import redis.clients.jedis.Pipeline; //导入方法依赖的package包/类
public static void cleanUpPlayer(String player, Pipeline rsc) {
    rsc.srem("proxy:" + RedisBungee.getApi().getServerId() + ":usersOnline", player);
    rsc.hdel("player:" + player, "server", "ip", "proxy");
    long timestamp = System.currentTimeMillis();
    rsc.hset("player:" + player, "online", String.valueOf(timestamp));
    rsc.publish("redisbungee-data", RedisBungee.getGson().toJson(new DataManager.DataManagerMessage<>(
            UUID.fromString(player), DataManager.DataManagerMessage.Action.LEAVE,
            new DataManager.LogoutPayload(timestamp))));
}
 
开发者ID:minecrafter,项目名称:RedisBungee,代码行数:10,代码来源:RedisUtil.java

示例6: invalidate

import redis.clients.jedis.Pipeline; //导入方法依赖的package包/类
private void invalidate(Pipeline pipeline, KeyType key) {
    String itemKey = itemKey(key);
    pipeline.hdel(cacheKey, itemKey);
    pipeline.sadd(cacheMissingKey(), keyTypeSerializationHelper.encode(key));
}
 
开发者ID:lithiumtech,项目名称:rdbi,代码行数:6,代码来源:RedisHashCache.java


注:本文中的redis.clients.jedis.Pipeline.hdel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。