Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

add IsResourceHeavy() to command interface

chrislu701abbb9df1b
diff --git a/weed/shell/command_cluster_check.go b/weed/shell/command_cluster_check.go
index 5c9866d29d..b7c0defb19 100644
--- a/weed/shell/command_cluster_check.go
+++ b/weed/shell/command_cluster_check.go
@@ -32,6 +32,10 @@ func (c *commandClusterCheck) Help() string {
`
}
+func (c *commandClusterCheck) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
clusterPsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_cluster_ps.go b/weed/shell/command_cluster_ps.go
index 22925da5b0..0aa317e4ad 100644
--- a/weed/shell/command_cluster_ps.go
+++ b/weed/shell/command_cluster_ps.go
@@ -35,6 +35,10 @@ func (c *commandClusterPs) Help() string {
`
}
+func (c *commandClusterPs) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
clusterPsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_cluster_raft_add.go b/weed/shell/command_cluster_raft_add.go
index 6dce8d1478..1c8cbdc73e 100644
--- a/weed/shell/command_cluster_raft_add.go
+++ b/weed/shell/command_cluster_raft_add.go
@@ -27,6 +27,10 @@ func (c *commandRaftServerAdd) Help() string {
`
}
+func (c *commandRaftServerAdd) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRaftServerAdd) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
raftServerAddCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_cluster_raft_ps.go b/weed/shell/command_cluster_raft_ps.go
index 58e7d75850..0816615847 100644
--- a/weed/shell/command_cluster_raft_ps.go
+++ b/weed/shell/command_cluster_raft_ps.go
@@ -26,6 +26,10 @@ func (c *commandRaftClusterPs) Help() string {
`
}
+func (c *commandRaftClusterPs) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRaftClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
raftClusterPsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_cluster_raft_remove.go b/weed/shell/command_cluster_raft_remove.go
index c885d145ba..f0cafcddd2 100644
--- a/weed/shell/command_cluster_raft_remove.go
+++ b/weed/shell/command_cluster_raft_remove.go
@@ -27,6 +27,10 @@ func (c *commandRaftServerRemove) Help() string {
`
}
+func (c *commandRaftServerRemove) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRaftServerRemove) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
raftServerAddCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_collection_delete.go b/weed/shell/command_collection_delete.go
index 936f35b461..b473c5a1fa 100644
--- a/weed/shell/command_collection_delete.go
+++ b/weed/shell/command_collection_delete.go
@@ -28,6 +28,10 @@ func (c *commandCollectionDelete) Help() string {
`
}
+func (c *commandCollectionDelete) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandCollectionDelete) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
colDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_collection_list.go b/weed/shell/command_collection_list.go
index c277d40284..a09e417756 100644
--- a/weed/shell/command_collection_list.go
+++ b/weed/shell/command_collection_list.go
@@ -23,6 +23,10 @@ func (c *commandCollectionList) Help() string {
return `list all collections`
}
+func (c *commandCollectionList) IsResourceHeavy() bool {
+ return false
+}
+
type CollectionInfo struct {
FileCount float64
DeleteCount float64
diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go
index 217e5750e1..8dfc6aa4ea 100644
--- a/weed/shell/command_ec_balance.go
+++ b/weed/shell/command_ec_balance.go
@@ -98,6 +98,10 @@ func (c *commandEcBalance) Help() string {
`
}
+func (c *commandEcBalance) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandEcBalance) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
balanceCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_ec_decode.go b/weed/shell/command_ec_decode.go
index aa0ca5045d..3097eff8cf 100644
--- a/weed/shell/command_ec_decode.go
+++ b/weed/shell/command_ec_decode.go
@@ -37,6 +37,10 @@ func (c *commandEcDecode) Help() string {
`
}
+func (c *commandEcDecode) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandEcDecode) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
decodeCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
volumeId := decodeCommand.Int("volumeId", 0, "the volume id")
diff --git a/weed/shell/command_ec_encode.go b/weed/shell/command_ec_encode.go
index 3a686fc751..7429e9a6ae 100644
--- a/weed/shell/command_ec_encode.go
+++ b/weed/shell/command_ec_encode.go
@@ -56,6 +56,10 @@ func (c *commandEcEncode) Help() string {
`
}
+func (c *commandEcEncode) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
encodeCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_ec_rebuild.go b/weed/shell/command_ec_rebuild.go
index a4dfac67c4..ec4fe5982d 100644
--- a/weed/shell/command_ec_rebuild.go
+++ b/weed/shell/command_ec_rebuild.go
@@ -55,6 +55,10 @@ func (c *commandEcRebuild) Help() string {
`
}
+func (c *commandEcRebuild) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandEcRebuild) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fixCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_fs_cat.go b/weed/shell/command_fs_cat.go
index bdaa757f50..9272ad3add 100644
--- a/weed/shell/command_fs_cat.go
+++ b/weed/shell/command_fs_cat.go
@@ -26,6 +26,10 @@ func (c *commandFsCat) Help() string {
`
}
+func (c *commandFsCat) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsCat) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))
diff --git a/weed/shell/command_fs_cd.go b/weed/shell/command_fs_cd.go
index 2cc28f7a2e..651357bb9e 100644
--- a/weed/shell/command_fs_cd.go
+++ b/weed/shell/command_fs_cd.go
@@ -28,6 +28,10 @@ func (c *commandFsCd) Help() string {
`
}
+func (c *commandFsCd) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsCd) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))
diff --git a/weed/shell/command_fs_configure.go b/weed/shell/command_fs_configure.go
index 99ef4a59fd..6dc8e1ea26 100644
--- a/weed/shell/command_fs_configure.go
+++ b/weed/shell/command_fs_configure.go
@@ -46,6 +46,10 @@ func (c *commandFsConfigure) Help() string {
`
}
+func (c *commandFsConfigure) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsConfigureCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go
index e27ff6f6ca..6204ffdbd8 100644
--- a/weed/shell/command_fs_du.go
+++ b/weed/shell/command_fs_du.go
@@ -29,6 +29,10 @@ func (c *commandFsDu) Help() string {
`
}
+func (c *commandFsDu) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsDu) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))
diff --git a/weed/shell/command_fs_log.go b/weed/shell/command_fs_log.go
index 5567f76e67..974ddfa9ff 100644
--- a/weed/shell/command_fs_log.go
+++ b/weed/shell/command_fs_log.go
@@ -27,6 +27,10 @@ func (c *commandFsLogPurge) Help() string {
`
}
+func (c *commandFsLogPurge) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsLogPurge) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsLogPurgeCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
daysAgo := fsLogPurgeCommand.Uint("daysAgo", 365, "purge logs older than N days")
diff --git a/weed/shell/command_fs_ls.go b/weed/shell/command_fs_ls.go
index 10764175b3..dfc2144a35 100644
--- a/weed/shell/command_fs_ls.go
+++ b/weed/shell/command_fs_ls.go
@@ -33,6 +33,10 @@ func (c *commandFsLs) Help() string {
`
}
+func (c *commandFsLs) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsLs) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
var isLongFormat, showHidden bool
diff --git a/weed/shell/command_fs_merge_volumes.go b/weed/shell/command_fs_merge_volumes.go
index b77feb8e32..6293acf4a6 100644
--- a/weed/shell/command_fs_merge_volumes.go
+++ b/weed/shell/command_fs_merge_volumes.go
@@ -44,6 +44,10 @@ func (c *commandFsMergeVolumes) Help() string {
`
}
+func (c *commandFsMergeVolumes) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsMergeVolumes) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsMergeVolumesCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_fs_meta_cat.go b/weed/shell/command_fs_meta_cat.go
index 69eee6e01b..994e1ee189 100644
--- a/weed/shell/command_fs_meta_cat.go
+++ b/weed/shell/command_fs_meta_cat.go
@@ -30,6 +30,10 @@ func (c *commandFsMetaCat) Help() string {
`
}
+func (c *commandFsMetaCat) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsMetaCat) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))
diff --git a/weed/shell/command_fs_meta_change_volume_id.go b/weed/shell/command_fs_meta_change_volume_id.go
index 0d350644d1..d9a489cf0b 100644
--- a/weed/shell/command_fs_meta_change_volume_id.go
+++ b/weed/shell/command_fs_meta_change_volume_id.go
@@ -37,6 +37,10 @@ func (c *commandFsMetaChangeVolumeId) Help() string {
`
}
+func (c *commandFsMetaChangeVolumeId) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsMetaChangeVolumeId) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsMetaChangeVolumeIdCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_fs_meta_load.go b/weed/shell/command_fs_meta_load.go
index 5f6559867e..5d81014d90 100644
--- a/weed/shell/command_fs_meta_load.go
+++ b/weed/shell/command_fs_meta_load.go
@@ -38,6 +38,10 @@ func (c *commandFsMetaLoad) Help() string {
`
}
+func (c *commandFsMetaLoad) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
if len(args) == 0 {
diff --git a/weed/shell/command_fs_meta_notify.go b/weed/shell/command_fs_meta_notify.go
index 5445810ed6..d0ea7c8c52 100644
--- a/weed/shell/command_fs_meta_notify.go
+++ b/weed/shell/command_fs_meta_notify.go
@@ -30,6 +30,10 @@ func (c *commandFsMetaNotify) Help() string {
`
}
+func (c *commandFsMetaNotify) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsMetaNotify) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))
diff --git a/weed/shell/command_fs_meta_save.go b/weed/shell/command_fs_meta_save.go
index 6a2ea6e753..a44b55dce4 100644
--- a/weed/shell/command_fs_meta_save.go
+++ b/weed/shell/command_fs_meta_save.go
@@ -44,6 +44,10 @@ func (c *commandFsMetaSave) Help() string {
`
}
+func (c *commandFsMetaSave) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsMetaSave) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsMetaSaveCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_fs_mkdir.go b/weed/shell/command_fs_mkdir.go
index 30cd26a20f..8596931292 100644
--- a/weed/shell/command_fs_mkdir.go
+++ b/weed/shell/command_fs_mkdir.go
@@ -27,6 +27,10 @@ func (c *commandFsMkdir) Help() string {
`
}
+func (c *commandFsMkdir) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsMkdir) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))
diff --git a/weed/shell/command_fs_mv.go b/weed/shell/command_fs_mv.go
index 8e609edc9a..f212455011 100644
--- a/weed/shell/command_fs_mv.go
+++ b/weed/shell/command_fs_mv.go
@@ -34,6 +34,10 @@ func (c *commandFsMv) Help() string {
`
}
+func (c *commandFsMv) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
if len(args) != 2 {
diff --git a/weed/shell/command_fs_pwd.go b/weed/shell/command_fs_pwd.go
index d7d9819c8c..ef6c000ba9 100644
--- a/weed/shell/command_fs_pwd.go
+++ b/weed/shell/command_fs_pwd.go
@@ -20,6 +20,10 @@ func (c *commandFsPwd) Help() string {
return `print out current directory`
}
+func (c *commandFsPwd) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsPwd) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fmt.Fprintf(writer, "%s\n", commandEnv.option.Directory)
diff --git a/weed/shell/command_fs_rm.go b/weed/shell/command_fs_rm.go
index b8445b7e97..0523620c3c 100644
--- a/weed/shell/command_fs_rm.go
+++ b/weed/shell/command_fs_rm.go
@@ -34,6 +34,10 @@ func (c *commandFsRm) Help() string {
`
}
+func (c *commandFsRm) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
isRecursive := false
ignoreRecursiveError := false
diff --git a/weed/shell/command_fs_tree.go b/weed/shell/command_fs_tree.go
index 2b2ad2cb7a..a18d9e532b 100644
--- a/weed/shell/command_fs_tree.go
+++ b/weed/shell/command_fs_tree.go
@@ -28,6 +28,10 @@ func (c *commandFsTree) Help() string {
`
}
+func (c *commandFsTree) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsTree) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))
diff --git a/weed/shell/command_fs_verify.go b/weed/shell/command_fs_verify.go
index 9b0e18f948..1312ab8b1d 100644
--- a/weed/shell/command_fs_verify.go
+++ b/weed/shell/command_fs_verify.go
@@ -51,6 +51,10 @@ func (c *commandFsVerify) Help() string {
`
}
+func (c *commandFsVerify) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandFsVerify) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
c.env = commandEnv
c.writer = writer
diff --git a/weed/shell/command_lock_unlock.go b/weed/shell/command_lock_unlock.go
index a214ea91c4..a651c667e6 100644
--- a/weed/shell/command_lock_unlock.go
+++ b/weed/shell/command_lock_unlock.go
@@ -25,6 +25,10 @@ func (c *commandLock) Help() string {
`
}
+func (c *commandLock) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandLock) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
commandEnv.locker.RequestLock(util.DetectedHostAddress())
@@ -47,6 +51,10 @@ func (c *commandUnlock) Help() string {
`
}
+func (c *commandUnlock) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandUnlock) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
commandEnv.locker.ReleaseLock()
diff --git a/weed/shell/command_mount_configure.go b/weed/shell/command_mount_configure.go
index 941b7c7979..9b79c19bff 100644
--- a/weed/shell/command_mount_configure.go
+++ b/weed/shell/command_mount_configure.go
@@ -34,6 +34,10 @@ func (c *commandMountConfigure) Help() string {
`
}
+func (c *commandMountConfigure) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandMountConfigure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
mountConfigureCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_mq_balance.go b/weed/shell/command_mq_balance.go
index dbe218b54c..af79bba2d6 100644
--- a/weed/shell/command_mq_balance.go
+++ b/weed/shell/command_mq_balance.go
@@ -25,6 +25,10 @@ func (c *commandMqBalanceTopics) Help() string {
`
}
+func (c *commandMqBalanceTopics) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandMqBalanceTopics) Do(args []string, commandEnv *CommandEnv, writer io.Writer) error {
// find the broker balancer
diff --git a/weed/shell/command_mq_topic_configure.go b/weed/shell/command_mq_topic_configure.go
index c5721d9d98..88b1cf2bae 100644
--- a/weed/shell/command_mq_topic_configure.go
+++ b/weed/shell/command_mq_topic_configure.go
@@ -29,6 +29,10 @@ func (c *commandMqTopicConfigure) Help() string {
`
}
+func (c *commandMqTopicConfigure) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandMqTopicConfigure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) error {
// parse parameters
diff --git a/weed/shell/command_mq_topic_desc.go b/weed/shell/command_mq_topic_desc.go
index cedad6ed4a..bcaca7219c 100644
--- a/weed/shell/command_mq_topic_desc.go
+++ b/weed/shell/command_mq_topic_desc.go
@@ -24,6 +24,10 @@ func (c *commandMqTopicDescribe) Help() string {
return `describe a topic`
}
+func (c *commandMqTopicDescribe) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandMqTopicDescribe) Do(args []string, commandEnv *CommandEnv, writer io.Writer) error {
// parse parameters
mqCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_mq_topic_list.go b/weed/shell/command_mq_topic_list.go
index 0a193cb4e0..009f6083bc 100644
--- a/weed/shell/command_mq_topic_list.go
+++ b/weed/shell/command_mq_topic_list.go
@@ -25,6 +25,10 @@ func (c *commandMqTopicList) Help() string {
return `print out all topics`
}
+func (c *commandMqTopicList) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandMqTopicList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) error {
brokerBalancer, err := findBrokerBalancer(commandEnv)
diff --git a/weed/shell/command_remote_cache.go b/weed/shell/command_remote_cache.go
index 3a44d26e47..b049686313 100644
--- a/weed/shell/command_remote_cache.go
+++ b/weed/shell/command_remote_cache.go
@@ -46,6 +46,10 @@ func (c *commandRemoteCache) Help() string {
`
}
+func (c *commandRemoteCache) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRemoteCache) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_remote_configure.go b/weed/shell/command_remote_configure.go
index 11f7696b24..8502e7699b 100644
--- a/weed/shell/command_remote_configure.go
+++ b/weed/shell/command_remote_configure.go
@@ -48,6 +48,10 @@ func (c *commandRemoteConfigure) Help() string {
`
}
+func (c *commandRemoteConfigure) IsResourceHeavy() bool {
+ return false
+}
+
var (
isAlpha = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9]*$`).MatchString
)
diff --git a/weed/shell/command_remote_meta_sync.go b/weed/shell/command_remote_meta_sync.go
index 3b6d92870b..7f205870e4 100644
--- a/weed/shell/command_remote_meta_sync.go
+++ b/weed/shell/command_remote_meta_sync.go
@@ -44,6 +44,10 @@ func (c *commandRemoteMetaSync) Help() string {
`
}
+func (c *commandRemoteMetaSync) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRemoteMetaSync) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMetaSyncCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_remote_mount.go b/weed/shell/command_remote_mount.go
index 9dffd10eb3..172a8df221 100644
--- a/weed/shell/command_remote_mount.go
+++ b/weed/shell/command_remote_mount.go
@@ -44,6 +44,10 @@ func (c *commandRemoteMount) Help() string {
`
}
+func (c *commandRemoteMount) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRemoteMount) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_remote_mount_buckets.go b/weed/shell/command_remote_mount_buckets.go
index 91375d2d2b..4facb0ad77 100644
--- a/weed/shell/command_remote_mount_buckets.go
+++ b/weed/shell/command_remote_mount_buckets.go
@@ -38,6 +38,10 @@ func (c *commandRemoteMountBuckets) Help() string {
`
}
+func (c *commandRemoteMountBuckets) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRemoteMountBuckets) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMountBucketsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_remote_uncache.go b/weed/shell/command_remote_uncache.go
index 25e51ff740..b597b042ce 100644
--- a/weed/shell/command_remote_uncache.go
+++ b/weed/shell/command_remote_uncache.go
@@ -41,6 +41,10 @@ func (c *commandRemoteUncache) Help() string {
`
}
+func (c *commandRemoteUncache) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRemoteUncache) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteUncacheCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
@@ -165,12 +169,12 @@ func (ff *FileFilter) matches(entry *filer_pb.Entry) bool {
}
}
if *ff.minAge != -1 {
- if entry.Attributes.Crtime + *ff.minAge > time.Now().Unix() {
+ if entry.Attributes.Crtime+*ff.minAge > time.Now().Unix() {
return false
}
}
if *ff.maxAge != -1 {
- if entry.Attributes.Crtime + *ff.maxAge < time.Now().Unix() {
+ if entry.Attributes.Crtime+*ff.maxAge < time.Now().Unix() {
return false
}
}
diff --git a/weed/shell/command_remote_unmount.go b/weed/shell/command_remote_unmount.go
index f461b09dec..c85a35c430 100644
--- a/weed/shell/command_remote_unmount.go
+++ b/weed/shell/command_remote_unmount.go
@@ -37,6 +37,10 @@ func (c *commandRemoteUnmount) Help() string {
`
}
+func (c *commandRemoteUnmount) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandRemoteUnmount) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_s3_bucket_create.go b/weed/shell/command_s3_bucket_create.go
index 80c8a043b9..97a434ab75 100644
--- a/weed/shell/command_s3_bucket_create.go
+++ b/weed/shell/command_s3_bucket_create.go
@@ -30,6 +30,10 @@ func (c *commandS3BucketCreate) Help() string {
`
}
+func (c *commandS3BucketCreate) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandS3BucketCreate) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_s3_bucket_delete.go b/weed/shell/command_s3_bucket_delete.go
index 3b2a9c6e94..1afa80f414 100644
--- a/weed/shell/command_s3_bucket_delete.go
+++ b/weed/shell/command_s3_bucket_delete.go
@@ -28,6 +28,10 @@ func (c *commandS3BucketDelete) Help() string {
`
}
+func (c *commandS3BucketDelete) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandS3BucketDelete) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_s3_bucket_list.go b/weed/shell/command_s3_bucket_list.go
index bf21a3a299..aaabdf5da4 100644
--- a/weed/shell/command_s3_bucket_list.go
+++ b/weed/shell/command_s3_bucket_list.go
@@ -27,6 +27,10 @@ func (c *commandS3BucketList) Help() string {
`
}
+func (c *commandS3BucketList) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandS3BucketList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_s3_bucket_quota.go b/weed/shell/command_s3_bucket_quota.go
index d603c8156f..90bd685da9 100644
--- a/weed/shell/command_s3_bucket_quota.go
+++ b/weed/shell/command_s3_bucket_quota.go
@@ -28,6 +28,10 @@ func (c *commandS3BucketQuota) Help() string {
`
}
+func (c *commandS3BucketQuota) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandS3BucketQuota) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_s3_bucket_quota_check.go b/weed/shell/command_s3_bucket_quota_check.go
index b130e4fad0..db94e225d4 100644
--- a/weed/shell/command_s3_bucket_quota_check.go
+++ b/weed/shell/command_s3_bucket_quota_check.go
@@ -29,6 +29,10 @@ func (c *commandS3BucketQuotaEnforce) Help() string {
`
}
+func (c *commandS3BucketQuotaEnforce) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandS3BucketQuotaEnforce) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_s3_circuitbreaker.go b/weed/shell/command_s3_circuitbreaker.go
index 2f326b0790..32ff5da351 100644
--- a/weed/shell/command_s3_circuitbreaker.go
+++ b/weed/shell/command_s3_circuitbreaker.go
@@ -51,6 +51,10 @@ func (c *commandS3CircuitBreaker) Help() string {
`
}
+func (c *commandS3CircuitBreaker) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandS3CircuitBreaker) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
dir := s3_constants.CircuitBreakerConfigDir
file := s3_constants.CircuitBreakerConfigFile
diff --git a/weed/shell/command_s3_clean_uploads.go b/weed/shell/command_s3_clean_uploads.go
index accce60ba7..bee6b6bec1 100644
--- a/weed/shell/command_s3_clean_uploads.go
+++ b/weed/shell/command_s3_clean_uploads.go
@@ -34,6 +34,10 @@ func (c *commandS3CleanUploads) Help() string {
`
}
+func (c *commandS3CleanUploads) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
uploadedTimeAgo := bucketCommand.Duration("timeAgo", 24*time.Hour, "created time before now. \"1.5h\" or \"2h45m\". Valid time units are \"m\", \"h\"")
diff --git a/weed/shell/command_s3_configure.go b/weed/shell/command_s3_configure.go
index 33c5a4cfcd..a92abe277b 100644
--- a/weed/shell/command_s3_configure.go
+++ b/weed/shell/command_s3_configure.go
@@ -33,6 +33,10 @@ func (c *commandS3Configure) Help() string {
`
}
+func (c *commandS3Configure) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandS3Configure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
s3ConfigureCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go
index e9a483f412..c452ba2b1c 100644
--- a/weed/shell/command_volume_balance.go
+++ b/weed/shell/command_volume_balance.go
@@ -64,6 +64,10 @@ func (c *commandVolumeBalance) Help() string {
`
}
+func (c *commandVolumeBalance) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeBalance) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
balanceCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_check_disk.go b/weed/shell/command_volume_check_disk.go
index 669bbaf3bb..08e457e9d6 100644
--- a/weed/shell/command_volume_check_disk.go
+++ b/weed/shell/command_volume_check_disk.go
@@ -48,6 +48,10 @@ func (c *commandVolumeCheckDisk) Help() string {
`
}
+func (c *commandVolumeCheckDisk) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeCheckDisk) getVolumeStatusFileCount(vid uint32, dn *master_pb.DataNodeInfo) (totalFileCount, deletedFileCount uint64) {
err := operation.WithVolumeServerClient(false, pb.NewServerAddressWithGrpcPort(dn.Id, int(dn.GrpcPort)), c.env.option.GrpcDialOption, func(volumeServerClient volume_server_pb.VolumeServerClient) error {
resp, reqErr := volumeServerClient.VolumeStatus(context.Background(), &volume_server_pb.VolumeStatusRequest{
diff --git a/weed/shell/command_volume_configure_replication.go b/weed/shell/command_volume_configure_replication.go
index a6acd6838c..37c8dda97f 100644
--- a/weed/shell/command_volume_configure_replication.go
+++ b/weed/shell/command_volume_configure_replication.go
@@ -35,6 +35,10 @@ func (c *commandVolumeConfigureReplication) Help() string {
`
}
+func (c *commandVolumeConfigureReplication) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeConfigureReplication) Do(args []string, commandEnv *CommandEnv, _ io.Writer) (err error) {
configureReplicationCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_copy.go b/weed/shell/command_volume_copy.go
index 59193f6bc3..89339cb63d 100644
--- a/weed/shell/command_volume_copy.go
+++ b/weed/shell/command_volume_copy.go
@@ -31,6 +31,10 @@ func (c *commandVolumeCopy) Help() string {
`
}
+func (c *commandVolumeCopy) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeCopy) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volCopyCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_delete.go b/weed/shell/command_volume_delete.go
index 159981c93a..24391a2bda 100644
--- a/weed/shell/command_volume_delete.go
+++ b/weed/shell/command_volume_delete.go
@@ -29,6 +29,10 @@ func (c *commandVolumeDelete) Help() string {
`
}
+func (c *commandVolumeDelete) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeDelete) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_delete_empty.go b/weed/shell/command_volume_delete_empty.go
index bb0a194e0d..7af922f45d 100644
--- a/weed/shell/command_volume_delete_empty.go
+++ b/weed/shell/command_volume_delete_empty.go
@@ -32,6 +32,10 @@ func (c *commandVolumeDeleteEmpty) Help() string {
`
}
+func (c *commandVolumeDeleteEmpty) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeDeleteEmpty) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_fix_replication.go b/weed/shell/command_volume_fix_replication.go
index 97b06adb58..3d699fb13e 100644
--- a/weed/shell/command_volume_fix_replication.go
+++ b/weed/shell/command_volume_fix_replication.go
@@ -55,6 +55,10 @@ func (c *commandVolumeFixReplication) Help() string {
`
}
+func (c *commandVolumeFixReplication) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeFixReplication) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volFixReplicationCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_fsck.go b/weed/shell/command_volume_fsck.go
index f407023352..a465ac501b 100644
--- a/weed/shell/command_volume_fsck.go
+++ b/weed/shell/command_volume_fsck.go
@@ -79,6 +79,10 @@ func (c *commandVolumeFsck) Help() string {
`
}
+func (c *commandVolumeFsck) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeFsck) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsckCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_grow.go b/weed/shell/command_volume_grow.go
index 026a59b7b5..dd3a26f2e5 100644
--- a/weed/shell/command_volume_grow.go
+++ b/weed/shell/command_volume_grow.go
@@ -30,6 +30,10 @@ func (c *commandGrow) Help() string {
`
}
+func (c *commandGrow) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandGrow) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volumeVacuumCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_list.go b/weed/shell/command_volume_list.go
index 83e3a0d6f8..3f22d691d5 100644
--- a/weed/shell/command_volume_list.go
+++ b/weed/shell/command_volume_list.go
@@ -39,6 +39,10 @@ func (c *commandVolumeList) Help() string {
`
}
+func (c *commandVolumeList) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volumeListCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_mark.go b/weed/shell/command_volume_mark.go
index acc4ad3681..77a561e853 100644
--- a/weed/shell/command_volume_mark.go
+++ b/weed/shell/command_volume_mark.go
@@ -28,6 +28,10 @@ func (c *commandVolumeMark) Help() string {
`
}
+func (c *commandVolumeMark) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeMark) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volMarkCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_mount.go b/weed/shell/command_volume_mount.go
index e4bad222e5..8444ceee4f 100644
--- a/weed/shell/command_volume_mount.go
+++ b/weed/shell/command_volume_mount.go
@@ -33,6 +33,10 @@ func (c *commandVolumeMount) Help() string {
`
}
+func (c *commandVolumeMount) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeMount) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_move.go b/weed/shell/command_volume_move.go
index f92134d27b..88eb2dbc56 100644
--- a/weed/shell/command_volume_move.go
+++ b/weed/shell/command_volume_move.go
@@ -49,6 +49,10 @@ func (c *commandVolumeMove) Help() string {
`
}
+func (c *commandVolumeMove) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeMove) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volMoveCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_server_evacuate.go b/weed/shell/command_volume_server_evacuate.go
index bad695cd73..d74390d93a 100644
--- a/weed/shell/command_volume_server_evacuate.go
+++ b/weed/shell/command_volume_server_evacuate.go
@@ -46,6 +46,10 @@ func (c *commandVolumeServerEvacuate) Help() string {
`
}
+func (c *commandVolumeServerEvacuate) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeServerEvacuate) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
vsEvacuateCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_server_leave.go b/weed/shell/command_volume_server_leave.go
index d0dd023af9..6958794046 100644
--- a/weed/shell/command_volume_server_leave.go
+++ b/weed/shell/command_volume_server_leave.go
@@ -35,6 +35,10 @@ func (c *commandVolumeServerLeave) Help() string {
`
}
+func (c *commandVolumeServerLeave) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeServerLeave) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
vsLeaveCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_tier_download.go b/weed/shell/command_volume_tier_download.go
index e60a74735e..6e195d7e84 100644
--- a/weed/shell/command_volume_tier_download.go
+++ b/weed/shell/command_volume_tier_download.go
@@ -41,6 +41,10 @@ func (c *commandVolumeTierDownload) Help() string {
`
}
+func (c *commandVolumeTierDownload) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeTierDownload) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
tierCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_tier_move.go b/weed/shell/command_volume_tier_move.go
index 5aa07a7b74..07ef3e6949 100644
--- a/weed/shell/command_volume_tier_move.go
+++ b/weed/shell/command_volume_tier_move.go
@@ -53,6 +53,10 @@ func (c *commandVolumeTierMove) Help() string {
`
}
+func (c *commandVolumeTierMove) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeTierMove) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
tierCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_tier_upload.go b/weed/shell/command_volume_tier_upload.go
index d30e3f8e59..3fa45ff955 100644
--- a/weed/shell/command_volume_tier_upload.go
+++ b/weed/shell/command_volume_tier_upload.go
@@ -56,6 +56,10 @@ func (c *commandVolumeTierUpload) Help() string {
`
}
+func (c *commandVolumeTierUpload) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeTierUpload) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
tierCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_unmount.go b/weed/shell/command_volume_unmount.go
index 4b079b9441..ce5cd18d63 100644
--- a/weed/shell/command_volume_unmount.go
+++ b/weed/shell/command_volume_unmount.go
@@ -34,6 +34,10 @@ func (c *commandVolumeUnmount) Help() string {
`
}
+func (c *commandVolumeUnmount) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVolumeUnmount) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volUnmountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_vacuum.go b/weed/shell/command_volume_vacuum.go
index eb95e3d3d9..2a99b0aca0 100644
--- a/weed/shell/command_volume_vacuum.go
+++ b/weed/shell/command_volume_vacuum.go
@@ -27,6 +27,10 @@ func (c *commandVacuum) Help() string {
`
}
+func (c *commandVacuum) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volumeVacuumCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
diff --git a/weed/shell/command_volume_vacuum_disable.go b/weed/shell/command_volume_vacuum_disable.go
index ddae744e55..87d5ff496b 100644
--- a/weed/shell/command_volume_vacuum_disable.go
+++ b/weed/shell/command_volume_vacuum_disable.go
@@ -26,6 +26,10 @@ func (c *commandDisableVacuum) Help() string {
`
}
+func (c *commandDisableVacuum) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandDisableVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
if err = commandEnv.confirmIsLocked(args); err != nil {
diff --git a/weed/shell/command_volume_vacuum_enable.go b/weed/shell/command_volume_vacuum_enable.go
index 03284c92f0..9f57086ae3 100644
--- a/weed/shell/command_volume_vacuum_enable.go
+++ b/weed/shell/command_volume_vacuum_enable.go
@@ -26,6 +26,10 @@ func (c *commandEnableVacuum) Help() string {
`
}
+func (c *commandEnableVacuum) IsResourceHeavy() bool {
+ return false
+}
+
func (c *commandEnableVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
if err = commandEnv.confirmIsLocked(args); err != nil {
diff --git a/weed/shell/commands.go b/weed/shell/commands.go
index e6e5823765..a29436a3c5 100644
--- a/weed/shell/commands.go
+++ b/weed/shell/commands.go
@@ -42,6 +42,7 @@ type command interface {
Name() string
Help() string
Do([]string, *CommandEnv, io.Writer) error
+ IsResourceHeavy() bool
}
var (