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

leonchen83 / redis-replicator / #2560

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

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

91.67
/src/main/java/com/moilioncircle/redis/replicator/cmd/parser/XAckDelParser.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.XAckDelCommand;
27

28
/**
29
 * @author Baoyi Chen
30
 * @since 3.10.0
31
 */
32
public class XAckDelParser implements CommandParser<XAckDelCommand> {
1✔
33
    
34
    @Override
35
    public XAckDelCommand parse(Object[] command) {
36
        int idx = 1;
1✔
37
        byte[] key = toBytes(command[idx]);
1✔
38
        idx++;
1✔
39
        byte[] group = toBytes(command[idx]);
1✔
40
        idx++;
1✔
41
        DeletionPolicy policy = null;
1✔
42
        byte[][] ids = null;
1✔
43
        for (; idx < command.length; idx++) {
1✔
44
            String token = toRune(command[idx]);
1✔
45
            if (isEquals(token, "KEEPREF")) {
1✔
NEW
46
                policy = DeletionPolicy.KEEPREF;
×
47
            } else if (isEquals(token, "DELREF")) {
1✔
48
                policy = DeletionPolicy.DELREF;
1✔
49
            } else if (isEquals(token, "ACKED")) {
1✔
NEW
50
                policy = DeletionPolicy.ACKED;
×
51
            } else if (isEquals(token, "IDS")) {
1✔
52
                idx++;
1✔
53
                int num = toInt(command[idx]);
1✔
54
                idx++;
1✔
55
                ids = new byte[num][];
1✔
56
                for (int i = 0; i < num; i++, idx++) {
1✔
57
                    ids[i] = toBytes(command[idx]);
1✔
58
                }
59
            }
60
        }
61
        return new XAckDelCommand(key, group, policy, ids);
1✔
62
    }
63
}
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