當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。