Skip to content

Commit

Permalink
Remove Unused Method from BlobStoreRepository (elastic#46204)
Browse files Browse the repository at this point in the history
This method isn't used anymore and I forgot to delete it.
  • Loading branch information
original-brownbear authored and jkakavas committed Sep 2, 2019
1 parent 7a76c99 commit 964f5ad
Showing 1 changed file with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1304,31 +1304,4 @@ private static void failStoreIfCorrupted(Store store, Exception e) {
}
}
}

/**
* Checks if snapshot file already exists in the list of blobs
* @param fileInfo file to check
* @param blobs list of blobs
* @return true if file exists in the list of blobs
*/
private static boolean snapshotFileExistsInBlobs(BlobStoreIndexShardSnapshot.FileInfo fileInfo, Map<String, BlobMetaData> blobs) {
BlobMetaData blobMetaData = blobs.get(fileInfo.name());
if (blobMetaData != null) {
return blobMetaData.length() == fileInfo.length();
} else if (blobs.containsKey(fileInfo.partName(0))) {
// multi part file sum up the size and check
int part = 0;
long totalSize = 0;
while (true) {
blobMetaData = blobs.get(fileInfo.partName(part++));
if (blobMetaData == null) {
break;
}
totalSize += blobMetaData.length();
}
return totalSize == fileInfo.length();
}
// no file, not exact and not multipart
return false;
}
}

0 comments on commit 964f5ad

Please sign in to comment.