Rename a few reindexing methods to make their names more intuitive

This commit is contained in:
James Agnew 2017-03-01 16:44:48 -05:00
parent 1032fbb475
commit d1d208c6c7
5 changed files with 18 additions and 18 deletions

View File

@ -1087,7 +1087,7 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> implements IDao {
b.append(" (pid "); b.append(" (pid ");
b.append(theEntity.getId()); b.append(theEntity.getId());
b.append(", version "); b.append(", version ");
b.append(myContext.getVersion().getVersion()); b.append(theEntity.getFhirVersion().name());
b.append("): "); b.append("): ");
b.append(e.getMessage()); b.append(e.getMessage());
String msg = b.toString(); String msg = b.toString();

View File

@ -21,12 +21,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
* limitations under the License. * limitations under the License.
* #L% * #L%
*/ */
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import javax.persistence.Query; import javax.persistence.Query;
@ -59,7 +54,6 @@ import ca.uhn.fhir.rest.method.RequestDetails;
import ca.uhn.fhir.rest.server.IBundleProvider; import ca.uhn.fhir.rest.server.IBundleProvider;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails; import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
public abstract class BaseHapiFhirSystemDao<T, MT> extends BaseHapiFhirDao<IBaseResource> implements IFhirSystemDao<T, MT> { public abstract class BaseHapiFhirSystemDao<T, MT> extends BaseHapiFhirDao<IBaseResource> implements IFhirSystemDao<T, MT> {
@ -278,9 +272,9 @@ public abstract class BaseHapiFhirSystemDao<T, MT> extends BaseHapiFhirDao<IBase
@Override @Override
@Transactional(propagation = Propagation.NOT_SUPPORTED) @Transactional(propagation = Propagation.NOT_SUPPORTED)
public int performReindexingPass(final Integer theCount) { public Integer performReindexingPass(final Integer theCount) {
if (!myReindexLock.tryLock()) { if (!myReindexLock.tryLock()) {
return 0; return null;
} }
try { try {
return doPerformReindexingPass(theCount); return doPerformReindexingPass(theCount);

View File

@ -46,8 +46,8 @@ public class FhirResourceDaoSearchParameterDstu2 extends FhirResourceDaoDstu2<Se
return; return;
} }
int count = mySystemDao.performReindexingPass(100); Integer count = mySystemDao.performReindexingPass(100);
for (int i = 0; i < 50 && count != 0; i++) { for (int i = 0; i < 50 && count != null && count != 0; i++) {
count = mySystemDao.performReindexingPass(100); count = mySystemDao.performReindexingPass(100);
try { try {
Thread.sleep(DateUtils.MILLIS_PER_SECOND); Thread.sleep(DateUtils.MILLIS_PER_SECOND);

View File

@ -10,7 +10,7 @@ package ca.uhn.fhir.jpa.dao;
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
@ -32,12 +32,16 @@ import ca.uhn.fhir.rest.server.IBundleProvider;
/** /**
* @param <T> * @param <T>
* The bundle type * The bundle type
* @param <MT>
* The Meta datatype type
*/ */
public interface IFhirSystemDao<T, MT> extends IDao { public interface IFhirSystemDao<T, MT> extends IDao {
/** /**
* Use with caution! This deletes everything!! * Use with caution! This deletes everything!!
* @param theRequestDetails TODO *
* @param theRequestDetails
* TODO
*/ */
void deleteAllTagsOnServer(RequestDetails theRequestDetails); void deleteAllTagsOnServer(RequestDetails theRequestDetails);
@ -58,11 +62,13 @@ public interface IFhirSystemDao<T, MT> extends IDao {
/** /**
* Not supported for DSTU1 * Not supported for DSTU1
* @param theRequestDetails TODO *
* @param theRequestDetails
* TODO
*/ */
MT metaGetOperation(RequestDetails theRequestDetails); MT metaGetOperation(RequestDetails theRequestDetails);
int performReindexingPass(Integer theCount); Integer performReindexingPass(Integer theCount);
T transaction(RequestDetails theRequestDetails, T theResources); T transaction(RequestDetails theRequestDetails, T theResources);

View File

@ -73,8 +73,8 @@ public class FhirResourceDaoSearchParameterDstu3 extends FhirResourceDaoDstu3<Se
return; return;
} }
int count = mySystemDao.performReindexingPass(100); Integer count = mySystemDao.performReindexingPass(100);
for (int i = 0; i < 50 && count != 0; i++) { for (int i = 0; i < 50 && count != null && count != 0; i++) {
count = mySystemDao.performReindexingPass(100); count = mySystemDao.performReindexingPass(100);
try { try {
Thread.sleep(DateUtils.MILLIS_PER_SECOND); Thread.sleep(DateUtils.MILLIS_PER_SECOND);