/** Default number of max cache hits. */
public static final int DEFAULT_CACHE_HOT_MAX = 1;
- static final String DEFAULT_NAME = "<default>";
+ static final String DEFAULT_NAME = "<default>"; //$NON-NLS-1$
private String name;
* {@link PrintWriter} to write the cache's configuration to.
*/
public void print(PrintWriter writer) {
- print(/* linePrefix= */ "", /* pad= */ " ", writer);
+ print(/* linePrefix= */ "", /* pad= */ " ", writer); //$NON-NLS-1$//$NON-NLS-2$
}
/**
* @param writer
* {@link PrintWriter} to write the cache's configuration to.
*/
+ @SuppressWarnings("nls")
private void print(String linePrefix, String pad, PrintWriter writer) {
String currentPrefixLevel = linePrefix;
if (!name.isEmpty() || !packExtCacheConfigurations.isEmpty()) {
- String name = this.name;
- if (name.isEmpty()) {
- name = "<Default>";
- }
- writer.println(linePrefix + "Name: " + name);
+ writer.println(linePrefix + "Name: "
+ + (name.isEmpty() ? DEFAULT_NAME : this.name));
currentPrefixLevel += pad;
}
writer.println(currentPrefixLevel + "BlockLimit: " + blockLimit);
void print(String linePrefix, String pad, PrintWriter writer) {
packExtCacheConfiguration.print(linePrefix, pad, writer);
- writer.println(linePrefix + pad + "PackExts: "
+ writer.println(linePrefix + pad + "PackExts: " //$NON-NLS-1$
+ packExts.stream().sorted().collect(Collectors.toList()));
}
}
Set<DfsBlockCacheTable> blockCacheTables = new HashSet<>();
blockCacheTables.add(defaultBlockCacheTable);
blockCacheTables.addAll(packExtBlockCacheTables.values());
- String name = defaultBlockCacheTable.getName() + ","
+ String name = defaultBlockCacheTable.getName() + "," //$NON-NLS-1$
+ packExtBlockCacheTables.values().stream()
.map(DfsBlockCacheTable::getName).sorted()
- .collect(Collectors.joining(","));
+ .collect(Collectors.joining(",")); //$NON-NLS-1$
return new PackExtBlockCacheTable(name, defaultBlockCacheTable,
List.copyOf(blockCacheTables), packExtBlockCacheTables);
}
private String failingPathsMessage() {
int max = 25;
String failedPaths = failingPaths.entrySet().stream().limit(max)
- .map(entry -> entry.getKey() + ":" + entry.getValue())
- .collect(Collectors.joining("\n"));
+ .map(entry -> entry.getKey() + ":" + entry.getValue()) //$NON-NLS-1$
+ .collect(Collectors.joining("\n")); //$NON-NLS-1$
if (failingPaths.size() > max) {
- failedPaths = String.format("%s\n... (%s failing paths omitted)",
+ failedPaths = String.format("%s\n... (%s failing paths omitted)", //$NON-NLS-1$
failedPaths, failingPaths.size() - max);
}
return failedPaths;