gortiz commented on code in PR #10352:
URL: https://github.com/apache/pinot/pull/10352#discussion_r1122772410
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java:
##########
@@ -410,35 +415,55 @@ public FSTType getFSTIndexType() {
* @return a set containing names of text index columns
*/
public Set<String> getTextIndexColumns() {
- return _textIndexColumns;
+ return unmodifiable(_textIndexColumns);
}
public Set<String> getFSTIndexColumns() {
- return _fstIndexColumns;
+ return unmodifiable(_fstIndexColumns);
}
public Map<String, JsonIndexConfig> getJsonIndexConfigs() {
- return _jsonIndexConfigs;
+ return unmodifiable(_jsonIndexConfigs);
}
public Map<String, H3IndexConfig> getH3IndexConfigs() {
- return _h3IndexConfigs;
+ return unmodifiable(_h3IndexConfigs);
}
public Map<String, Map<String, String>> getColumnProperties() {
- return _columnProperties;
+ return unmodifiable(_columnProperties);
}
public void setColumnProperties(Map<String, Map<String, String>>
columnProperties) {
- _columnProperties = columnProperties;
+ _columnProperties = new HashMap<>(columnProperties);
}
/**
* For tests only.
*/
@VisibleForTesting
public void setInvertedIndexColumns(Set<String> invertedIndexColumns) {
- _invertedIndexColumns = invertedIndexColumns;
+ _invertedIndexColumns = new HashSet<>(invertedIndexColumns);
+ }
+
+ @VisibleForTesting
+ public void addInvertedIndexColumns(String... invertedIndexColumns) {
+ _invertedIndexColumns.addAll(Arrays.asList(invertedIndexColumns));
+ }
Review Comment:
As said above, I don't like the suggestion. If user need to know whether
this is going to add something or not, it can check it before calling
`getWhateverColumns().contains(column)`. In fact, the caller code never wants
to check that.
--
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]