Java Code Examples for io.lettuce.core.api.sync.RedisCommands#del()

The following examples show how to use io.lettuce.core.api.sync.RedisCommands#del() . 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: StandaloneRedisDataSourceTest.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 5 votes vote down vote up
@Test
public void testInitAndParseFlowRuleSuccess() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    String value = stringRedisCommands.get(ruleKey);
    List<FlowRule> flowRules = buildFlowConfigParser().convert(value);
    Assert.assertEquals(flowRules.size(), 1);
    stringRedisCommands.del(ruleKey);
}
 
Example 2
Source File: StandaloneRedisDataSourceTest.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 5 votes vote down vote up
@Test
public void testReadResourceFail() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    stringRedisCommands.del(ruleKey);
    String value = stringRedisCommands.get(ruleKey);
    Assert.assertNull(value);
}
 
Example 3
Source File: StandaloneRedisDataSourceTest.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 5 votes vote down vote up
@After
public void clearResource() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    stringRedisCommands.del(ruleKey);
    client.shutdown();
    server.stop();
    server = null;
}
 
Example 4
Source File: StandaloneRedisDataSourceTest.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
@Test
public void testInitAndParseFlowRuleSuccess() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    String value = stringRedisCommands.get(ruleKey);
    List<FlowRule> flowRules = buildFlowConfigParser().convert(value);
    Assert.assertEquals(flowRules.size(), 1);
    stringRedisCommands.del(ruleKey);
}
 
Example 5
Source File: StandaloneRedisDataSourceTest.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
@Test
public void testReadResourceFail() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    stringRedisCommands.del(ruleKey);
    String value = stringRedisCommands.get(ruleKey);
    Assert.assertNull(value);
}
 
Example 6
Source File: StandaloneRedisDataSourceTest.java    From Sentinel with Apache License 2.0 5 votes vote down vote up
@After
public void clearResource() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    stringRedisCommands.del(ruleKey);
    client.shutdown();
    server.stop();
    server = null;
}
 
Example 7
Source File: HashEntry.java    From Arraybot with Apache License 2.0 5 votes vote down vote up
/**
 * Deletes the specific entry.
 * @param guild The ID of the guild.
 * @param key The entry key. This can be null.
 */
public final void deleteSingleEntry(long guild, Object key) {
    RedisCommands resource = redis.getResource();
    resource.del(UDatabase.getKey(category, guild, key));
    Category parentCategory = getParent();
    if(parentCategory == null) {
        return;
    }
    SetEntry parent = (SetEntry) parentCategory.getEntry();
    parent.remove(guild, key);
}
 
Example 8
Source File: HashEntry.java    From Arraybot with Apache License 2.0 5 votes vote down vote up
/**
 * Deletes everything corresponding to the ID.
 * @param id The ID.
 */
@Override
public final void deleteGuild(long id) {
    RedisCommands resource = redis.getResource();
    Category parentCategory = getParent();
    if(parentCategory == null) {
        resource.del(UDatabase.getKey(category, id));
        return;
    }
    SetEntry parent = (SetEntry) parentCategory.getEntry();
    for(String key : parent.values(id)) {
        resource.del(UDatabase.getKey(category, id, key));
    }
    parent.internalDelete(id);
}
 
Example 9
Source File: RedisBackedSessionMap.java    From selenium with Apache License 2.0 5 votes vote down vote up
@Override
public void remove(SessionId id) {
  Require.nonNull("Session ID", id);

  RedisCommands<String, String> commands = connection.sync();

  commands.del(uriKey(id), capabilitiesKey(id));
}
 
Example 10
Source File: SentinelModeRedisDataSourceTest.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 4 votes vote down vote up
@After
public void clearResource() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    stringRedisCommands.del(ruleKey);
    client.shutdown();
}
 
Example 11
Source File: SentinelModeRedisDataSourceTest.java    From Sentinel with Apache License 2.0 4 votes vote down vote up
@After
public void clearResource() {
    RedisCommands<String, String> stringRedisCommands = client.connect().sync();
    stringRedisCommands.del(ruleKey);
    client.shutdown();
}
 
Example 12
Source File: SetEntry.java    From Arraybot with Apache License 2.0 4 votes vote down vote up
/**
 * Actually deletes the guild.
 * @param id The guild ID.
 */
void internalDelete(long id) {
    RedisCommands resource = redis.getResource();
    resource.del(UDatabase.getKey(category, id));
}