checkDataIntegrity
git-svn-id: svn://home0/checkDataIntegrity@3075 71dcc7fd-b1f2-4e5d-bb8e-274146e81173
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -81,38 +81,40 @@ public class Main {
|
|||||||
.stream()
|
.stream()
|
||||||
.parallel()
|
.parallel()
|
||||||
.forEach(p0 -> {
|
.forEach(p0 -> {
|
||||||
final long cnt = count.incrementAndGet();
|
try {
|
||||||
if (cnt % 1000 == 0) {
|
final long cnt = count.incrementAndGet();
|
||||||
System.out.println(cnt);
|
if (cnt % 1000 == 0) {
|
||||||
}
|
System.out.println(cnt);
|
||||||
|
}
|
||||||
|
|
||||||
final String rel = p0.toString().substring(path0.length());
|
final String rel = p0.toString().substring(path0.length());
|
||||||
final Path p1 = Path.of(path1 + rel);
|
final Path p1 = Path.of(path1 + rel);
|
||||||
|
|
||||||
final byte[] buf0 = bufs0.get();
|
final byte[] buf0 = bufs0.get();
|
||||||
final byte[] buf1 = bufs1.get();
|
final byte[] buf1 = bufs1.get();
|
||||||
try (InputStream inputStream0 = new BufferedInputStream(new FileInputStream(p0.toFile()), 65536); InputStream inputStream1 = new BufferedInputStream(new FileInputStream(p1.toFile()), 65536)) {
|
try (InputStream inputStream0 = new BufferedInputStream(new FileInputStream(p0.toFile()), 65536); InputStream inputStream1 = new BufferedInputStream(new FileInputStream(p1.toFile()), 65536)) {
|
||||||
int len0, len1;
|
int len0, len1;
|
||||||
do {
|
do {
|
||||||
len0 = inputStream0.read(buf0);
|
len0 = inputStream0.read(buf0);
|
||||||
len1 = inputStream1.read(buf1);
|
len1 = inputStream1.read(buf1);
|
||||||
if (len0 != len1) {
|
if (len0 != len1) {
|
||||||
System.out.println(rel + ": Length mismatch");
|
System.out.println(rel + ": Length mismatch");
|
||||||
countErr.incrementAndGet();
|
countErr.incrementAndGet();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (len0 > -1 && !Arrays.equals(buf0, 0, len0, buf1, 0, len1)) {
|
if (len0 > -1 && !Arrays.equals(buf0, 0, len0, buf1, 0, len1)) {
|
||||||
System.out.println(rel + ": Data mismatch");
|
System.out.println(rel + ": Data mismatch");
|
||||||
countErr.incrementAndGet();
|
countErr.incrementAndGet();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (len0 > -1);
|
} while (len0 > -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (NoSuchFileException | FileNotFoundException | InvalidPathException ex) {
|
catch (NoSuchFileException | FileNotFoundException | InvalidPathException ex) {
|
||||||
// System.out.println(rel + ": NoSuchFileException");
|
// System.out.println(rel + ": NoSuchFileException");
|
||||||
}
|
}
|
||||||
catch (final Exception ex) {
|
catch (final Exception ex) {
|
||||||
System.out.println(rel + ": Exception: " + ex.getClass().getName() + " " + ex.getMessage());
|
System.out.println(p0 + ": Exception: " + ex.getClass().getName() + " " + ex.getMessage());
|
||||||
countErr.incrementAndGet();
|
countErr.incrementAndGet();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user