Skip to content

Commit

Permalink
Remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
skrzypo987 committed Feb 8, 2022
1 parent d33de4f commit 301ff47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ private boolean tryRehash()

// An estimate of how much extra memory is needed before we can go ahead and expand the hash table.
// This includes the new capacity for values, groupIds, and valuesByGroupId as well as the size of the current page
preallocatedMemoryInBytes = (newCapacity - hashCapacity) * (long) (Long.BYTES + Integer.BYTES) + (calculateMaxFill(newCapacity) - maxFill) * Long.BYTES + currentPageSizeInBytes;
preallocatedMemoryInBytes = (newCapacity - hashCapacity) * (long) (Long.BYTES + Integer.BYTES) + (long) (calculateMaxFill(newCapacity) - maxFill) * Long.BYTES + currentPageSizeInBytes;
if (!updateMemory.update()) {
// reserved memory but has exceeded the limit
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ private boolean tryRehash()
// An estimate of how much extra memory is needed before we can go ahead and expand the hash table.
// This includes the new capacity for groupAddressByHash, rawHashByHashPosition, groupIdsByHash, and groupAddressByGroupId as well as the size of the current page
preallocatedMemoryInBytes = (newCapacity - hashCapacity) * (long) (Long.BYTES + Integer.BYTES + Byte.BYTES) +
(calculateMaxFill(newCapacity) - maxFill) * Long.BYTES +
(long) (calculateMaxFill(newCapacity) - maxFill) * Long.BYTES +
currentPageSizeInBytes;
if (!updateMemory.update()) {
// reserved memory but has exceeded the limit
Expand Down Expand Up @@ -428,14 +428,14 @@ private long hashPosition(long sliceAddress)
int sliceIndex = decodeSliceIndex(sliceAddress);
int position = decodePosition(sliceAddress);
if (precomputedHashChannel.isPresent()) {
return getRawHash(sliceIndex, position);
return getRawHash(sliceIndex, position, precomputedHashChannel.getAsInt());
}
return hashStrategy.hashPosition(sliceIndex, position);
}

private long getRawHash(int sliceIndex, int position)
private long getRawHash(int sliceIndex, int position, int hashChannel)
{
return channelBuilders.get(precomputedHashChannel.getAsInt()).get(sliceIndex).getLong(position, 0);
return channelBuilders.get(hashChannel).get(sliceIndex).getLong(position, 0);
}

private boolean positionNotDistinctFromCurrentRow(long address, int hashPosition, int position, Page page, byte rawHash, int[] hashChannels)
Expand Down Expand Up @@ -481,9 +481,7 @@ private Page createPageWithExtractedDictionary(Page page)
blocks[channels[0]] = dictionary;

// extract hash dictionary
if (inputHashChannel.isPresent()) {
blocks[inputHashChannel.get()] = ((DictionaryBlock) page.getBlock(inputHashChannel.get())).getDictionary();
}
inputHashChannel.ifPresent(integer -> blocks[integer] = ((DictionaryBlock) page.getBlock(integer)).getDictionary());

return new Page(dictionary.getPositionCount(), blocks);
}
Expand All @@ -502,19 +500,17 @@ private boolean canProcessDictionary(Page page)
// data channel is dictionary encoded but hash channel is not
return false;
}
if (!((DictionaryBlock) inputHashBlock).getDictionarySourceId().equals(inputDataBlock.getDictionarySourceId())) {
// dictionarySourceIds of data block and hash block do not match
return false;
}
// dictionarySourceIds of data block and hash block do not match
return ((DictionaryBlock) inputHashBlock).getDictionarySourceId().equals(inputDataBlock.getDictionarySourceId());
}

return true;
}

private boolean isRunLengthEncoded(Page page)
{
for (int i = 0; i < channels.length; i++) {
if (!(page.getBlock(channels[i]) instanceof RunLengthEncodedBlock)) {
for (int channel : channels) {
if (!(page.getBlock(channel) instanceof RunLengthEncodedBlock)) {
return false;
}
}
Expand Down

0 comments on commit 301ff47

Please sign in to comment.