add adler to checksum, faster and is good enough with length check for our use case
This commit is contained in:
parent
a1be2bbf20
commit
0069d5a75d
|
@ -38,7 +38,7 @@ import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.zip.CRC32;
|
import java.util.zip.Adler32;
|
||||||
import java.util.zip.Checksum;
|
import java.util.zip.Checksum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -391,7 +391,10 @@ public abstract class AbstractStore extends AbstractIndexShardComponent implemen
|
||||||
// and since we, in any case, always recover the segments files
|
// and since we, in any case, always recover the segments files
|
||||||
this.digest = null;
|
this.digest = null;
|
||||||
} else {
|
} else {
|
||||||
this.digest = new CRC32();
|
// this.digest = new CRC32();
|
||||||
|
// adler is faster, and we compare on length as well, should be enough to check for difference
|
||||||
|
// between files
|
||||||
|
this.digest = new Adler32();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.digest = null;
|
this.digest = null;
|
||||||
|
|
Loading…
Reference in New Issue