diff --git a/weed/shell/command_cluster_check.go b/weed/shell/command_cluster_check.go index 5c9866d29..b7c0defb1 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 22925da5b..0aa317e4a 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 6dce8d147..1c8cbdc73 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 58e7d7585..081661584 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 c885d145b..f0cafcddd 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 936f35b46..b473c5a1f 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 c277d4028..a09e41775 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 217e5750e..8dfc6aa4e 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 aa0ca5045..3097eff8c 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 3a686fc75..7429e9a6a 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 a4dfac67c..ec4fe5982 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 bdaa757f5..9272ad3ad 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 2cc28f7a2..651357bb9 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 99ef4a59f..6dc8e1ea2 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 e27ff6f6c..6204ffdbd 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 5567f76e6..974ddfa9f 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 10764175b..dfc2144a3 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 b77feb8e3..6293acf4a 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 69eee6e01..994e1ee18 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 0d350644d..d9a489cf0 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 5f6559867..5d81014d9 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 5445810ed..d0ea7c8c5 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 6a2ea6e75..a44b55dce 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 30cd26a20..859693129 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 8e609edc9..f21245501 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 d7d9819c8..ef6c000ba 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 b8445b7e9..0523620c3 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 2b2ad2cb7..a18d9e532 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 9b0e18f94..1312ab8b1 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 a214ea91c..a651c667e 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 941b7c797..9b79c19bf 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 dbe218b54..af79bba2d 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 c5721d9d9..88b1cf2ba 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 cedad6ed4..bcaca7219 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 0a193cb4e..009f6083b 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 3a44d26e4..b04968631 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 11f7696b2..8502e7699 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 3b6d92870..7f205870e 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 9dffd10eb..172a8df22 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 91375d2d2..4facb0ad7 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 25e51ff74..b597b042c 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 f461b09de..c85a35c43 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 80c8a043b..97a434ab7 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 3b2a9c6e9..1afa80f41 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 bf21a3a29..aaabdf5da 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 d603c8156..90bd685da 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 b130e4fad..db94e225d 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 2f326b079..32ff5da35 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 accce60ba..bee6b6bec 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 33c5a4cfc..a92abe277 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 e9a483f41..c452ba2b1 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 669bbaf3b..08e457e9d 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 a6acd6838..37c8dda97 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 59193f6bc..89339cb63 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 159981c93..24391a2bd 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 bb0a194e0..7af922f45 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 97b06adb5..3d699fb13 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 f40702335..a465ac501 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 026a59b7b..dd3a26f2e 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 83e3a0d6f..3f22d691d 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 acc4ad368..77a561e85 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 e4bad222e..8444ceee4 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 f92134d27..88eb2dbc5 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 bad695cd7..d74390d93 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 d0dd023af..695879404 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 e60a74735..6e195d7e8 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 5aa07a7b7..07ef3e694 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 d30e3f8e5..3fa45ff95 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 4b079b944..ce5cd18d6 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 eb95e3d3d..2a99b0aca 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 ddae744e5..87d5ff496 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 03284c92f..9f57086ae 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 e6e582376..a29436a3c 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 (