aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_configure.go
diff options
context:
space:
mode:
authorGuang Jiong Lou <7991675+27149chen@users.noreply.github.com>2025-01-01 10:41:43 +0800
committerGitHub <noreply@github.com>2024-12-31 18:41:43 -0800
commit3b1ac77e1f34ec561191073db5ee859cef714c0f (patch)
treeb9b5b8b654e9211470f78716f0e7eb73e8289356 /weed/shell/command_fs_configure.go
parent0e8e6122d559ea4f055cbd7a1b17d00bfc79bed5 (diff)
downloadseaweedfs-3b1ac77e1f34ec561191073db5ee859cef714c0f.tar.xz
seaweedfs-3b1ac77e1f34ec561191073db5ee859cef714c0f.zip
worm grace period and retention time support (#6404)
Signed-off-by: lou <alex1988@outlook.com>
Diffstat (limited to 'weed/shell/command_fs_configure.go')
-rw-r--r--weed/shell/command_fs_configure.go30
1 files changed, 17 insertions, 13 deletions
diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go
index 2dc1e1a14..35f49688d 100644
--- a/weed/shell/command_fs_configure.go
+++ b/weed/shell/command_fs_configure.go
@@ -61,6 +61,8 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io
fsync := fsConfigureCommand.Bool("fsync", false, "fsync for the writes")
isReadOnly := fsConfigureCommand.Bool("readOnly", false, "disable writes")
worm := fsConfigureCommand.Bool("worm", false, "write-once-read-many, written files are readonly")
+ wormGracePeriod := fsConfigureCommand.Uint64("wormGracePeriod", 0, "grace period before worm is enforced, in seconds")
+ wormRetentionTime := fsConfigureCommand.Uint64("wormRetentionTime", 0, "retention time for a worm enforced file, in seconds")
maxFileNameLength := fsConfigureCommand.Uint("maxFileNameLength", 0, "file name length limits in bytes for compatibility with Unix-based systems")
dataCenter := fsConfigureCommand.String("dataCenter", "", "assign writes to this dataCenter")
rack := fsConfigureCommand.String("rack", "", "assign writes to this rack")
@@ -80,19 +82,21 @@ func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io
if *locationPrefix != "" {
infoAboutSimulationMode(writer, *apply, "-apply")
locConf := &filer_pb.FilerConf_PathConf{
- LocationPrefix: *locationPrefix,
- Collection: *collection,
- Replication: *replication,
- Ttl: *ttl,
- Fsync: *fsync,
- MaxFileNameLength: uint32(*maxFileNameLength),
- DiskType: *diskType,
- VolumeGrowthCount: uint32(*volumeGrowthCount),
- ReadOnly: *isReadOnly,
- DataCenter: *dataCenter,
- Rack: *rack,
- DataNode: *dataNode,
- Worm: *worm,
+ LocationPrefix: *locationPrefix,
+ Collection: *collection,
+ Replication: *replication,
+ Ttl: *ttl,
+ Fsync: *fsync,
+ MaxFileNameLength: uint32(*maxFileNameLength),
+ DiskType: *diskType,
+ VolumeGrowthCount: uint32(*volumeGrowthCount),
+ ReadOnly: *isReadOnly,
+ DataCenter: *dataCenter,
+ Rack: *rack,
+ DataNode: *dataNode,
+ Worm: *worm,
+ WormGracePeriodSeconds: *wormGracePeriod,
+ WormRetentionTimeSeconds: *wormRetentionTime,
}
// check collection