Skip to content

Commit

Permalink
HSEARCH-2075 Update ShardIdentifierProviderTemplate to maintain backw…
Browse files Browse the repository at this point in the history
…ards compatibility
  • Loading branch information
Sanne committed Dec 21, 2015
1 parent 3fa9007 commit 8ae867f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Expand Up @@ -6,6 +6,7 @@
*/
package org.hibernate.search.store;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashSet;
import java.util.Properties;
Expand Down Expand Up @@ -60,4 +61,13 @@ public Set<String> getShardIdentifiersForQuery(FullTextFilterImplementor[] fullT
return getAllShardIdentifiers();
}

/**
* Override this method if the mapping to a specific shard can be inferred just from the pair (id, type).
* The default implementation will perform delete and purge operations on all known indexes.
*/
@Override
public final Set<String> getShardIdentifiersForDeletion(Class<?> entity, Serializable id, String idInString) {
return getAllShardIdentifiers();
}

}
Expand Up @@ -220,11 +220,6 @@ public String getShardIdentifier(Class<?> entityType, Serializable id, String id
throw new RuntimeException( "Animal expected but found " + entityType );
}

@Override
public Set<String> getShardIdentifiersForDeletion(Class<?> entityType, Serializable id, String idInString) {
return getAllShardIdentifiers();
}

@Override
protected Set<String> loadInitialShardNames(Properties properties, BuildContext buildContext) {
ServiceManager serviceManager = buildContext.getServiceManager();
Expand Down

0 comments on commit 8ae867f

Please sign in to comment.