Skip to content

Commit

Permalink
OAK-8928: Retry reading the graph and binary references in Segment St…
Browse files Browse the repository at this point in the history
…ore migrator

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1874576 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
trekawek committed Feb 27, 2020
1 parent 2fdc431 commit 13588ba
Showing 1 changed file with 13 additions and 5 deletions.
Expand Up @@ -193,17 +193,25 @@ private void migrateSegments(SegmentArchiveReader reader, SegmentArchiveWriter w
}
}

private void migrateBinaryRef(SegmentArchiveReader reader, SegmentArchiveWriter writer) throws IOException {
Buffer binaryReferences = reader.getBinaryReferences();
private void migrateBinaryRef(SegmentArchiveReader reader, SegmentArchiveWriter writer) throws IOException, ExecutionException, InterruptedException {
Future<Buffer> future = executor.submit(() -> runWithRetry(() -> reader.getBinaryReferences(), 16, 5));
Buffer binaryReferences = future.get();
if (binaryReferences != null) {
byte[] array = fetchByteArray(binaryReferences);
writer.writeBinaryReferences(array);
}
}

private void migrateGraph(SegmentArchiveReader reader, SegmentArchiveWriter writer) throws IOException {
if (reader.hasGraph()) {
Buffer graph = reader.getGraph();
private void migrateGraph(SegmentArchiveReader reader, SegmentArchiveWriter writer) throws IOException, ExecutionException, InterruptedException {
Future<Buffer> future = executor.submit(() -> runWithRetry(() -> {
if (reader.hasGraph()) {
return reader.getGraph();
} else {
return null;
}
}, 16, 5));
Buffer graph = future.get();
if (graph != null) {
byte[] array = fetchByteArray(graph);
writer.writeGraph(array);
}
Expand Down

0 comments on commit 13588ba

Please sign in to comment.