blob: 000d08b59f8a6bd8a18b76ecf36527a6ac95681b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
package com.yahoo.vespa.hosted.provision.autoscale.awsnodes;
import com.yahoo.config.provision.NodeType;
/**
* Matches the internal repo implementation
*
* @author hakonhall
* @author musum
*/
public class ReservedSpacePolicyImpl {
public long getPartitionSizeInBase2Gb(NodeType nodeType, boolean sharedHost) {
return new PartitionSizer(nodeType, sharedHost).getPartitionSize();
}
private static class PartitionSizer {
private static final long imageCountForSharedHost = 6;
private static final long imageCountForNonSharedHost = 3;
// Add a buffer to allow a small increase in image size
private static final long bufferSharedHost = 5;
private static final long bufferNonSharedHost = 3;
private final boolean sharedHost;
PartitionSizer(NodeType nodeType, boolean sharedHost) {
this.sharedHost = sharedHost;
}
long getPartitionSize() {
return imageSize() * imageCount() + buffer();
}
private long imageSize() {
return (long)7.7; // return (long)VespaContainerImage.maxImageSize(hostedSystem, nodeType);
}
private long buffer() {
return sharedHost ? bufferSharedHost : bufferNonSharedHost;
}
private long imageCount() {
return sharedHost ? imageCountForSharedHost : imageCountForNonSharedHost;
}
}
}
|