Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/428#discussion_r207621885
--- Diff: solr/core/src/java/org/apache/solr/core/ConfigSetService.java ---
@@ -212,12 +213,12 @@ public SchemaCaching(SolrResourceLoader loader, Path
configSetBase) {
super(loader, configSetBase);
}
- public static final DateTimeFormatter cacheKeyFormatter =
DateTimeFormat.forPattern("yyyyMMddHHmmss");
+ public static final DateTimeFormatter cacheKeyFormatter =
DateTimeFormatter.ofPattern("yyyyMMddHHmmss", Locale.ROOT);
public static String cacheName(Path schemaFile) throws IOException {
long lastModified = Files.getLastModifiedTime(schemaFile).toMillis();
return String.format(Locale.ROOT, "%s:%s",
- schemaFile.toString(),
cacheKeyFormatter.print(lastModified));
+ schemaFile.toString(),
Instant.ofEpochMilli(lastModified).atZone(ZoneOffset.UTC).format(cacheKeyFormatter));
--- End diff --
I think the 2nd arg should be simplified to this:
`Instant.ofEpochMilli(lastModified).toString()`
This removes the need for a cacheKeyFormatter. My only concern before
mentioning this originally was that I did't know what happens with this
formatted info... did it need to get reparsed somewhere or stored ZooKeeper.
Neither of those things; it's just a portion of cache key. So lets keep this
super simple.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]