somandal commented on code in PR #9982:
URL: https://github.com/apache/pinot/pull/9982#discussion_r1048889338
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/BaseIndexHandler.java:
##########
@@ -93,6 +100,24 @@ protected void
createForwardIndexIfNeeded(SegmentDirectory.Writer segmentWriter,
_tmpForwardIndexColumns.add(columnName);
}
+ // Update the segmentMetadata
+ File indexDir = _segmentMetadata.getIndexDir();
Review Comment:
That won't solve the issue where `_segmentMetadata` assigned inside the
class won't reflect the new object outside the class :(
The problem is even if I make your suggested change, I'll have to do the
following:
```
public static SegmentMetadata updateMetadataProperties(SegmentMetadata
segmentMetadata, Map<String,
String> metadataProperties, File indexDir, SegmentDirectory
segmentDirectory)
throws IOException {
PropertiesConfiguration propertiesConfiguration =
SegmentMetadataUtils.getPropertiesConfiguration(segmentMetadata);
for (Map.Entry<String, String> entry : metadataProperties.entrySet()) {
propertiesConfiguration.setProperty(entry.getKey(), entry.getValue());
}
SegmentMetadataUtils.savePropertiesConfiguration(propertiesConfiguration);
segmentMetadata = new SegmentMetadataImpl(indexDir);
segmentDirectory.reloadMetadata();
return segmentMetadata;
}
```
Since a new object is created and returned and we assign that like this:
`_segmentMetadata = updateMetadataProperties(...) `, it's still replacing the
local class object and not the object outside the class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]