HibernateEventListener and CascadingManager make direct calls to the create(), delete(), and save() methods on CompassSession. We are currently patching these classes and replacing those calls with calls to our own code that queues up index updates and can perform them in batches, as well as retry failed updates.
Instead of doing that, it would be great if Compass deferred those calls to an interface with just those methods, so we could provide our own implementation to Compass and not have to patch those classes.
So something like this:
public interface InternalIndexOperations
{
void create(Object obj) throws CompassException;
void delete(Object obj) throws CompassException;
void save(Object obj) throws CompassException;
}
I guess the existing CompassOperations interface could extend from that to avoid duplication? Then an implementation of this could be provided as a setting perhaps.
I can provide a patch if the idea makes sense.
Also, in such cases, the question if there is a need to abstract it through the Compass API at all. For example, with the mirror, you can simply inject your own event listeners and then add the changed object to a queue, and when you read things off the queue, you can use Compass for it.