Skip to content

Commit

Permalink
apply spotless task
Browse files Browse the repository at this point in the history
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
  • Loading branch information
kaushalmahi12 committed May 16, 2024
1 parent 92f2620 commit 675a105
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,9 @@ private void executeSearch(
);

// Set tenant for this request in the task for tracking the tasks across tenants
Map<String, Object> multiTenantLabels = searchRequest.source().multiTenantLabels();
String tenant = NOT_PROVIDED;
if (multiTenantLabels != null) {
if (searchRequest.source() != null) {
Map<String, Object> multiTenantLabels = searchRequest.source().multiTenantLabels();
tenant = (String) multiTenantLabels.get(MultiTenantLabel.TENANT.name());
}
task.setResourceLimitGroupName(tenant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ public void onFailure(Exception exc) {

private void setTenantInTask(SearchShardTask task, ShardSearchRequest request) {
String tenant = NOT_PROVIDED;
if (request.source().multiTenantLabels() != null) {
if (request.source() != null && request.source().multiTenantLabels() != null) {
tenant = (String) request.source().multiTenantLabels().get(MultiTenantLabel.TENANT.name());
}
task.setResourceLimitGroupName(tenant);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;

public class MultiTenantLabelTest extends AbstractSearchTestCase {
public class MultiTenantLabelTests extends AbstractSearchTestCase {

public void testValidMultiTenantLabel() {
MultiTenantLabel label = MultiTenantLabel.fromName("tenant");
Expand Down

0 comments on commit 675a105

Please sign in to comment.