Browse Source

add IsResourceHeavy() to command interface

pull/6079/head
chrislu 3 months ago
parent
commit
701abbb9df
  1. 4
      weed/shell/command_cluster_check.go
  2. 4
      weed/shell/command_cluster_ps.go
  3. 4
      weed/shell/command_cluster_raft_add.go
  4. 4
      weed/shell/command_cluster_raft_ps.go
  5. 4
      weed/shell/command_cluster_raft_remove.go
  6. 4
      weed/shell/command_collection_delete.go
  7. 4
      weed/shell/command_collection_list.go
  8. 4
      weed/shell/command_ec_balance.go
  9. 4
      weed/shell/command_ec_decode.go
  10. 4
      weed/shell/command_ec_encode.go
  11. 4
      weed/shell/command_ec_rebuild.go
  12. 4
      weed/shell/command_fs_cat.go
  13. 4
      weed/shell/command_fs_cd.go
  14. 4
      weed/shell/command_fs_configure.go
  15. 4
      weed/shell/command_fs_du.go
  16. 4
      weed/shell/command_fs_log.go
  17. 4
      weed/shell/command_fs_ls.go
  18. 4
      weed/shell/command_fs_merge_volumes.go
  19. 4
      weed/shell/command_fs_meta_cat.go
  20. 4
      weed/shell/command_fs_meta_change_volume_id.go
  21. 4
      weed/shell/command_fs_meta_load.go
  22. 4
      weed/shell/command_fs_meta_notify.go
  23. 4
      weed/shell/command_fs_meta_save.go
  24. 4
      weed/shell/command_fs_mkdir.go
  25. 4
      weed/shell/command_fs_mv.go
  26. 4
      weed/shell/command_fs_pwd.go
  27. 4
      weed/shell/command_fs_rm.go
  28. 4
      weed/shell/command_fs_tree.go
  29. 4
      weed/shell/command_fs_verify.go
  30. 8
      weed/shell/command_lock_unlock.go
  31. 4
      weed/shell/command_mount_configure.go
  32. 4
      weed/shell/command_mq_balance.go
  33. 4
      weed/shell/command_mq_topic_configure.go
  34. 4
      weed/shell/command_mq_topic_desc.go
  35. 4
      weed/shell/command_mq_topic_list.go
  36. 4
      weed/shell/command_remote_cache.go
  37. 4
      weed/shell/command_remote_configure.go
  38. 4
      weed/shell/command_remote_meta_sync.go
  39. 4
      weed/shell/command_remote_mount.go
  40. 4
      weed/shell/command_remote_mount_buckets.go
  41. 8
      weed/shell/command_remote_uncache.go
  42. 4
      weed/shell/command_remote_unmount.go
  43. 4
      weed/shell/command_s3_bucket_create.go
  44. 4
      weed/shell/command_s3_bucket_delete.go
  45. 4
      weed/shell/command_s3_bucket_list.go
  46. 4
      weed/shell/command_s3_bucket_quota.go
  47. 4
      weed/shell/command_s3_bucket_quota_check.go
  48. 4
      weed/shell/command_s3_circuitbreaker.go
  49. 4
      weed/shell/command_s3_clean_uploads.go
  50. 4
      weed/shell/command_s3_configure.go
  51. 4
      weed/shell/command_volume_balance.go
  52. 4
      weed/shell/command_volume_check_disk.go
  53. 4
      weed/shell/command_volume_configure_replication.go
  54. 4
      weed/shell/command_volume_copy.go
  55. 4
      weed/shell/command_volume_delete.go
  56. 4
      weed/shell/command_volume_delete_empty.go
  57. 4
      weed/shell/command_volume_fix_replication.go
  58. 4
      weed/shell/command_volume_fsck.go
  59. 4
      weed/shell/command_volume_grow.go
  60. 4
      weed/shell/command_volume_list.go
  61. 4
      weed/shell/command_volume_mark.go
  62. 4
      weed/shell/command_volume_mount.go
  63. 4
      weed/shell/command_volume_move.go
  64. 4
      weed/shell/command_volume_server_evacuate.go
  65. 4
      weed/shell/command_volume_server_leave.go
  66. 4
      weed/shell/command_volume_tier_download.go
  67. 4
      weed/shell/command_volume_tier_move.go
  68. 4
      weed/shell/command_volume_tier_upload.go
  69. 4
      weed/shell/command_volume_unmount.go
  70. 4
      weed/shell/command_volume_vacuum.go
  71. 4
      weed/shell/command_volume_vacuum_disable.go
  72. 4
      weed/shell/command_volume_vacuum_enable.go
  73. 1
      weed/shell/commands.go

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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

4
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)

4
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")

4
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)

4
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)

4
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))

4
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))

4
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)

4
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))

4
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")

4
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

4
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)

4
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))

4
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)

4
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 {

4
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))

4
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)

4
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))

4
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 {

4
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)

4
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

4
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))

4
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

8
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()

4
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)

4
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

4
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

4
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)

4
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)

4
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)

4
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
)

4
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)

4
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)

4
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)

8
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
}
}

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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

4
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\"")

4
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)

4
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)

4
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{

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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)

4
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 {

4
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 {

1
weed/shell/commands.go

@ -42,6 +42,7 @@ type command interface {
Name() string
Help() string
Do([]string, *CommandEnv, io.Writer) error
IsResourceHeavy() bool
}
var (

Loading…
Cancel
Save