Skip to content

Commit d26fc94

Browse files
committed
tweak
1 parent 9c301b9 commit d26fc94

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/src/main/java/org/elasticsearch/gateway/MetadataStateFormat.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ protected Directory newDirectory(Path dir) throws IOException {
349349
* @param currentGeneration state generation to keep.
350350
* @param locations state paths.
351351
*/
352-
public void cleanupOldFiles(final long currentGeneration, final Path[] locations) {
352+
public void cleanupOldFiles(final long currentGeneration, Path[] locations) {
353353
final String fileNameToKeep = getStateFileName(currentGeneration);
354354
for (Path location : locations) {
355355
logger.trace("cleanupOldFiles: cleaning up {}", location);
@@ -366,6 +366,14 @@ public void cleanupOldFiles(final long currentGeneration, final Path[] locations
366366
}
367367
}
368368

369+
/**
370+
* Finds state file with maximum id.
371+
*
372+
* @param prefix - filename prefix
373+
* @param locations - paths to directories with state folder
374+
* @return maximum id of state file or -1 if no such files are found
375+
* @throws IOException if IOException occurs
376+
*/
369377
long findMaxGenerationId(final String prefix, Path... locations) throws IOException {
370378
long maxId = -1;
371379
for (Path dataLocation : locations) {

0 commit comments

Comments
 (0)