@@ -285,7 +285,7 @@ public long howMuchFallBehind() {
285
285
if (this .mappedFiles .isEmpty ())
286
286
return 0 ;
287
287
288
- long committed = this .flushedWhere ;
288
+ long committed = this .getFlushedWhere () ;
289
289
if (committed != 0 ) {
290
290
MappedFile mappedFile = this .getLastMappedFile (0 , false );
291
291
if (mappedFile != null ) {
@@ -442,11 +442,11 @@ public long getMaxWrotePosition() {
442
442
}
443
443
444
444
public long remainHowManyDataToCommit () {
445
- return getMaxWrotePosition () - committedWhere ;
445
+ return getMaxWrotePosition () - getCommittedWhere () ;
446
446
}
447
447
448
448
public long remainHowManyDataToFlush () {
449
- return getMaxOffset () - flushedWhere ;
449
+ return getMaxOffset () - this . getFlushedWhere () ;
450
450
}
451
451
452
452
public void deleteLastMappedFile () {
@@ -616,15 +616,15 @@ public int deleteExpiredFileByOffsetForTimerLog(long offset, int checkOffset, in
616
616
617
617
public boolean flush (final int flushLeastPages ) {
618
618
boolean result = true ;
619
- MappedFile mappedFile = this .findMappedFileByOffset (this .flushedWhere , this .flushedWhere == 0 );
619
+ MappedFile mappedFile = this .findMappedFileByOffset (this .getFlushedWhere () , this .getFlushedWhere () == 0 );
620
620
if (mappedFile != null ) {
621
621
long tmpTimeStamp = mappedFile .getStoreTimestamp ();
622
622
int offset = mappedFile .flush (flushLeastPages );
623
623
long where = mappedFile .getFileFromOffset () + offset ;
624
- result = where == this .flushedWhere ;
625
- this .flushedWhere = where ;
624
+ result = where == this .getFlushedWhere () ;
625
+ this .setFlushedWhere ( where ) ;
626
626
if (0 == flushLeastPages ) {
627
- this .storeTimestamp = tmpTimeStamp ;
627
+ this .setStoreTimestamp ( tmpTimeStamp ) ;
628
628
}
629
629
}
630
630
@@ -633,12 +633,12 @@ public boolean flush(final int flushLeastPages) {
633
633
634
634
public synchronized boolean commit (final int commitLeastPages ) {
635
635
boolean result = true ;
636
- MappedFile mappedFile = this .findMappedFileByOffset (this .committedWhere , this .committedWhere == 0 );
636
+ MappedFile mappedFile = this .findMappedFileByOffset (this .getCommittedWhere () , this .getCommittedWhere () == 0 );
637
637
if (mappedFile != null ) {
638
638
int offset = mappedFile .commit (commitLeastPages );
639
639
long where = mappedFile .getFileFromOffset () + offset ;
640
- result = where == this .committedWhere ;
641
- this .committedWhere = where ;
640
+ result = where == this .getCommittedWhere () ;
641
+ this .setCommittedWhere ( where ) ;
642
642
}
643
643
644
644
return result ;
@@ -763,7 +763,7 @@ public void destroy() {
763
763
mf .destroy (1000 * 3 );
764
764
}
765
765
this .mappedFiles .clear ();
766
- this .flushedWhere = 0 ;
766
+ this .setFlushedWhere ( 0 ) ;
767
767
768
768
// delete parent directory
769
769
File file = new File (storePath );
@@ -848,6 +848,10 @@ public long getStoreTimestamp() {
848
848
return storeTimestamp ;
849
849
}
850
850
851
+ public void setStoreTimestamp (long storeTimestamp ) {
852
+ this .storeTimestamp = storeTimestamp ;
853
+ }
854
+
851
855
public List <MappedFile > getMappedFiles () {
852
856
return mappedFiles ;
853
857
}
0 commit comments