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

OpenRefine / OpenRefine / 23475931655

24 Mar 2026 06:16AM UTC coverage: 71.076% (+20.3%) from 50.749%
23475931655

Pull #7729

github

web-flow
Merge 6d1de176b into b114f52dc
Pull Request #7729: Make clustering operations cancellable with progress feedback

3472 of 5593 branches covered (62.08%)

Branch coverage included in aggregate %.

24 of 57 new or added lines in 3 files covered. (42.11%)

10041 of 13419 relevant lines covered (74.83%)

3.9 hits per line

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

38.46
/main/src/com/google/refine/commands/browsing/GetClusteringStatusCommand.java
1

2
package com.google.refine.commands.browsing;
3

4
import java.io.IOException;
5

6
import javax.servlet.ServletException;
7
import javax.servlet.http.HttpServletRequest;
8
import javax.servlet.http.HttpServletResponse;
9

10
import com.fasterxml.jackson.databind.node.ObjectNode;
11

12
import com.google.refine.clustering.ClusteringProcess;
13
import com.google.refine.commands.Command;
14
import com.google.refine.model.Project;
15
import com.google.refine.util.ParsingUtilities;
16

17
public class GetClusteringStatusCommand extends Command {
3✔
18

19
    @Override
20
    public void doGet(HttpServletRequest request, HttpServletResponse response)
21
            throws ServletException, IOException {
22
        try {
23
            Project project = getProject(request);
4✔
24
            ClusteringProcess process = ComputeClustersCommand.getActiveProcess(project.id);
4✔
25

26
            if (process == null) {
2!
NEW
27
                ObjectNode result = ParsingUtilities.mapper.createObjectNode();
×
NEW
28
                result.put("status", "idle");
×
NEW
29
                respondJSON(response, result);
×
NEW
30
                return;
×
31
            }
32

33
            process.updateProgress();
2✔
34

35
            if (process.isFailed()) {
3!
NEW
36
                ObjectNode result = ParsingUtilities.mapper.createObjectNode();
×
NEW
37
                result.put("status", "error");
×
NEW
38
                respondJSON(response, result);
×
39
            } else if (process.isCompleted()) {
3!
40
                respondJSON(response, ParsingUtilities.mapper.createObjectNode()
7✔
41
                        .put("status", "done")
4✔
42
                        .set("clusters", ParsingUtilities.mapper.valueToTree(process.getClusterer())));
3✔
NEW
43
            } else if (process.isRunning()) {
×
NEW
44
                ObjectNode result = ParsingUtilities.mapper.createObjectNode();
×
NEW
45
                result.put("status", "running");
×
NEW
46
                result.put("progress", process.getClusterer().getProgress());
×
NEW
47
                respondJSON(response, result);
×
NEW
48
            } else {
×
49
                // Pending (queued but not started)
NEW
50
                ObjectNode result = ParsingUtilities.mapper.createObjectNode();
×
NEW
51
                result.put("status", "pending");
×
NEW
52
                result.put("progress", 0);
×
NEW
53
                respondJSON(response, result);
×
54
            }
NEW
55
        } catch (Exception e) {
×
NEW
56
            respondException(response, e);
×
57
        }
1✔
58
    }
1✔
59
}
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