public class TruncateIndex extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TruncateIndex.BatchDetails |
Modifier and Type | Field and Description |
---|---|
static Comparator<String> |
BATCH_COMPARATOR |
static FilenameFilter |
BATCH_NAME_FILTER |
static FilenameFilter |
INDEX_NAME_FILTER |
static Comparator<File> |
ZIP_COLLECTION_COMPARATOR
Comparator that orders mimir zip collection files by number (e.g.
|
Constructor and Description |
---|
TruncateIndex() |
Modifier and Type | Method and Description |
---|---|
static TruncateIndex.BatchDetails |
batchEndPoints(File indexDirectory) |
static String |
determineLastGoodBatch(File indexDirectory)
Determines the last "good" batch name (head or tail-N) for the
given index, and stashes any bad batches in the broken-batches
directory.
|
static void |
main(String... args) |
static void |
repairLastZip(File indexDirectory) |
static void |
stashBatches(File indexDirectory,
List<String> batches) |
static long |
totalDocumentsInZipCollection(File indexDirectory) |
static void |
trimBatch(File indexDirectory,
String batchName,
long numDocs)
Trim the given batch in all sub-indexes to the given length in
documents.
|
static void |
truncateDirectIndex(File indexDirectory,
String subIndexName,
String batchName,
long lastDocId)
Truncate the given direct index to remove documents beyond the
given lastDocId.
|
static void |
truncateIndex(File indexDirectory)
Attempt to fix up a corrupted Mimir index by truncating some number
of documents off the end.
|
static void |
truncateZipCollectionTo(File indexDirectory,
long numDocs) |
public static final Comparator<File> ZIP_COLLECTION_COMPARATOR
public static final Comparator<String> BATCH_COMPARATOR
public static final FilenameFilter INDEX_NAME_FILTER
public static final FilenameFilter BATCH_NAME_FILTER
public static void truncateIndex(File indexDirectory) throws Exception
indexDirectory
- the top-level directory of the Mimir index
(containing config.xml)Exception
public static void repairLastZip(File indexDirectory) throws IOException
IOException
public static String determineLastGoodBatch(File indexDirectory) throws IOException
indexDirectory
- IOException
public static TruncateIndex.BatchDetails batchEndPoints(File indexDirectory) throws IOException, org.apache.commons.configuration.ConfigurationException
IOException
org.apache.commons.configuration.ConfigurationException
public static long totalDocumentsInZipCollection(File indexDirectory) throws IOException
IOException
public static void truncateZipCollectionTo(File indexDirectory, long numDocs) throws IOException
IOException
public static void stashBatches(File indexDirectory, List<String> batches) throws IOException
IOException
public static void trimBatch(File indexDirectory, String batchName, long numDocs) throws Exception
indexDirectory
- top level index directorybatchName
- name of the batch to trimnumDocs
- number of documents to which the batch should be
trimmed.Exception
public static void truncateDirectIndex(File indexDirectory, String subIndexName, String batchName, long lastDocId) throws Exception
indexDirectory
- the top-level index directorysubIndexName
- the name of the sub-index (token-N or
mention-N)batchName
- the name of the batch (head or tail-N)lastDocId
- the last valid document IDException
Copyright © 2021 GATE. All rights reserved.