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 {
|
public interface IRequestPartitionHelperSvc {
|
||||||
@Nonnull
|
@Nonnull
|
||||||
RequestPartitionId determineReadPartitionForRequest(RequestDetails theRequest, String theResourceType);
|
RequestPartitionId determineReadPartitionForRequest(@Nullable RequestDetails theRequest, String theResourceType);
|
||||||
|
|
||||||
@Nonnull
|
@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()) {
|
if (myPartitionSettings.isPartitioningEnabled()) {
|
||||||
boolean nonPartitionableResource = myNonPartitionableResourceNames.contains(theResourceType);
|
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) {
|
if (theRequest instanceof SystemRequestDetails) {
|
||||||
requestPartitionId = getSystemRequestPartitionId(theRequest, nonPartitionableResource);
|
requestPartitionId = getSystemRequestPartitionId(theRequest, nonPartitionableResource);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue