Incremental changes crash fix
This commit is contained in:
parent
fc4777182a
commit
9833e2a5dc
1 changed files with 12 additions and 0 deletions
|
@ -335,6 +335,9 @@ public class IncrementalChangesManager {
|
|||
|
||||
public long getUpdatesSize(String fileName){
|
||||
RegionUpdateFiles ruf = regions.get(fileName.toLowerCase());
|
||||
if(ruf == null) {
|
||||
return 0;
|
||||
}
|
||||
long size = 0;
|
||||
for (List<RegionUpdate> regionUpdates : ruf.dayUpdates.values()) {
|
||||
for (RegionUpdate regionUpdate : regionUpdates) {
|
||||
|
@ -349,6 +352,9 @@ public class IncrementalChangesManager {
|
|||
|
||||
public void deleteUpdates(String fileName){
|
||||
RegionUpdateFiles ruf = regions.get(fileName.toLowerCase());
|
||||
if(ruf == null) {
|
||||
return;
|
||||
}
|
||||
for (List<RegionUpdate> regionUpdates : ruf.dayUpdates.values()) {
|
||||
for (RegionUpdate regionUpdate : regionUpdates) {
|
||||
boolean successful = Algorithms.removeAllFiles(regionUpdate.file);
|
||||
|
@ -367,11 +373,17 @@ public class IncrementalChangesManager {
|
|||
|
||||
public long getTimestamp(String fileName) {
|
||||
RegionUpdateFiles ruf = regions.get(fileName.toLowerCase());
|
||||
if(ruf == null) {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
return getTimestamp(ruf);
|
||||
}
|
||||
|
||||
public long getMapTimestamp(String fileName) {
|
||||
RegionUpdateFiles ruf = regions.get(fileName.toLowerCase());
|
||||
if(ruf == null) {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
return ruf.mainFileInit;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue