use of org.apache.druid.testing.clients.TaskResponseObject in project druid by druid-io.
the class AbstractIndexerTest method unloadAndKillData.
protected void unloadAndKillData(final String dataSource) {
// Get all failed task logs
List<TaskResponseObject> allTasks = indexer.getCompleteTasksForDataSource(dataSource);
for (TaskResponseObject task : allTasks) {
if (task.getStatus().isFailure()) {
LOG.info("------- START Found failed task logging for taskId=" + task.getId() + " -------");
LOG.info("Start failed task log:");
LOG.info(indexer.getTaskLog(task.getId()));
LOG.info("End failed task log.");
LOG.info("Start failed task errorMsg:");
LOG.info(indexer.getTaskErrorMessage(task.getId()));
LOG.info("End failed task errorMsg.");
LOG.info("------- END Found failed task logging for taskId=" + task.getId() + " -------");
}
}
List<String> intervals = coordinator.getSegmentIntervals(dataSource);
// each element in intervals has this form:
// 2015-12-01T23:15:00.000Z/2015-12-01T23:16:00.000Z
// we'll sort the list (ISO dates have lexicographic order)
// then delete segments from the 1st date in the first string
// to the 2nd date in the last string
Collections.sort(intervals);
String first = intervals.get(0).split("/")[0];
String last = intervals.get(intervals.size() - 1).split("/")[1];
unloadAndKillData(dataSource, first, last);
}
Aggregations