[hibernate-dev] [Search] PurgeAll & Sharding API

Sanne Grinovero sanne at hibernate.org
Mon Aug 1 14:55:21 EDT 2011


Hi,
I just noticed that a PurgeAll request will ask the sharding strategy
to know to which shard it should be applied, using the following
method:

getDirectoryProvidersForDeletion(Class<?> entity, Serializable id,
String idInString) {

and passing in null for the second and third arguments.

That's not broken per se as the sharding implementor can easily deal
with this, but in our IdHashShardingStrategy we don't consider this,
so we could at least improve the example.

I'm wondering why we don't use
#getDirectoryProvidersForAllShards()

likely to give more flexibility to implementors; in that case I guess
that because PurgeAll was introduced after sharding, it was not an
option to create a method

getDirectoryProvidersForPurgeAll(Class<?> entity)

shall we add this one?

Alternatively I think we should either fix the example or use the
"all" strategy.

Cheers,
Sanne



More information about the hibernate-dev mailing list