|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.search.impl.lucene.index.IndexInfo
public class IndexInfo
The information that makes up an index. IndexInfoVersion Repeated information of the form
The index structure is duplicated to two files. If one is currupted the second is used.
TODO:
Nested Class Summary | |
---|---|
static interface |
IndexInfo.LockWork
|
Field Summary | |
---|---|
static java.lang.String |
MAIN_READER
|
Method Summary | |
---|---|
void |
addApplicationListener(org.springframework.context.ApplicationListener listener)
Registers a listener for events on this index. |
void |
closeDelta(java.lang.String id)
Make sure the writer and reader for TX data are closed. |
void |
closeDeltaIndexReader(java.lang.String id)
Manage closing and unregistering an index reader. |
void |
closeDeltaIndexWriter(java.lang.String id)
Manage closing and unregistering an index writer . |
void |
delete(java.lang.String deltaId)
|
static void |
destroy()
|
void |
destroyInstance()
|
java.lang.Object |
doReadOnly(IndexInfo.LockWork lockWork)
|
long |
getActualSize()
Gets the actual size of the index in bytes. |
java.util.Set |
getDeletions(java.lang.String id)
Get the deletions for a given index (there is no check if they should be applied that is up to the calling layer) |
org.apache.lucene.index.IndexReader |
getDeltaIndexReader(java.lang.String id)
This method should only be called from one thread as it is bound to a transaction. |
org.apache.lucene.index.IndexWriter |
getDeltaIndexWriter(java.lang.String id,
org.apache.lucene.analysis.Analyzer analyzer)
Manage getting a lucene index writer for transactional data - looks after registration and checking there is no active reader. |
static IndexInfo |
getIndexInfo(java.io.File file,
LuceneConfig config)
Get the IndexInfo object based in the given directory. |
org.apache.lucene.index.IndexReader |
getMainIndexReferenceCountingReadOnlyIndexReader()
Get the main reader for committed index data |
org.apache.lucene.index.IndexReader |
getMainIndexReferenceCountingReadOnlyIndexReader(java.lang.String id,
java.util.Set deletions,
java.util.Set containerDeletions,
boolean deleteOnlyNodes)
Get the main index reader augmented with the specified TX data As above but we add the TX data |
int |
getNumberOfDocuments()
Gets the number of documents in the index. |
int |
getNumberOfFields()
Gets the number of fields known to the index. |
int |
getNumberOfIndexedFields()
Gets the number of indexed fields. |
java.lang.String |
getRelativePath()
Gets the relative path of the index directory. |
java.util.Map |
getStatusSnapshot()
Gets a snapshot of the statuses of the individual entries in this index. |
long |
getUsedSize()
Gets the size used on disk by the index directory. |
static void |
main(java.lang.String[] args)
Helper to print out index information |
void |
setPreparedState(java.lang.String id,
java.util.Set toDelete,
java.util.Set containersToDelete,
long documents,
boolean deleteNodesOnly)
Set the aux data for the index entry for a transactional unit of work. |
void |
setStatus(java.lang.String id,
TransactionStatus state,
java.util.Set toDelete,
java.util.Set read)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MAIN_READER
Method Detail |
---|
public static void destroy()
public void destroyInstance()
public void delete(java.lang.String deltaId)
public static IndexInfo getIndexInfo(java.io.File file, LuceneConfig config) throws IndexerException
file
-
IndexerException
public org.apache.lucene.index.IndexReader getDeltaIndexReader(java.lang.String id) throws java.io.IOException
id
-
java.io.IOException
public org.apache.lucene.index.IndexWriter getDeltaIndexWriter(java.lang.String id, org.apache.lucene.analysis.Analyzer analyzer) throws java.io.IOException
id
- analyzer
-
java.io.IOException
public void closeDeltaIndexReader(java.lang.String id) throws java.io.IOException
id
-
java.io.IOException
public void closeDeltaIndexWriter(java.lang.String id) throws java.io.IOException
id
-
java.io.IOException
public void closeDelta(java.lang.String id) throws java.io.IOException
id
-
java.io.IOException
public java.util.Set getDeletions(java.lang.String id) throws java.io.IOException
id
-
java.io.IOException
public void setPreparedState(java.lang.String id, java.util.Set toDelete, java.util.Set containersToDelete, long documents, boolean deleteNodesOnly) throws java.io.IOException
id
- -
the tx idtoDelete
- -
noderefs that should be deleted from previous indexes (not this one)documents
- -
the number of docs in the indexdeleteNodesOnly
- -
should deletions on apply to nodes (ie not to containers)
java.io.IOException
public org.apache.lucene.index.IndexReader getMainIndexReferenceCountingReadOnlyIndexReader() throws java.io.IOException
java.io.IOException
public org.apache.lucene.index.IndexReader getMainIndexReferenceCountingReadOnlyIndexReader(java.lang.String id, java.util.Set deletions, java.util.Set containerDeletions, boolean deleteOnlyNodes) throws java.io.IOException
id
- deletions
- deleteOnlyNodes
-
java.io.IOException
public void setStatus(java.lang.String id, TransactionStatus state, java.util.Set toDelete, java.util.Set read) throws java.io.IOException
java.io.IOException
public java.lang.Object doReadOnly(IndexInfo.LockWork lockWork)
public static void main(java.lang.String[] args) throws java.lang.Throwable
args
-
java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRelativePath()
IndexMonitor
getRelativePath
in interface IndexMonitor
public java.util.Map getStatusSnapshot()
IndexMonitor
getStatusSnapshot
in interface IndexMonitor
public long getActualSize() throws java.io.IOException
IndexMonitor
getActualSize
in interface IndexMonitor
java.io.IOException
- Signals that an I/O exception has occurred.public long getUsedSize() throws java.io.IOException
IndexMonitor
IndexMonitor.getActualSize()
may indicate that there are unused data files.
getUsedSize
in interface IndexMonitor
java.io.IOException
- Signals that an I/O exception has occurred.public int getNumberOfDocuments() throws java.io.IOException
IndexMonitor
getNumberOfDocuments
in interface IndexMonitor
java.io.IOException
- Signals that an I/O exception has occurred.public int getNumberOfFields() throws java.io.IOException
IndexMonitor
getNumberOfFields
in interface IndexMonitor
java.io.IOException
- Signals that an I/O exception has occurred.public int getNumberOfIndexedFields() throws java.io.IOException
IndexMonitor
getNumberOfIndexedFields
in interface IndexMonitor
java.io.IOException
- Signals that an I/O exception has occurred.public void addApplicationListener(org.springframework.context.ApplicationListener listener)
IndexMonitor
addApplicationListener
in interface IndexMonitor
listener
- the listener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |