[hibernate-dev] [HSEARCH] Usage of ShardIdentifierProvider

Gunnar Morling gunnar at hibernate.org
Thu Apr 21 13:35:47 EDT 2016


Hi,

As IndexShardingStrategy is deprecated, I thought I'd use
ShardIdentifierProvider and friends in new code I write. It's not clear to
me though, how it's meant to be used.

Some questions:

* Is it correct that EntityIndexBinding#getShardIdentifierProvider()
returns null is sharding is not used for this entity? I suppose in that
case I simply can use EntityIndexBinding.getIndexManagers()[0]?
* What's the envisioned way to get the IM for a given shard once I know the
shard id? I found IndexManagerHolder.getOrCreateIndexManager(), but this
expects a *DynamicSharding*EntityIndexBinding, so how would it work for
non-dynamic sharding?

It's tough to see how the pieces are meant to fit together, now that
IndexShardingStrategy and ShardIdentifierProvider are there. I hope we can
get rid of the former soon, simplifying the code a bit?

Thanks,

--Gunnar


More information about the hibernate-dev mailing list