public interface ShardIdentifierProvider
Implementation notes:
With exception of the initialize(Properties, BuildContext)
method which is invoked
only once at startup, all other methods could be invoked in parallel by independent threads; implementations must
thus be thread-safe.
Instead of implementing this interface directly, implementations should be derived from
ShardIdentifierProviderTemplate
as new methods might be added to this interface in future releases.
Modifier and Type | Method and Description |
---|---|
Set<String> |
getAllShardIdentifiers()
Returns the list of all currently known shard identifiers.
|
String |
getShardIdentifier(Class<?> entityType,
Serializable id,
String idAsString,
org.apache.lucene.document.Document document)
Determine the shard identifier for the given entity.
|
default Set<String> |
getShardIdentifiersForDeletion(Class<?> entity,
Serializable id,
String idInString)
Deprecated.
Support for
dynamic sharding will be removed in Hibernate Search 6.
Future-proof implementations must not override this method.
|
default Set<String> |
getShardIdentifiersForQuery(FullTextFilterImplementor[] fullTextFilters)
Deprecated.
Support for
dynamic sharding will be removed in Hibernate Search 6.
Future-proof implementations must not override this method.
|
void |
initialize(Properties properties,
BuildContext buildContext)
Initialize this provider.
|
void initialize(Properties properties, BuildContext buildContext)
properties
- The configuration propertiesbuildContext
- The build context available during bootstrappingString getShardIdentifier(Class<?> entityType, Serializable id, String idAsString, org.apache.lucene.document.Document document)
getShardIdentifier(Class, Serializable, String, Document)
, getShardIdentifiersForQuery(FullTextFilterImplementor[])
,
getAllShardIdentifiers()
.entityType
- the type of the entityid
- the id of the entityidAsString
- the entity id transformed as string via the appropriate document id bridgedocument
- the Lucene document for the entity with the given id@Deprecated default Set<String> getShardIdentifiersForQuery(FullTextFilterImplementor[] fullTextFilters)
getShardIdentifier(Class, Serializable, String, Document)
, getShardIdentifiersForQuery(FullTextFilterImplementor[])
,
getAllShardIdentifiers()
.fullTextFilters
- the filters which are applied to the current query@Deprecated default Set<String> getShardIdentifiersForDeletion(Class<?> entity, Serializable id, String idInString)
entity
- the type of the deleted entityid
- the id or nullidInString
- the transformed id or nullSet<String> getAllShardIdentifiers()
getShardIdentifier(Class, Serializable, String, Document)
, getShardIdentifiersForQuery(FullTextFilterImplementor[])
,
getAllShardIdentifiers()
.Copyright © 2006-2022 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.