Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests for concurrent append and replace #16755

Merged
merged 17 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.druid.indexer.TaskStatusPlus;
import org.apache.druid.indexer.report.IngestionStatsAndErrorsTaskReport;
import org.apache.druid.indexer.report.TaskReport;
import org.apache.druid.indexing.overlord.http.TaskLockResponse;
import org.apache.druid.indexing.overlord.http.TaskPayloadResponse;
import org.apache.druid.indexing.overlord.supervisor.SupervisorStateManager;
import org.apache.druid.java.util.common.ISE;
Expand Down Expand Up @@ -360,6 +361,31 @@ public Map<String, List<Interval>> getLockedIntervals(List<LockFilterPolicy> loc
}
}

public TaskLockResponse getActiveLocks(List<LockFilterPolicy> lockFilterPolicies)
{
try {
String jsonBody = jsonMapper.writeValueAsString(lockFilterPolicies);

StatusResponseHolder response = httpClient.go(
new Request(HttpMethod.POST, new URL(getIndexerURL() + "activeLocks"))
.setContent(
"application/json",
StringUtils.toUtf8(jsonBody)
),
StatusResponseHandler.getInstance()
).get();
return jsonMapper.readValue(
response.getContent(),
new TypeReference<TaskLockResponse>()
{
}
);
}
catch (Exception e) {
throw new RuntimeException(e);
}
}

public void waitUntilTaskCompletes(final String taskID)
{
waitUntilTaskCompletes(taskID, ITRetryUtil.DEFAULT_RETRY_SLEEP, ITRetryUtil.DEFAULT_RETRY_COUNT);
Expand Down
Loading
Loading