@Component(role=IndexPacker.class) public class DefaultIndexPacker extends org.codehaus.plexus.logging.AbstractLogEnabled implements IndexPacker
IndexPacker
implementation. Creates the properties, legacy index zip and new gz files.Modifier and Type | Field and Description |
---|---|
(package private) IncrementalHandler |
incrementalHandler |
ROLE
Constructor and Description |
---|
DefaultIndexPacker() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
copyLegacyDocuments(org.apache.lucene.index.IndexReader r,
org.apache.lucene.store.Directory targetdir,
IndexingContext context) |
(package private) static void |
copyLegacyDocuments(org.apache.lucene.index.IndexReader r,
org.apache.lucene.store.Directory targetdir,
IndexingContext context,
int maxSegments) |
private java.lang.String |
format(java.util.Date d) |
(package private) static void |
packDirectory(org.apache.lucene.store.Directory directory,
java.io.OutputStream os) |
void |
packIndex(IndexPackingRequest request)
Pack a context into a target directory.
|
static void |
packIndexArchive(IndexingContext context,
java.io.OutputStream os)
Pack legacy index archive into a specified output stream
|
static void |
packIndexArchive(IndexingContext context,
java.io.OutputStream os,
int maxSegments)
Pack legacy index archive into a specified output stream
|
private java.util.Properties |
readIndexProperties(IndexPackingRequest request) |
(package private) static org.apache.lucene.document.Document |
updateLegacyDocument(org.apache.lucene.document.Document doc,
IndexingContext context) |
(package private) static void |
writeFile(java.lang.String name,
java.util.zip.ZipOutputStream zos,
org.apache.lucene.store.Directory directory,
byte[] buf) |
(package private) void |
writeIndexArchive(IndexingContext context,
java.io.File targetArchive) |
(package private) void |
writeIndexArchive(IndexingContext context,
java.io.File targetArchive,
int maxSegments) |
(package private) void |
writeIndexData(IndexingContext context,
java.util.List<java.lang.Integer> docIndexes,
java.io.File targetArchive) |
(package private) void |
writeIndexProperties(IndexPackingRequest request,
java.util.Properties info) |
@Requirement(role=IncrementalHandler.class) IncrementalHandler incrementalHandler
public void packIndex(IndexPackingRequest request) throws java.io.IOException, java.lang.IllegalArgumentException
IndexPacker
packIndex
in interface IndexPacker
java.io.IOException
- on lethal IO problemjava.lang.IllegalArgumentException
- when the targetDir already exists and is not a writable directory.private java.util.Properties readIndexProperties(IndexPackingRequest request) throws java.io.IOException
java.io.IOException
void writeIndexArchive(IndexingContext context, java.io.File targetArchive) throws java.io.IOException
java.io.IOException
void writeIndexArchive(IndexingContext context, java.io.File targetArchive, int maxSegments) throws java.io.IOException
java.io.IOException
public static void packIndexArchive(IndexingContext context, java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public static void packIndexArchive(IndexingContext context, java.io.OutputStream os, int maxSegments) throws java.io.IOException
java.io.IOException
static void copyLegacyDocuments(org.apache.lucene.index.IndexReader r, org.apache.lucene.store.Directory targetdir, IndexingContext context) throws org.apache.lucene.index.CorruptIndexException, org.apache.lucene.store.LockObtainFailedException, java.io.IOException
org.apache.lucene.index.CorruptIndexException
org.apache.lucene.store.LockObtainFailedException
java.io.IOException
static void copyLegacyDocuments(org.apache.lucene.index.IndexReader r, org.apache.lucene.store.Directory targetdir, IndexingContext context, int maxSegments) throws org.apache.lucene.index.CorruptIndexException, org.apache.lucene.store.LockObtainFailedException, java.io.IOException
org.apache.lucene.index.CorruptIndexException
org.apache.lucene.store.LockObtainFailedException
java.io.IOException
static org.apache.lucene.document.Document updateLegacyDocument(org.apache.lucene.document.Document doc, IndexingContext context)
static void packDirectory(org.apache.lucene.store.Directory directory, java.io.OutputStream os) throws java.io.IOException
java.io.IOException
static void writeFile(java.lang.String name, java.util.zip.ZipOutputStream zos, org.apache.lucene.store.Directory directory, byte[] buf) throws java.io.IOException
java.io.IOException
void writeIndexData(IndexingContext context, java.util.List<java.lang.Integer> docIndexes, java.io.File targetArchive) throws java.io.IOException
java.io.IOException
void writeIndexProperties(IndexPackingRequest request, java.util.Properties info) throws java.io.IOException
java.io.IOException
private java.lang.String format(java.util.Date d)