Skip to content

Commit

Permalink
HBASE-28621 Fixed checkstyle warnings in PrefixFilter
Browse files Browse the repository at this point in the history
(blocks) NeedBraces: 'if' construct must use '{}'s.
  • Loading branch information
Dávid Paksy authored and PDavid committed Oct 14, 2024
1 parent ad83f40 commit 02ed23a
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,16 @@ public byte[] getPrefix() {

@Override
public boolean filterRowKey(Cell firstRowCell) {
if (firstRowCell == null || this.prefix == null) return true;
if (filterAllRemaining()) return true;
if (firstRowCell == null || this.prefix == null) {
return true;
}
if (filterAllRemaining()) {
return true;
}
int length = firstRowCell.getRowLength();
if (length < prefix.length) return true;
if (length < prefix.length) {
return true;
}
// if they are equal, return false => pass row
// else return true, filter row
// if we are passed the prefix, set flag
Expand Down Expand Up @@ -113,7 +119,9 @@ public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments
@Override
public byte[] toByteArray() {
FilterProtos.PrefixFilter.Builder builder = FilterProtos.PrefixFilter.newBuilder();
if (this.prefix != null) builder.setPrefix(UnsafeByteOperations.unsafeWrap(this.prefix));
if (this.prefix != null) {
builder.setPrefix(UnsafeByteOperations.unsafeWrap(this.prefix));
}
return builder.build().toByteArray();
}

Expand Down

0 comments on commit 02ed23a

Please sign in to comment.