private void validate(int currentSize, int nextSize, String clusterName, ValidationOverrides overrides, Instant now) { // don't allow more than 50% reduction, but always allow to reduce size with 1 if ( nextSize < ((double)currentSize) * 0.5 && nextSize != currentSize - 1) overrides.invalid(ValidationId.clusterSizeReduction, "Size reduction in '" + clusterName + "' is too large. Current size: " + currentSize + ", new size: " + nextSize + ". New size must be at least 50% of the current size", now); }
@Override public List<ConfigChangeAction> validate(VespaModel current, VespaModel next, ValidationOverrides overrides, Instant now) { for (String currentClusterId : current.getContentClusters().keySet()) { ContentCluster nextCluster = next.getContentClusters().get(currentClusterId); if (nextCluster == null) overrides.invalid(ValidationId.contentClusterRemoval, "Content cluster '" + currentClusterId + "' is removed. " + "This will cause loss of all data in this cluster", now); } return Collections.emptyList(); }
@Override public List<ConfigChangeAction> validate(VespaModel current, VespaModel next, ValidationOverrides overrides, Instant now) { for (ContentCluster currentCluster : current.getContentClusters().values()) { ContentCluster nextCluster = next.getContentClusters().get(currentCluster.getSubId()); if (nextCluster == null) continue; // validated elsewhere for (NewDocumentType type : currentCluster.getDocumentDefinitions().values()) { if ( ! nextCluster.getDocumentDefinitions().containsKey(type.getName())) { overrides.invalid(ValidationId.contentTypeRemoval, "Type '" + type.getName() + "' is removed " + " in content cluster '" + currentCluster.getName() + "'. " + "This will cause loss of all data of this type", now); } } } return Collections.emptyList(); }