Github user anew commented on a diff in the pull request:
https://github.com/apache/incubator-tephra/pull/53#discussion_r138683090
--- Diff: tephra-core/src/main/java/org/apache/tephra/persist/AbstractTransactionLog.java
---
@@ -48,21 +52,30 @@
protected long timestamp;
private volatile boolean initialized;
private volatile boolean closed;
+ private AtomicLong writtenUpTo = new AtomicLong();
private AtomicLong syncedUpTo = new AtomicLong();
- private List<Entry> pendingWrites = Lists.newLinkedList();
+ private Queue<Entry> pendingWrites = new ConcurrentLinkedQueue<>();
private TransactionLogWriter writer;
- public AbstractTransactionLog(long timestamp, MetricsCollector metricsCollector) {
+ private final AtomicLong positionBeforeAppend = new AtomicLong(0);
--- End diff --
oh yes, after the refactoring in the second commit it does not need to be atomic
---
|