Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,8 @@ private static int updateRecordsUsingMarcExtract(ArrayList<File> exportedMarcFil
logEntry.addNote("Processing file " + curBibFile.getAbsolutePath());

String lastRecordProcessed = "";
if (hasFullExportFile && curBibFile.equals(fullExportFile) && indexingProfile.getLastChangeProcessed() > 0){
boolean isFullExportFile = hasFullExportFile && curBibFile.equals(fullExportFile);
if (isFullExportFile && indexingProfile.getLastChangeProcessed() > 0){
logEntry.addNote("Skipping the first " + indexingProfile.getLastChangeProcessed() + " records because they were processed previously see (Last Record ID Processed for the Indexing Profile).");
}
int numRecordsRead = 0;
Expand All @@ -927,7 +928,7 @@ private static int updateRecordsUsingMarcExtract(ArrayList<File> exportedMarcFil
}
numRecordsRead++;
RecordIdentifier recordIdentifier = recordGroupingProcessor.getPrimaryIdentifierFromMarcRecord(curBib, indexingProfile);
if (hasFullExportFile && curBibFile.equals(fullExportFile) && (numRecordsRead < indexingProfile.getLastChangeProcessed())) {
if (isFullExportFile && (numRecordsRead < indexingProfile.getLastChangeProcessed())) {
if (recordIdentifier != null) {
recordGroupingProcessor.removeExistingRecord(recordIdentifier.getIdentifier());
}
Expand Down Expand Up @@ -965,7 +966,9 @@ private static int updateRecordsUsingMarcExtract(ArrayList<File> exportedMarcFil
//Delete the record since it is suppressed
deleteRecord = true;
}
indexingProfile.setLastChangeProcessed(numRecordsRead);
if (isFullExportFile){
indexingProfile.setLastChangeProcessed(numRecordsRead);
}
if (deleteRecord && recordIdentifier != null) {
RemoveRecordFromWorkResult result = recordGroupingProcessor.removeRecordFromGroupedWork(indexingProfile.getName(), recordIdentifier.getIdentifier());
if (result.reindexWork) {
Expand All @@ -983,12 +986,14 @@ private static int updateRecordsUsingMarcExtract(ArrayList<File> exportedMarcFil
}
if (numRecordsRead % 250 == 0) {
logEntry.saveResults();
indexingProfile.updateLastChangeProcessed(dbConn, logEntry);
if (isFullExportFile) {
indexingProfile.updateLastChangeProcessed(dbConn, logEntry);
}
}
}
marcFileStream.close();

if (hasFullExportFile){
if (isFullExportFile){
indexingProfile.setLastChangeProcessed(0);
indexingProfile.updateLastChangeProcessed(dbConn, logEntry);
logEntry.addNote("Updated " + numRecordsRead + " records");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,8 @@ private static int updateRecordsUsingMarcExtract(ArrayList<File> exportedMarcFil
logEntry.saveResults();

String lastRecordProcessed = "";
if (hasFullExportFile && curBibFile.equals(fullExportFile) && indexingProfile.getLastChangeProcessed() > 0){
boolean isFullExportFile = hasFullExportFile && curBibFile.equals(fullExportFile);
if (isFullExportFile && indexingProfile.getLastChangeProcessed() > 0){
logEntry.addNote("Skipping the first " + indexingProfile.getLastChangeProcessed() + " records because they were processed previously see (Last Record ID Processed for the Indexing Profile).");
logEntry.saveResults();
}
Expand All @@ -1034,7 +1035,7 @@ private static int updateRecordsUsingMarcExtract(ArrayList<File> exportedMarcFil
DataField marc245 = curBib.getDataField(245);
boolean has245 = marc245 != null;
RecordIdentifier recordIdentifier = recordGroupingProcessor.getPrimaryIdentifierFromMarcRecord(curBib, indexingProfile);
if (hasFullExportFile && curBibFile.equals(fullExportFile) && has245 && (numRecordsRead < indexingProfile.getLastChangeProcessed())) {
if (isFullExportFile && has245 && (numRecordsRead < indexingProfile.getLastChangeProcessed())) {
//We're skipping this record because we are doing a full export that got paused part way through
if (recordIdentifier != null) {
recordGroupingProcessor.removeExistingRecord(recordIdentifier.getIdentifier());
Expand Down Expand Up @@ -1100,7 +1101,9 @@ private static int updateRecordsUsingMarcExtract(ArrayList<File> exportedMarcFil
deleteRecord = true;
}
lastIdentifier = recordIdentifier;
indexingProfile.setLastChangeProcessed(numRecordsRead);
if (isFullExportFile){
indexingProfile.setLastChangeProcessed(numRecordsRead);
}
if (deleteRecord) {
RemoveRecordFromWorkResult result = recordGroupingProcessor.removeRecordFromGroupedWork(indexingProfile.getName(), recordIdentifier.getIdentifier());
if (result.reindexWork) {
Expand All @@ -1118,12 +1121,14 @@ private static int updateRecordsUsingMarcExtract(ArrayList<File> exportedMarcFil
}
if (numRecordsRead % 250 == 0) {
logEntry.saveResults();
indexingProfile.updateLastChangeProcessed(dbConn, logEntry);
if (isFullExportFile) {
indexingProfile.updateLastChangeProcessed(dbConn, logEntry);
}
}
}
marcFileStream.close();

if (hasFullExportFile){
if (isFullExportFile){
indexingProfile.setLastChangeProcessed(0);
indexingProfile.updateLastChangeProcessed(dbConn, logEntry);
logEntry.addNote("Updated " + numRecordsRead + " records");
Expand Down
12 changes: 12 additions & 0 deletions code/web/release_notes/26.10.00/DIS-3002.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Jira: DIS-3002
Type: Bug
Developer: David Dowling (DD)
ContributingOrg: Prairie Lakes Library System
Sponsor: Prairie Lakes Library System
GroveRelease: 26.10.00
CommunityRelease: 26.11.00
Component: Indexing
Description:
- Prevent delta imports from updating Last Changed Processed record offset which would result in an incomplete full import.
NewSettings:
NewPermissions:
Loading