aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcorespi/index/diskindexcleaner.h
blob: cbd3a5aa94f6af81b6a64cb440ad8d5207cd7842 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/stllike/string.h>

namespace searchcorespi {
namespace index {
class DiskIndexes;

/**
 * Utility class used to clean and remove index directories.
 */
struct DiskIndexCleaner {
    /**
     * Deletes all indexes with id lower than the most recent fusion id.
     */
    static void clean(const vespalib::string &index_dir,
                      DiskIndexes& disk_indexes);
    static void removeOldIndexes(const vespalib::string &index_dir,
                                 DiskIndexes& disk_indexes);
};

}  // namespace index
}  // namespace searchcorespi