1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
11 // BlockSize for a Keep "block" is 64MB.
12 const BlockSize = 64 * 1024 * 1024
14 // MinFreeKilobytes is the amount of space a Keep volume must have available
15 // in order to permit writes.
16 const MinFreeKilobytes = BlockSize / 1024
22 type KeepError struct {
28 BadRequestError = &KeepError{400, "Bad Request"}
29 UnauthorizedError = &KeepError{401, "Unauthorized"}
30 CollisionError = &KeepError{500, "Collision"}
31 RequestHashError = &KeepError{422, "Hash mismatch in request"}
32 PermissionError = &KeepError{403, "Forbidden"}
33 DiskHashError = &KeepError{500, "Hash mismatch in stored data"}
34 ExpiredError = &KeepError{401, "Expired permission signature"}
35 NotFoundError = &KeepError{404, "Not Found"}
36 VolumeBusyError = &KeepError{503, "Volume backend busy"}
37 GenericError = &KeepError{500, "Fail"}
38 FullError = &KeepError{503, "Full"}
39 SizeRequiredError = &KeepError{411, "Missing Content-Length"}
40 TooLongError = &KeepError{413, "Block is too large"}
41 MethodDisabledError = &KeepError{405, "Method disabled"}
42 ErrNotImplemented = &KeepError{500, "Unsupported configuration"}
43 ErrClientDisconnect = &KeepError{503, "Client disconnected"}
46 func (e *KeepError) Error() string {
50 // Periodically (once per interval) invoke EmptyTrash on all volumes.
51 func emptyTrash(mounts []*VolumeMount, interval time.Duration) {
52 for range time.NewTicker(interval).C {
53 for _, v := range mounts {