• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

leonchen83 / redis-replicator / #2561

11 Oct 2025 04:54AM UTC coverage: 72.201% (+0.04%) from 72.164%
#2561

push

chenby
redis-8.2

60 of 78 new or added lines in 5 files covered. (76.92%)

7241 of 10029 relevant lines covered (72.2%)

0.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/src/main/java/com/moilioncircle/redis/replicator/cmd/parser/XDelExParser.java
1
/*
2
 * Copyright 2016-2017 Leon Chen
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.moilioncircle.redis.replicator.cmd.parser;
18

19
import static com.moilioncircle.redis.replicator.cmd.CommandParsers.toBytes;
20
import static com.moilioncircle.redis.replicator.cmd.CommandParsers.toInt;
21
import static com.moilioncircle.redis.replicator.cmd.CommandParsers.toRune;
22
import static com.moilioncircle.redis.replicator.util.Strings.isEquals;
23

24
import com.moilioncircle.redis.replicator.cmd.CommandParser;
25
import com.moilioncircle.redis.replicator.cmd.impl.DeletionPolicy;
26
import com.moilioncircle.redis.replicator.cmd.impl.XDelExCommand;
27

28
/**
29
 * @author Baoyi Chen
30
 * @since 3.10.0
31
 */
32
public class XDelExParser implements CommandParser<XDelExCommand> {
1✔
33
    
34
    @Override
35
    public XDelExCommand parse(Object[] command) {
36
        int idx = 1;
1✔
37
        byte[] key = toBytes(command[idx]);
1✔
38
        idx++;
1✔
39
        DeletionPolicy policy = null;
1✔
40
        byte[][] ids = null;
1✔
41
        for (; idx < command.length; idx++) {
1✔
42
            String token = toRune(command[idx]);
1✔
43
            if (isEquals(token, "KEEPREF")) {
1✔
NEW
44
                policy = DeletionPolicy.KEEPREF;
×
45
            } else if (isEquals(token, "DELREF")) {
1✔
NEW
46
                policy = DeletionPolicy.DELREF;
×
47
            } else if (isEquals(token, "ACKED")) {
1✔
48
                policy = DeletionPolicy.ACKED;
1✔
49
            } else if (isEquals(token, "IDS")) {
1✔
50
                idx++;
1✔
51
                int num = toInt(command[idx]);
1✔
52
                idx++;
1✔
53
                ids = new byte[num][];
1✔
54
                for (int i = 0; i < num; i++, idx++) {
1✔
55
                    ids[i] = toBytes(command[idx]);
1✔
56
                }
57
            }
58
        }
59
        return new XDelExCommand(key, policy, ids);
1✔
60
    }
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc