Skip to content

Commit 18a7b24

Browse files
committed
Use underscore for unnamed variables in lambda
1 parent 19cee94 commit 18a7b24

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

plugin/trino-resource-group-managers/src/test/java/io/trino/plugin/resourcegroups/db/TestDbResourceGroupConfigurationManager.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void testEnvironments()
8282
dao.insertSelector(2, 2, ".*dev_user.*", null, null, null, null, null, null, null);
8383

8484
// check the prod configuration
85-
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(listener -> {}, new DbResourceGroupConfig(), daoProvider.get(), prodEnvironment);
85+
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(_ -> {}, new DbResourceGroupConfig(), daoProvider.get(), prodEnvironment);
8686
List<ResourceGroupSpec> groups = manager.getRootGroups();
8787
assertThat(groups).hasSize(1);
8888
InternalResourceGroup prodGlobal = new InternalResourceGroup("prod_global", (group, export) -> {}, directExecutor());
@@ -94,7 +94,7 @@ public void testEnvironments()
9494
assertThat(prodResourceGroupId.toString()).isEqualTo("prod_global");
9595

9696
// check the dev configuration
97-
manager = new DbResourceGroupConfigurationManager(listener -> {}, new DbResourceGroupConfig(), daoProvider.get(), devEnvironment);
97+
manager = new DbResourceGroupConfigurationManager(_ -> {}, new DbResourceGroupConfig(), daoProvider.get(), devEnvironment);
9898
assertThat(groups).hasSize(1);
9999
InternalResourceGroup devGlobal = new InternalResourceGroup("dev_global", (group, export) -> {}, directExecutor());
100100
manager.configure(devGlobal, new SelectionContext<>(prodGlobal.getId(), new ResourceGroupIdTemplate("dev_global")));
@@ -118,7 +118,7 @@ public void testConfiguration()
118118
dao.insertResourceGroup(1, "global", "1MB", 1000, 100, 100, "weighted", null, true, "1h", "1d", "1TB", null, ENVIRONMENT);
119119
dao.insertResourceGroup(2, "sub", "2MB", 4, 3, 3, null, 5, null, null, null, "10GB", 1L, ENVIRONMENT);
120120
dao.insertSelector(2, 1, null, null, null, null, null, null, null, null);
121-
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(listener -> {}, new DbResourceGroupConfig(), daoProvider.get(), ENVIRONMENT);
121+
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(_ -> {}, new DbResourceGroupConfig(), daoProvider.get(), ENVIRONMENT);
122122
InternalResourceGroup global = new InternalResourceGroup("global", (group, export) -> {}, directExecutor());
123123
manager.configure(global, new SelectionContext<>(global.getId(), new ResourceGroupIdTemplate("global")));
124124
assertEqualsResourceGroup(global, "1MB", 1000, 100, 100, WEIGHTED, DEFAULT_WEIGHT, true, Duration.ofHours(1), Duration.ofDays(1), "1TB");
@@ -174,7 +174,7 @@ public void testMissing()
174174
dao.insertResourceGroup(2, "sub", "2MB", 4, 3, 3, null, 5, null, null, null, null, 1L, ENVIRONMENT);
175175
dao.insertResourceGroupsGlobalProperties("cpu_quota_period", "1h");
176176
dao.insertSelector(2, 1, null, null, null, null, null, null, null, null);
177-
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(listener -> {}, new DbResourceGroupConfig(), daoProvider.get(), ENVIRONMENT);
177+
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(_ -> {}, new DbResourceGroupConfig(), daoProvider.get(), ENVIRONMENT);
178178
InternalResourceGroup missing = new InternalResourceGroup("missing", (group, export) -> {}, directExecutor());
179179

180180
assertThatThrownBy(() -> manager.configure(missing, new SelectionContext<>(missing.getId(), new ResourceGroupIdTemplate("missing"))))
@@ -197,7 +197,7 @@ public void testReconfig()
197197
dao.insertSelector(2, 1, null, null, null, null, null, null, null, null);
198198
dao.insertResourceGroupsGlobalProperties("cpu_quota_period", "1h");
199199
dao.insertResourceGroupsGlobalProperties("physical_data_scan_quota_period", "1h");
200-
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(listener -> {}, new DbResourceGroupConfig(), daoProvider.get(), ENVIRONMENT);
200+
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(_ -> {}, new DbResourceGroupConfig(), daoProvider.get(), ENVIRONMENT);
201201
manager.start();
202202
InternalResourceGroup global = new InternalResourceGroup("global", (group, export) -> {}, directExecutor());
203203
manager.configure(global, new SelectionContext<>(global.getId(), new ResourceGroupIdTemplate("global")));
@@ -236,13 +236,13 @@ public void testExactMatchSelector()
236236
dao.insertResourceGroupsGlobalProperties("cpu_quota_period", "1h");
237237
DbResourceGroupConfig config = new DbResourceGroupConfig();
238238
config.setExactMatchSelectorEnabled(true);
239-
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(listener -> {}, config, daoProvider.get(), ENVIRONMENT);
239+
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(_ -> {}, config, daoProvider.get(), ENVIRONMENT);
240240
manager.load();
241241
assertThat(manager.getSelectors()).hasSize(2);
242242
assertThat(manager.getSelectors().get(0)).isInstanceOf(DbSourceExactMatchSelector.class);
243243

244244
config.setExactMatchSelectorEnabled(false);
245-
manager = new DbResourceGroupConfigurationManager(listener -> {}, config, daoProvider.get(), ENVIRONMENT);
245+
manager = new DbResourceGroupConfigurationManager(_ -> {}, config, daoProvider.get(), ENVIRONMENT);
246246
manager.load();
247247
assertThat(manager.getSelectors()).hasSize(1);
248248
assertThat(manager.getSelectors().get(0) instanceof DbSourceExactMatchSelector).isFalse();
@@ -275,7 +275,7 @@ public void testSelectorPriority()
275275
expectedUsers.add(user);
276276
}
277277

278-
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(listener -> {}, new DbResourceGroupConfig(), daoProvider.get(), ENVIRONMENT);
278+
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(_ -> {}, new DbResourceGroupConfig(), daoProvider.get(), ENVIRONMENT);
279279
manager.load();
280280

281281
List<ResourceGroupSelector> selectors = manager.getSelectors();
@@ -302,7 +302,7 @@ public void testInvalidConfiguration()
302302
dao.insertResourceGroup(1, "global", "100%", 100, 100, 100, null, null, null, null, null, null, null, ENVIRONMENT);
303303

304304
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(
305-
listener -> {},
305+
_ -> {},
306306
new DbResourceGroupConfig().setMaxRefreshInterval(new io.airlift.units.Duration(2, MILLISECONDS)).setRefreshInterval(new io.airlift.units.Duration(1, MILLISECONDS)),
307307
daoProvider.get(),
308308
ENVIRONMENT);
@@ -322,7 +322,7 @@ public void testRefreshInterval()
322322
dao.insertResourceGroup(1, "global", "100%", 100, 100, 100, null, null, null, null, null, null, null, ENVIRONMENT);
323323

324324
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(
325-
listener -> {},
325+
_ -> {},
326326
new DbResourceGroupConfig().setMaxRefreshInterval(new io.airlift.units.Duration(2, MILLISECONDS)).setRefreshInterval(new io.airlift.units.Duration(1, MILLISECONDS)),
327327
daoProvider.get(),
328328
ENVIRONMENT);
@@ -351,7 +351,7 @@ public void testMatchByUserGroups()
351351
dao.insertSelector(1, 1, null, "first matching|second matching", null, null, null, null, null, null);
352352

353353
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(
354-
listener -> {},
354+
_ -> {},
355355
new DbResourceGroupConfig().setMaxRefreshInterval(new io.airlift.units.Duration(2, MILLISECONDS)).setRefreshInterval(new io.airlift.units.Duration(1, MILLISECONDS)),
356356
daoProvider.get(),
357357
ENVIRONMENT);
@@ -374,7 +374,7 @@ public void testMatchByUsersAndGroups()
374374
dao.insertSelector(1, 1, "Matching user", "Matching group", null, null, null, null, null, null);
375375

376376
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(
377-
listener -> {},
377+
_ -> {},
378378
new DbResourceGroupConfig().setMaxRefreshInterval(new io.airlift.units.Duration(2, MILLISECONDS)).setRefreshInterval(new io.airlift.units.Duration(1, MILLISECONDS)),
379379
daoProvider.get(),
380380
ENVIRONMENT);
@@ -398,7 +398,7 @@ public void testMatchByOriginalUser()
398398
dao.insertSelector(1, 1, null, null, "foo.+", null, null, null, null, null);
399399

400400
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(
401-
listener -> {},
401+
_ -> {},
402402
new DbResourceGroupConfig().setMaxRefreshInterval(new io.airlift.units.Duration(2, MILLISECONDS)).setRefreshInterval(new io.airlift.units.Duration(1, MILLISECONDS)),
403403
daoProvider.get(),
404404
ENVIRONMENT);
@@ -422,7 +422,7 @@ public void testMatchByAuthenticatedUser()
422422
dao.insertSelector(1, 1, null, null, null, "foo.+", null, null, null, null);
423423

424424
DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager(
425-
listener -> {},
425+
_ -> {},
426426
new DbResourceGroupConfig().setMaxRefreshInterval(new io.airlift.units.Duration(2, MILLISECONDS)).setRefreshInterval(new io.airlift.units.Duration(1, MILLISECONDS)),
427427
daoProvider.get(),
428428
ENVIRONMENT);

0 commit comments

Comments
 (0)