2121import static org .junit .Assert .assertTrue ;
2222import static org .junit .Assert .fail ;
2323
24- import org .apache .hbase .thirdparty .com .google .common .base .Throwables ;;
2524import java .io .IOException ;
2625import java .util .ArrayList ;
2726import java .util .Arrays ;
5251import org .slf4j .Logger ;
5352import org .slf4j .LoggerFactory ;
5453
54+ import org .apache .hbase .thirdparty .com .google .common .base .Throwables ;
55+
5556@ Category (MediumTests .class )
5657public class TestFiltersWithBinaryComponentComparator {
5758
@@ -153,7 +154,8 @@ public void testRowAndValueFilterWithBinaryComponentComparator() throws IOExcept
153154 ht .close ();
154155 }
155156
156- @ Rule public ExpectedException thrown = ExpectedException .none ();
157+ @ Rule
158+ public ExpectedException thrown = ExpectedException .none ();
157159
158160 @ Test
159161 public void testThrowsExceptionOnOffsetOutOfBounds () {
@@ -162,7 +164,8 @@ public void testThrowsExceptionOnOffsetOutOfBounds() {
162164 byte [] componentValue = new byte [] { (byte ) 'A' };
163165 int offsetValue = 10 ;
164166 byte [] valueTooShortForOffset = new byte [offsetValue ];
165- BinaryComponentComparator comparator = new BinaryComponentComparator (componentValue , offsetValue );
167+ BinaryComponentComparator comparator =
168+ new BinaryComponentComparator (componentValue , offsetValue );
166169 comparator .compareTo (valueTooShortForOffset );
167170 }
168171
@@ -172,13 +175,14 @@ public void testThrowsExceptionOnOffsetOutOfBounds() {
172175 */
173176 @ Test
174177 public void testOutOfBoundsExceptionIsNotRetryable () throws IOException {
175- Table table = TEST_UTIL .createTable (TableName .valueOf (name .getMethodName ()), family , Integer .MAX_VALUE );
178+ Table table =
179+ TEST_UTIL .createTable (TableName .valueOf (name .getMethodName ()), family , Integer .MAX_VALUE );
176180
177181 // ColumnValueFilter with BinaryComponentComparator with offset 10
178182 int offsetValue = 10 ;
179183 BinaryComponentComparator comparator = new BinaryComponentComparator (new byte [1 ], offsetValue );
180- ColumnValueFilter columnValueFilter = new ColumnValueFilter (
181- family , qf , CompareOperator .EQUAL , comparator );
184+ ColumnValueFilter columnValueFilter =
185+ new ColumnValueFilter ( family , qf , CompareOperator .EQUAL , comparator );
182186 Scan scan = new Scan ().setFilter (columnValueFilter );
183187
184188 // Insert a row with column value length >= comparator offset
@@ -190,12 +194,12 @@ public void testOutOfBoundsExceptionIsNotRetryable() throws IOException {
190194
191195 // Scan should throw DoNotRetryIOException due to incompatible value length
192196 try (ResultScanner scanner = table .getScanner (scan )) {
193- scanner .iterator ().forEachRemaining (result -> {});
197+ scanner .iterator ().forEachRemaining (result -> {
198+ });
194199 fail ("Scan completed successfully but should have failed" );
195- }
196- catch (Exception e ) {
197- boolean expectedExceptionFound = Throwables .getCausalChain (e ).stream ()
198- .anyMatch (DoNotRetryIOException .class ::isInstance );
200+ } catch (Exception e ) {
201+ boolean expectedExceptionFound =
202+ Throwables .getCausalChain (e ).stream ().anyMatch (DoNotRetryIOException .class ::isInstance );
199203 if (!expectedExceptionFound ) {
200204 fail ("Expected DoNotRetryIOException as the cause, but got: " + e .getCause ());
201205 }
0 commit comments