11/*
2- * Licensed to the Apache Software Foundation (ASF) under one
3- * or more contributor license agreements. See the NOTICE file
4- * distributed with this work for additional information
5- * regarding copyright ownership. The ASF licenses this file
6- * to you under the Apache License, Version 2.0 (the
7- * "License"); you may not use this file except in compliance
8- * with the License. You may obtain a copy of the License at
9- *
10- * http://www.apache.org/licenses/LICENSE-2.0
11- *
12- * Unless required by applicable law or agreed to in writing,
13- * software distributed under the License is distributed on an
14- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15- * KIND, either express or implied. See the License for the
16- * specific language governing permissions and limitations
17- * under the License.
18- */
2+ * Licensed to the Apache Software Foundation (ASF) under one
3+ * or more contributor license agreements. See the NOTICE file
4+ * distributed with this work for additional information
5+ * regarding copyright ownership. The ASF licenses this file
6+ * to you under the Apache License, Version 2.0 (the
7+ * "License"); you may not use this file except in compliance
8+ * with the License. You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing,
13+ * software distributed under the License is distributed on an
14+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ * KIND, either express or implied. See the License for the
16+ * specific language governing permissions and limitations
17+ * under the License.
18+ */
1919package org .apache .cassandra .service ;
2020
2121import java .net .UnknownHostException ;
4040import org .apache .cassandra .service .disk .usage .DiskUsageMonitor ;
4141import org .apache .cassandra .utils .TimeUUID ;
4242import org .apache .cassandra .utils .concurrent .Condition ;
43+
4344import org .junit .Assert ;
4445import org .junit .Before ;
4546import org .junit .BeforeClass ;
@@ -229,12 +230,12 @@ public void testGetNeighborsTimesTwoInSpecifiedHosts() throws Throwable
229230 }
230231
231232 expected .remove (FBUtilities .getBroadcastAddressAndPort ());
232- Collection <String > hosts = Arrays .asList (FBUtilities .getBroadcastAddressAndPort ().getHostAddressAndPort (),expected .get (0 ).getHostAddressAndPort ());
233+ Collection <String > hosts = Arrays .asList (FBUtilities .getBroadcastAddressAndPort ().getHostAddressAndPort (), expected .get (0 ).getHostAddressAndPort ());
233234 Iterable <Range <Token >> ranges = StorageService .instance .getLocalReplicas (KEYSPACE5 ).ranges ();
234235
235236 assertEquals (expected .get (0 ), ActiveRepairService .instance ().getNeighbors (KEYSPACE5 , ranges ,
236- ranges .iterator ().next (),
237- null , hosts ).endpoints ().iterator ().next ());
237+ ranges .iterator ().next (),
238+ null , hosts ).endpoints ().iterator ().next ());
238239 }
239240
240241 @ Test (expected = IllegalArgumentException .class )
@@ -264,7 +265,6 @@ public void testParentRepairStatus() throws Throwable
264265 List <String > failed = StorageService .instance .getParentRepairStatus (3 );
265266 assertNotNull (failed );
266267 assertEquals (ActiveRepairService .ParentRepairStatus .FAILED , ActiveRepairService .ParentRepairStatus .valueOf (failed .get (0 )));
267-
268268 }
269269
270270 Set <InetAddressAndPort > addTokens (int max ) throws Throwable
@@ -339,10 +339,10 @@ private static RepairOption opts(String... params)
339339 {
340340 assert params .length % 2 == 0 : "unbalanced key value pairs" ;
341341 Map <String , String > opt = new HashMap <>();
342- for (int i = 0 ; i < (params .length >> 1 ); i ++)
342+ for (int i = 0 ; i < (params .length >> 1 ); i ++)
343343 {
344344 int idx = i << 1 ;
345- opt .put (params [idx ], params [idx + 1 ]);
345+ opt .put (params [idx ], params [idx + 1 ]);
346346 }
347347 return RepairOption .parse (opt , DatabaseDescriptor .getPartitioner ());
348348 }
@@ -362,19 +362,19 @@ public void repairedAt() throws Exception
362362 Assert .assertNotEquals (UNREPAIRED_SSTABLE , ActiveRepairService .instance ().getRepairedAt (opts (INCREMENTAL_KEY , b2s (true )), false ));
363363 // subrange incremental repair
364364 Assert .assertNotEquals (UNREPAIRED_SSTABLE , ActiveRepairService .instance ().getRepairedAt (opts (INCREMENTAL_KEY , b2s (true ),
365- RANGES_KEY , "1:2" ), false ));
365+ RANGES_KEY , "1:2" ), false ));
366366
367367 // hosts incremental repair
368368 Assert .assertEquals (UNREPAIRED_SSTABLE , ActiveRepairService .instance ().getRepairedAt (opts (INCREMENTAL_KEY , b2s (true ),
369- HOSTS_KEY , "127.0.0.1" ), false ));
369+ HOSTS_KEY , "127.0.0.1" ), false ));
370370 // dc incremental repair
371371 Assert .assertEquals (UNREPAIRED_SSTABLE , ActiveRepairService .instance ().getRepairedAt (opts (INCREMENTAL_KEY , b2s (true ),
372- DATACENTERS_KEY , "DC2" ), false ));
372+ DATACENTERS_KEY , "DC2" ), false ));
373373 // forced incremental repair
374374 Assert .assertNotEquals (UNREPAIRED_SSTABLE , ActiveRepairService .instance ().getRepairedAt (opts (INCREMENTAL_KEY , b2s (true ),
375- FORCE_REPAIR_KEY , b2s (true )), false ));
375+ FORCE_REPAIR_KEY , b2s (true )), false ));
376376 Assert .assertEquals (UNREPAIRED_SSTABLE , ActiveRepairService .instance ().getRepairedAt (opts (INCREMENTAL_KEY , b2s (true ),
377- FORCE_REPAIR_KEY , b2s (true )), true ));
377+ FORCE_REPAIR_KEY , b2s (true )), true ));
378378
379379 // full repair
380380 Assert .assertEquals (UNREPAIRED_SSTABLE , ActiveRepairService .instance ().getRepairedAt (opts (INCREMENTAL_KEY , b2s (false )), false ));
@@ -420,7 +420,8 @@ public void testRejectWhenPoolFullStrategy() throws InterruptedException
420420
421421 // Submission is unblocked
422422 Thread .sleep (250 );
423- validationExecutor .submit (() -> {});
423+ validationExecutor .submit (() -> {
424+ });
424425 }
425426 finally
426427 {
@@ -457,8 +458,8 @@ public void testQueueWhenPoolFullStrategy() throws InterruptedException
457458 allSubmitted .await (TASK_SECONDS + 1 , TimeUnit .SECONDS );
458459
459460 // Give the tasks we expect to execute immediately chance to be scheduled
460- Util .spinAssertEquals (2 , ((ExecutorPlus ) validationExecutor )::getActiveTaskCount , 1 );
461- Util .spinAssertEquals (3 , ((ExecutorPlus ) validationExecutor )::getPendingTaskCount , 1 );
461+ Util .spinAssertEquals (2 , ((ExecutorPlus ) validationExecutor )::getActiveTaskCount , 1 );
462+ Util .spinAssertEquals (3 , ((ExecutorPlus ) validationExecutor )::getPendingTaskCount , 1 );
462463
463464 // verify that we've reached a steady state with 2 threads actively processing and 3 queued tasks
464465 Assert .assertEquals (2 , ((ExecutorPlus ) validationExecutor ).getActiveTaskCount ());
0 commit comments