Bug #6643
closedEventLog.getD1Report does not correctly map event types
0%
Description
When reporting log records to DataONE, our EventLog.getD1Report() method does not properly map all of the metacat event types into the DataONE enumeration for event types. By looking at the KNB database, we have 10 distinct event types, which should be mapped onto the dataone event types as follows:
METACAT DATAONE -------- --------- create => create delete => delete insert => create INSERT => create read => read replicate => replicate synchronization_failed => synchronization_failed update => update UPDATE => update upload => create
In particular, metacat only seems to convert 'insert' events to create, whereas it also needs to convert INSERT and upload events, and ensure UPLOAD (all caps) is converted. The SQL snippet uses a case statement, and it is not clear if even 'create' events are making it through unscathed. Based on some counts I have examined comparing metacat tables to DataONE logs, it seems we need more thorough tests that check conversion of all event types.
"case " +
" when event = 'insert' then 'create' " +
" else event " +
"end as event, " +