You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Lotman purge plugin relies on these parameters to function correctly,
so they need to be made configurable.
Most of the churn in this commit relates to validating/parsing the watermark
values, which may be passed as an integer-encoded percentage or an absolute
byte count.
returnfalse, 0, errors.Errorf("watermark value %s must be a integer number in range [0, 100]. Refer to parameter page for details: https://docs.pelicanplatform.org/parameters#Cache-HighWatermark", wmStr)
635
-
}
636
-
returntrue, int64(wmNum), nil
637
-
// Not an integer number, check if it's in form of <int>k|m|g|t
638
-
} else {
639
-
iflen(wmStr) <1 {
640
-
returnfalse, 0, errors.Errorf("watermark value %s is empty.", wmStr)
641
-
}
642
-
unit:=wmStr[len(wmStr)-1]
643
-
ifslices.Contains(watermarkUnits, unit) {
644
-
byteNum, err:=strconv.Atoi(wmStr[:len(wmStr)-1])
645
-
// Bytes portion is not an integer
646
-
iferr!=nil {
647
-
returnfalse, 0, errors.Errorf("watermark value %s is neither a percentage integer (e.g. 95) or a valid bytes. Refer to parameter page for details: https://docs.pelicanplatform.org/parameters#Cache-HighWatermark", wmStr)
returnfalse, 0, errors.Errorf("watermark value %s is neither a percentage integer (e.g. 95) or a valid byte. Bytes representation is missing unit (k|m|g|t). Refer to parameter page for details: https://docs.pelicanplatform.org/parameters#Cache-HighWatermark", wmStr)
660
-
}
661
-
}
662
-
} else {
663
-
// Doesn't contain k|m|g|t suffix
664
-
returnfalse, 0, errors.Errorf("watermark value %s is neither a percentage integer (e.g. 95) or a valid byte. Bytes representation is missing unit (k|m|g|t). Refer to parameter page for details: https://docs.pelicanplatform.org/parameters#Cache-HighWatermark", wmStr)
returnerrors.New("If any of Cache parameters 'FilesBaseSize', 'FilesNominalSize', or 'FilesMaxSize' is set, all three must be set")
1338
1314
}
1339
-
iflowWmNum>=highWmNum {
1340
-
returnfmt.Errorf("invalid Cache.HighWaterMark and Cache.LowWatermark values. Cache.HighWaterMark must be greater than Cache.LowWaterMark. Got %s, %s", highWmStr, lowWmStr)
1315
+
1316
+
varbase, nominal, maxfloat64
1317
+
varerrerror
1318
+
// Watermark validation will error if these parameters are not absolute, so we can ignore that output
0 commit comments