Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
priyen-stripe committed Jul 26, 2023
1 parent ee0fa5a commit 38160a4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,13 @@ public boolean isMutableSegment() {
}
// We consider fields whose values have a fixed size to be fixed width fields.
FieldSpec.DataType storedType = fieldSpec.getDataType().getStoredType();
boolean isFieldFixed = (storedType.isFixedWidth() || (
(storedType.getStoredType() == BYTES || storedType.getStoredType() == BIG_DECIMAL) && fixedByteSize > 0 && consumingAggregatedMetric)
boolean isFieldFixed = (
storedType.isFixedWidth()
|| (
(storedType.getStoredType() == BYTES
|| storedType.getStoredType() == BIG_DECIMAL
) && fixedByteSize > 0 && consumingAggregatedMetric
)
);

FieldIndexConfigs indexConfigs = Optional.ofNullable(config.getIndexConfigByCol().get(column))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ public byte[] getBytes(int docId) {

@Override
public void setBytes(int docId, byte[] value) {
Preconditions.checkArgument(value.length == _valueSizeInBytes, "Expected value size to be: %s but got: %s ", _valueSizeInBytes, value.length);
Preconditions.checkArgument(
value.length == _valueSizeInBytes,
"Expected value size to be: %s but got: %s ",
_valueSizeInBytes, value.length
);

addBufferIfNeeded(docId);
getWriterForRow(docId).setBytes(docId, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ public static int byteSize(HyperLogLog value) {
public static int byteSize(int log2m) {
return (RegisterSet.getSizeForCount(1 << log2m) + 2) * Integer.BYTES;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public void testByteSizeWithHLLObject() {
int[] testCases = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
for (int log2m : testCases) {
int expectedByteSize = (RegisterSet.getSizeForCount(1 << log2m) + 2) * Integer.BYTES;
assertEquals(HyperLogLogUtils.byteSize(new com.clearspring.analytics.stream.cardinality.HyperLogLog(log2m)), expectedByteSize);
assertEquals(
HyperLogLogUtils.byteSize(new com.clearspring.analytics.stream.cardinality.HyperLogLog(log2m)),
expectedByteSize
);
}
}
}

0 comments on commit 38160a4

Please sign in to comment.