Note that if an Exception is hit (for example disk full) then the index will be consistent, but this document may not have been added. Furthermore, it's possible the index will have one segment in non-compound format even when using compound files (when a merge has partially succeeded).
This method periodically flushes pending documents to the Directory (see above), and also periodically triggers segment merges in the index according to the {@link MergePolicy} in use.
Merges temporarily consume space in the directory. The amount of space required is up to 1X the size of all segments being merged, when no readers/searchers are open against the index, and up to 2X the size of all segments being merged when readers/searchers are open against the index (see {@link #optimize()} for details). The sequence ofprimitive merge operations performed is governed by the merge policy.
Note that each term in the document can be no longer than 16383 characters, otherwise an IllegalArgumentException will be thrown.
Note that it's possible to create an invalid Unicode string in java if a UTF16 surrogate pair is malformed. In this case, the invalid characters are silently replaced with the Unicode replacement character U+FFFD.
NOTE: if this method hits an OutOfMemoryError you should immediately close the writer. See above for details.
@throws CorruptIndexException if the index is corrupt @throws IOException if there is a low-level IO erroraddDocument
method is used to add a new resource to the signed info. A {@link org.apache.xml.security.signature.Reference} is builtfrom the supplied values.
@param BaseURI the URI of the resource where the XML instance was stored
@param referenceURI URI
attribute in Reference
for specifing where data is
@param transforms org.apache.xml.security.signature.Transforms object with an ordered list of transformations to be performed.
@param digestURI The digest algorthim URI to be used.
@param ReferenceId
@param ReferenceType
@throws XMLSignatureException
Document
to the vector.
@param doc The Document
to add.
Note that if an Exception is hit (for example disk full) then the index will be consistent, but this document may not have been added. Furthermore, it's possible the index will have one segment in non-compound format even when using compound files (when a merge has partially succeeded).
This method periodically flushes pending documents to the Directory (every {@link #setMaxBufferedDocs}), and also periodically merges segments in the index (every {@link #setMergeFactor} flushes). When thisoccurs, the method will take more time to run (possibly a long time if the index is large), and will require free temporary space in the Directory to do the merging.
The amount of free space required when a merge is triggered is up to 1X the size of all segments being merged, when no readers/searchers are open against the index, and up to 2X the size of all segments being merged when readers/searchers are open against the index (see {@link #optimize()} for details). Thesequence of primitive merge operations performed is governed by the merge policy.
Note that each term in the document can be no longer than 16383 characters, otherwise an IllegalArgumentException will be thrown.
@throws CorruptIndexException if the index is corrupt @throws IOException if there is a low-level IO error
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|