private void flushPendingChanges() throws IOException { Arrays.sort( pendingUpdates, 0, pendingUpdatesCursor, UPDATE_SORTER ); monitor.flushPendingUpdates(); long currentLabelId = lowestLabelId; value.clear(); key.clear(); while ( currentLabelId != Long.MAX_VALUE ) { long nextLabelId = Long.MAX_VALUE; for ( int i = 0; i < pendingUpdatesCursor; i++ ) { NodeLabelUpdate update = pendingUpdates[i]; long nodeId = update.getNodeId(); nextLabelId = extractChange( update.getLabelsAfter(), currentLabelId, nodeId, nextLabelId, true, update.getTxId() ); nextLabelId = extractChange( update.getLabelsBefore(), currentLabelId, nodeId, nextLabelId, false, update.getTxId() ); } currentLabelId = nextLabelId; } flushPendingRange(); pendingUpdatesCursor = 0; }
private void flushPendingChanges() throws IOException { Arrays.sort( pendingUpdates, 0, pendingUpdatesCursor, UPDATE_SORTER ); monitor.flushPendingUpdates(); long currentLabelId = lowestLabelId; value.clear(); key.clear(); while ( currentLabelId != Long.MAX_VALUE ) { long nextLabelId = Long.MAX_VALUE; for ( int i = 0; i < pendingUpdatesCursor; i++ ) { NodeLabelUpdate update = pendingUpdates[i]; long nodeId = update.getNodeId(); nextLabelId = extractChange( update.getLabelsAfter(), currentLabelId, nodeId, nextLabelId, true, update.getTxId() ); nextLabelId = extractChange( update.getLabelsBefore(), currentLabelId, nodeId, nextLabelId, false, update.getTxId() ); } currentLabelId = nextLabelId; } flushPendingRange(); pendingUpdatesCursor = 0; }