Remove Unused Method from BlobStoreRepository (#46204) (#46593)

This method isn't used anymore and I forgot to delete it.
This commit is contained in:
Armin Braun 2019-09-11 16:34:24 +02:00 committed by GitHub
parent 8c9f15db44
commit 27c15f137e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 27 deletions

View File

@ -1332,31 +1332,4 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp
}
}
}
/**
* 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;
}
}