D
- Represented descriptorpublic interface Updater<D extends Descriptor>
Updater
allows the insertion of structures/descriptors to the similarity subsystem.
An updater allows partially filled descriptor space in order to allow incremental/short updates.
Modifier and Type | Method and Description |
---|---|
void |
addAll(InputStream is,
String opts,
int skipCount,
int maxProcessCount,
StandardizerWrapper standardizer,
SubProgressObserver po,
ExecutorService e,
MoleculeCallback moleculeCallback)
Read all molecules from a structure file into the similarity subsystem.
|
int |
addDescriptor(D d)
Add a single descriptor to the similarity subsystem.
|
int |
addMolecule(Molecule m)
Add a single molecule to the similarity subsystem.
|
void addAll(InputStream is, String opts, int skipCount, int maxProcessCount, StandardizerWrapper standardizer, SubProgressObserver po, ExecutorService e, MoleculeCallback moleculeCallback)
Consecutive members of a structure file have consecutive indexes associated. Usually first molecule in the file have index value 0 associated. To allow segmented reading, this method can be called multiple times to append additional structures.
Consistency considerations: the storage is left in a consistent state in case of the following abnormal or unexpected terminations:
SubProgressObserver
Notes on multithreading:
is
- Input stream to read from. Note that the stream is not closed when returning.opts
- Input options or null
to pass to underlying
MFileFormatUtil.createRecordReader(java.io.InputStream, java.lang.String)
skipCount
- Skip given number of structures. Skipped structures are also reported to the
given progress observer like ordinary processed structures, however they wont
generate calls into the supplied MoleculeCallback
.maxProcessCount
- Read at most given number of structures. Count starts after skipping structures.standardizer
- Standardizer to apply on molecules. See StandardizerWrappers
for utility
methods. Note that supplied wrapper must be thread safe.po
- ProgressObserver to track file read. Total reported work units are assigned to read
and processed/skipped molecules count. The given observer is closed
upon returninge
- ExecutorService to run descriptor generation for pagesmoleculeCallback
- Callback to report back assigned indexes/processing errors.IllegalArgumentException
- When an IO error occurs during file reading or structure importing throws an
exceptionint addMolecule(Molecule m)
Note that the given molecule must be standardized before calling this method.
m
- Molecule to be addedIllegalArgumentException
- in case of processing error. If exception thrown the storage is kept in
a consistent state.int addDescriptor(D d)
Note that descriptors have a compatibility related API contract (currently references returned by
Descriptor#getDescriptorGenerator()
must be equal for compatible descriptors) which must be satisfied by
the passed descriptor.
d
- Descriptor to be addedIllegalArgumentException
- when passed descriptor is not compatible. If exception thrown the storage
is kept in a consistent state