-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed simultaneous insertion and deletion calling.
- Loading branch information
Michael Piechotta
committed
Apr 12, 2021
1 parent
151bf70
commit 968bdca
Showing
8 changed files
with
83 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/lib/data/storage/processor/CoverageRecordProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package lib.data.storage.processor; | ||
|
||
import lib.data.storage.Storage; | ||
import lib.record.Record; | ||
import lib.util.coordinate.CoordinateTranslator; | ||
import lib.util.position.ConsumingRefPosProviderBuilder; | ||
import lib.util.position.Position; | ||
import lib.util.position.PositionProvider; | ||
|
||
/** | ||
* TODO | ||
*/ | ||
public class CoverageRecordProcessor implements GeneralRecordProcessor { | ||
|
||
private final CoordinateTranslator translator; | ||
|
||
private final Storage covStorage; | ||
|
||
public CoverageRecordProcessor( | ||
final CoordinateTranslator translator, | ||
final Storage covStorage) { | ||
|
||
this.translator = translator; | ||
this.covStorage = covStorage; | ||
} | ||
|
||
@Override | ||
public void preProcess() { | ||
// nothing to be done | ||
} | ||
|
||
@Override | ||
public void process(final Record record) { | ||
// store total coverage | ||
final PositionProvider covPosProvider = | ||
new ConsumingRefPosProviderBuilder(record, translator).build(); | ||
while (covPosProvider.hasNext()) { | ||
final Position pos = covPosProvider.next(); | ||
covStorage.increment(pos); | ||
} | ||
} | ||
|
||
@Override | ||
public void postProcess() { | ||
// nothing to be done | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters