Skip to content

Commit

Permalink
Merge pull request apache#2470 from rasahner/IT_killFalse
Browse files Browse the repository at this point in the history
integration-tests: stop using kill=false to disable segments
  • Loading branch information
fjy committed Feb 16, 2016
2 parents e60fc1b + 34b143a commit 5364aa5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,30 @@ public boolean areSegmentsLoaded(String dataSource)

public void unloadSegmentsForDataSource(String dataSource, Interval interval)
{
killDataSource(dataSource, false, interval);
try {
makeRequest(
HttpMethod.DELETE,
String.format(
"%sdatasources/%s",
getCoordinatorURL(),
dataSource
)
);
}
catch (Exception e) {
throw Throwables.propagate(e);
}
}

public void deleteSegmentsDataSource(String dataSource, Interval interval)
{
killDataSource(dataSource, true, interval);
}

private void killDataSource(String dataSource, boolean kill, Interval interval)
{
try {
makeRequest(
HttpMethod.DELETE,
String.format(
"%sdatasources/%s/intervals/%s?kill=%s",
"%sdatasources/%s/intervals/%s?kill=true",
getCoordinatorURL(),
dataSource, interval.toString().replace("/", "_"), kill
dataSource, interval.toString().replace("/", "_")
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public Boolean call() throws Exception
}

@AfterClass
public void afterClass()
public void afterClass() throws Exception
{
LOG.info("teardown");

Expand All @@ -285,12 +285,7 @@ public void afterClass()

// remove segments
if (segmentsExist) {
try {
unloadAndKillData(DATASOURCE);
}
catch (Exception e) {
LOG.warn("exception while removing segments: [%s]", e.getMessage());
}
}
}
}
Expand Down

0 comments on commit 5364aa5

Please sign in to comment.