Skip to content

Oak v02#2

Open
sanastas wants to merge 2 commits intomasterfrom
OAK_V01
Open

Oak v02#2
sanastas wants to merge 2 commits intomasterfrom
OAK_V01

Conversation

@sanastas
Copy link
Owner

@sanastas sanastas commented Jul 8, 2018

Creating one more pull request, again for internal review only. Thanks @galisheffi !

package io.druid.segment.incremental;


public abstract class InternalDataIncrementalIndex<AggregatorType> extends IncrementalIndex<AggregatorType>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we enlarge the scope of this class? Is there something in OffheapOakIncrementalIndex that can between shared between off-heap and on-heap and moved here?

maxAggregatorIntermediateSize += Arrays.stream(incrementalIndexSchema.getMetrics())
.mapToLong(aggregator -> aggregator.getMaxIntermediateSize() + Long.BYTES * 2)
.sum();
.mapToLong(aggregator -> aggregator.getMaxIntermediateSize() + Long.BYTES * 2)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general there are many TABs distance changes between master and this version of the code... I wounder whether we will be asked to change it later, as not following the existing coding conventions?

new OffheapOakCreateKeyConsumer(dimensionDescsList),
new OffheapOakKeyCapacityCalculator(dimensionDescsList),
chunkMaxItems,
chunkBytesPerItem);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not so related to Druid, but why the size of the chunk need to be provided here? This need to be configurable, but doesn't look reasonable to be part of constructor... ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually both chunkMaxItems and chunkBytesPerItem looks to me weird to be provided in constructor. It should be eliminated from the Oak Constructor and we should give user other ways to influence the defauklt (if needed).

public Row apply(@Nullable Map.Entry<ByteBuffer, ByteBuffer> entry)
{
IncrementalIndexRow key = incrementalIndexRowDeserialization(entry.getKey());
ByteBuffer value = entry.getValue();
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it return ReadOnly ByteBuffer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments