dsmiley commented on code in PR #1739:
URL: https://github.com/apache/solr/pull/1739#discussion_r1344660896
##########
solr/core/src/java/org/apache/solr/core/backup/BackupProperties.java:
##########
@@ -93,10 +108,25 @@ public static BackupProperties readFrom(
repository.openInput(backupPath, fileName, IOContext.DEFAULT)),
StandardCharsets.UTF_8)) {
props.load(is);
- return new BackupProperties(props);
+ Map<String, String> extraProperties = extractExtraProperties(props);
+ return new BackupProperties(props, extraProperties);
}
}
+ private static Map<String, String> extractExtraProperties(Properties props) {
+ Map<String, String> extraProperties = new HashMap<>();
+ props.forEach(
+ (key, value) -> {
+ String entryKey = key.toString();
+ if (entryKey.startsWith(EXTRA_PROPERTY_PREFIX)) {
+ extraProperties.put(
+ entryKey.substring(EXTRA_PROPERTY_PREFIX.length()),
String.valueOf(value));
+ props.remove(key);
Review Comment:
Yeah, okay, although depending on internal details :-/. Another
alternative is using `props.entrySet().removeIf`
Any way, doesn't matter much to me.
--
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]