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

OpenRefine / OpenRefine / 23477982915

24 Mar 2026 07:26AM UTC coverage: 71.072% (+20.3%) from 50.749%
23477982915

Pull #7729

github

web-flow
Merge 34a4cd793 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 58 new or added lines in 3 files covered. (41.38%)

10041 of 13420 relevant lines covered (74.82%)

3.9 hits per line

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

37.5
/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
                result.put("stage", process.getClusterer().getStage());
×
NEW
48
                respondJSON(response, result);
×
NEW
49
            } else {
×
50
                // Pending (queued but not started)
NEW
51
                ObjectNode result = ParsingUtilities.mapper.createObjectNode();
×
NEW
52
                result.put("status", "pending");
×
NEW
53
                result.put("progress", 0);
×
NEW
54
                respondJSON(response, result);
×
55
            }
NEW
56
        } catch (Exception e) {
×
NEW
57
            respondException(response, e);
×
58
        }
1✔
59
    }
1✔
60
}
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