Skip to content

Conversation

@jonmeredith
Copy link
Contributor

belliottsmith and others added 3 commits March 1, 2023 14:53
Comment on lines 232 to 259
// Create the initial row to populate the partition with
Row.Builder initialRowBuilder = BTreeRow.unsortedBuilder();
initialRowBuilder.newRow(regular.isStatic() ? Clustering.STATIC_CLUSTERING : Clustering.EMPTY);

initialRowBuilder.addCell(makeCell(regular, initialTS, initialTTL, initialLDT, initialValueBB, null));
if (initialComplexDeletionTime != DeletionTime.LIVE)
initialRowBuilder.addComplexDeletion(complex, initialComplexDeletionTime);
int cellPath = 1000;
for (int i = 0; i < numC2InitialCells; i++)
initialRowBuilder.addCell(makeCell(complex, initialTS, initialTTL, initialLDT,
ByteBufferUtil.EMPTY_BYTE_BUFFER,
CellPath.create(ByteBufferUtil.bytes(cellPath--))));
Row initialRow = initialRowBuilder.build();

// Create the update row to modify the partition with
Row.Builder updateRowBuilder = BTreeRow.unsortedBuilder();
updateRowBuilder.newRow(regular.isStatic() ? Clustering.STATIC_CLUSTERING : Clustering.EMPTY);

updateRowBuilder.addCell(makeCell(regular, updateTS, updateTTL, updateLDT, updateValueBB, null));
if (updateComplexDeletionTime != DeletionTime.LIVE)
updateRowBuilder.addComplexDeletion(complex, updateComplexDeletionTime);

// Make multiple update cells to make any issues more pronounced
cellPath = 1000;
for (int i = 0; i < numC2UpdateCells; i++)
updateRowBuilder.addCell(makeCell(complex, updateTS, updateTTL, updateLDT,
ByteBufferUtil.EMPTY_BYTE_BUFFER,
CellPath.create(ByteBufferUtil.bytes(cellPath++))));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@blerer 79f46d2#r102899481

nits: It seems that the 2 blocks are the same if I am not mistaken. They could be refactored as a method

The difference is the direction the cellPaths go to make some distinct and some overlapping elements. It could be factored out but felt like a lot more passing settings around.


public long offHeapSize()
{
long size = simpleSize(MemoryUtil.getInt(peer + LENGTH));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@blerer 79f46d2#r102910076

This simpleSize name is really confusing. I think we should inline the method. It would be much clearer.

Also used in the constructor so want to keep it DRY. Could rename to offHeapSizeWithoutCellPath?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it sounds much better.

return new BufferCell(column, timestamp, ttl, localDeletionTime, value, path);
}

void testCase(int initialTS, int initialTTL, int initialLDT, DeletionTime initialCDT, int numC2InitialCells,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@blerer 79f46d2#r102899871

nit: Would it not be more readable to have some object to bundle all those information together.

<exclusion groupId="org.codehaus.jackson" artifactId="jackson-mapper-asl"/>
</dependency>
<dependency groupId="net.java.dev.jna" artifactId="jna" version="5.6.0"/>
<dependency groupId="net.java.dev.jna" artifactId="jna" version="5.13.0"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will drop this from the patch - accidentally committed

Copy link
Contributor

Choose a reason for hiding this comment

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

I wanted to ask about it.

@jonmeredith
Copy link
Contributor Author

Merged.

@jonmeredith jonmeredith closed this Mar 7, 2023
@jonmeredith jonmeredith deleted the c18125-repro-4.0 branch April 22, 2025 22:23
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.

3 participants