Menu

LDIFReaderEntryTranslator

mschwuchow
2013-01-24
2013-06-13
  • mschwuchow

    mschwuchow - 2013-01-24

    Hi,
    I often use the LDIFReader and LDIFWriter for programs that use LDIF files as input or output. Sometimes pre- or post-processing of the LDIF records is required, and the interface "LDIFReaderEntryTranslator" is really useful for such tasks. I wonder if it possible to make this conecpt a bit more generic so that it is also applicable when writing LDIFs or to transform LDIF change records.

    Do you have any thoughts on this?

    Regads, Mathis

     
  • Neil Wilson

    Neil Wilson - 2013-01-24

    The primary benefit of the LDIFReaderEntryTranslator is that it can be used when reading entries in parallel with multiple threads (which you can enable by specifying a numParseThreads larger than 1 when creating the LDIFReader), and that the translation will be performed by the same threads used to decode the entries so that is done in parallel as well.  If you're just using a single thread, then the LDIFReaderEntryTranslator doesn't provide much benefit over just creating your own method and calling it without using the interface.

    The LDIFWriter also provides a way to write entries in parallel with multiple threads (although it's not as transparent, since you have to provide the entries in a list), so it could make sense to provide an LDIFWriterEntryTranslator and I'll look into that.  I'm not as convinced that it would be worth the effort to provide translators for change records, since it's much less likely that you'd need to read/write and transform large numbers of change records in a manner that would make parallel processing an attractive options, and if you're just going to be accessing them in a single-threaded context then you don't need the special interface to do the transformation.

    Neil

     
  • Neil Wilson

    Neil Wilson - 2013-01-28

    I have just committed a set of changes that add support for an LDIFWriterEntryTranslator interface.  It can be used to transform or suppress entries to be written to LDIF, just as the LDIFReaderEntryTranslator interface allows for entries being read.

    Neil

     

Log in to post a comment.