Skip to content

Commit

Permalink
Update backfill query to ignore claims that already have tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
dondevun committed Dec 4, 2024
2 parents b5c3a2b + 42535d5 commit ead04dc
Show file tree
Hide file tree
Showing 18 changed files with 488 additions and 474 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public final class AppConfiguration extends BaseAppConfiguration {
public static final String SSM_PATH_SAMHSA_BACKFILL_ENABLED = "rda/samhsa/backfill/enabled";

/** Config value for SAMHSA backfill batch size. */
public static final String SSM_PATH_SAMHSA_BAKFILL_BATCH_SIZE = "rda/samhsa/backfill/batch_size";
public static final String SSM_PATH_SAMHSA_BACKFILL_BATCH_SIZE = "rda/samhsa/backfill/batch_size";

/**
* The CCW rif load options. This can be null if the CCW job is not configured, Optional is not
Expand Down Expand Up @@ -416,7 +416,7 @@ public final class AppConfiguration extends BaseAppConfiguration {
SSM_PATH_RDA_GRPC_SECONDS_BEFORE_CONNECTION_DROP,
String.valueOf(Duration.ofMinutes(4).toSeconds()))
.put(SSM_PATH_SAMHSA_BACKFILL_ENABLED, "false")
.put(SSM_PATH_SAMHSA_BAKFILL_BATCH_SIZE, String.valueOf(10000))
.put(SSM_PATH_SAMHSA_BACKFILL_BATCH_SIZE, String.valueOf(10000))
.build();

/**
Expand Down Expand Up @@ -522,7 +522,7 @@ public static BackfillConfigOptions loadBackfillConfigOptions(
if (!enabled || ccwPipelineEnabled) {
return null;
}
int batchSize = config.intValue(SSM_PATH_SAMHSA_BAKFILL_BATCH_SIZE, 10000);
int batchSize = config.intValue(SSM_PATH_SAMHSA_BACKFILL_BATCH_SIZE, 10000);
BackfillConfigOptions backfillConfigOptions =
BackfillConfigOptions.builder().enabled(enabled).batchSize(batchSize).build();
return backfillConfigOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ private List<RifRecordLoadResult> processBatchImpl(
}
} else throw new BadCodeMonkeyException();
if (Arrays.asList(POSSIBLE_SAMHSA_CLAIMS).contains(rifFileType)) {
samhsaUtil.processClaim(record, entityManager);
samhsaUtil.processCcwClaim(record, entityManager);
}
LOGGER.trace("Loaded '{}' record.", rifFileType);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private void mergeBatch(long maxSeq, Collection<RdaChange<TClaim>> changes) {
var metaData = createMetaData(change);
entityManager.merge(metaData);
entityManager.merge(change.getClaim());
samhsaUtil.processClaim(change.getClaim(), entityManager);
samhsaUtil.processRdaClaim(change.getClaim(), entityManager);
insertCount += getInsertCount(change.getClaim());
} else {
// We would expect this to have been filtered by the RdaSource so it is safe
Expand Down
Loading

0 comments on commit ead04dc

Please sign in to comment.