If null, return default partition during create
This commit is contained in:
parent
fcc662da79
commit
0fb0419a67
|
@ -29,8 +29,8 @@ import javax.annotation.Nullable;
|
|||
|
||||
public interface IRequestPartitionHelperSvc {
|
||||
@Nonnull
|
||||
RequestPartitionId determineReadPartitionForRequest(RequestDetails theRequest, String theResourceType);
|
||||
RequestPartitionId determineReadPartitionForRequest(@Nullable RequestDetails theRequest, String theResourceType);
|
||||
|
||||
@Nonnull
|
||||
RequestPartitionId determineCreatePartitionForRequest(RequestDetails theRequest, @Nonnull IBaseResource theResource, @Nonnull String theResourceType);
|
||||
RequestPartitionId determineCreatePartitionForRequest(@Nullable RequestDetails theRequest, @Nonnull IBaseResource theResource, @Nonnull String theResourceType);
|
||||
}
|
||||
|
|
|
@ -180,6 +180,11 @@ public class RequestPartitionHelperSvc implements IRequestPartitionHelperSvc {
|
|||
if (myPartitionSettings.isPartitioningEnabled()) {
|
||||
boolean nonPartitionableResource = myNonPartitionableResourceNames.contains(theResourceType);
|
||||
|
||||
//TODO GGG eventually, theRequest will not be allowed to be null here, and we will pass through SystemRequestDetails instead.
|
||||
if (theRequest == null && nonPartitionableResource) {
|
||||
return RequestPartitionId.defaultPartition();
|
||||
}
|
||||
|
||||
if (theRequest instanceof SystemRequestDetails) {
|
||||
requestPartitionId = getSystemRequestPartitionId(theRequest, nonPartitionableResource);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue