NIFI-1279: Take the FlowFile's 1-up id into account for the newest and oldest flowfile prioritizers

Signed-off-by: joewitt <joewitt@apache.org>
This commit is contained in:
Mark Payne 2015-12-18 11:20:37 -05:00 committed by joewitt
parent 1869b44682
commit bd4f31a4c2
2 changed files with 12 additions and 2 deletions

View File

@ -31,7 +31,12 @@ public class NewestFlowFileFirstPrioritizer implements FlowFilePrioritizer {
return 1; return 1;
} }
return Long.compare(o2.getLineageStartDate(), o1.getLineageStartDate()); final int lineageDateCompare = Long.compare(o2.getLineageStartDate(), o1.getLineageStartDate());
if (lineageDateCompare != 0) {
return lineageDateCompare;
}
return Long.compare(o2.getId(), o1.getId());
} }
} }

View File

@ -31,7 +31,12 @@ public class OldestFlowFileFirstPrioritizer implements FlowFilePrioritizer {
return 1; return 1;
} }
return Long.compare(o1.getLineageStartDate(), o2.getLineageStartDate()); final int lineageDateCompare = Long.compare(o1.getLineageStartDate(), o2.getLineageStartDate());
if (lineageDateCompare != 0) {
return lineageDateCompare;
}
return Long.compare(o1.getId(), o2.getId());
} }
} }