mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-05-30 05:30:23 +00:00
* fix(filer): derive inodes by hash instead of a snowflake sequencer
Compute the same inode the FUSE mount would: non-hard-linked entries hash path + crtime, hard links hash their shared HardLinkId so every link resolves to one inode. Removes the snowflake inodeSequencer and the SEAWEEDFS_FILER_SNOWFLAKE_ID knob; inodes are now deterministic across filers.
* chore: remove the experimental NFS gateway
The NFS frontend ('weed nfs') was the only consumer of the inode->path index. Remove the weed/server/nfs package, the command and its registration, the integration test harness, and the CI workflow; go mod tidy drops the willscott/go-nfs and go-nfs-client dependencies.
* refactor(filer): drop the inode->path index
With the NFS gateway gone, nothing reads it. A regular file's inode is a pure hash of its path and a hard link's is a hash of its shared HardLinkId -- both derivable on demand -- so the secondary KV index and its write/remove hooks are dead. Removes filer_inode_index.go and the recordInodeIndex hooks from the store wrapper.
99 lines
1.9 KiB
Go
99 lines
1.9 KiB
Go
package command
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
|
|
flag "github.com/seaweedfs/seaweedfs/weed/util/fla9"
|
|
)
|
|
|
|
var Commands = []*Command{
|
|
cmdAdmin,
|
|
cmdAutocomplete,
|
|
cmdUnautocomplete,
|
|
cmdBackup,
|
|
cmdBenchmark,
|
|
cmdCompact,
|
|
cmdDownload,
|
|
cmdExport,
|
|
cmdFiler,
|
|
cmdFilerBackup,
|
|
cmdFilerCat,
|
|
cmdFilerCopy,
|
|
cmdFilerMetaBackup,
|
|
cmdFilerMetaTail,
|
|
cmdFilerRemoteGateway,
|
|
cmdFilerRemoteSynchronize,
|
|
cmdFilerReplicate,
|
|
cmdFilerSynchronize,
|
|
cmdFilerSyncVerify,
|
|
cmdFix,
|
|
cmdFuse,
|
|
cmdIam,
|
|
cmdMaster,
|
|
cmdMasterFollower,
|
|
cmdMini,
|
|
cmdMount,
|
|
cmdMqAgent,
|
|
cmdMqBroker,
|
|
cmdMqKafkaGateway,
|
|
cmdS3,
|
|
cmdScaffold,
|
|
cmdServer,
|
|
cmdShell,
|
|
cmdUpdate,
|
|
cmdUpload,
|
|
cmdVersion,
|
|
cmdVolume,
|
|
cmdWebDav,
|
|
cmdSftp,
|
|
cmdWorker,
|
|
}
|
|
|
|
type Command struct {
|
|
// Run runs the command.
|
|
// The args are the arguments after the command name.
|
|
Run func(cmd *Command, args []string) bool
|
|
|
|
// UsageLine is the one-line usage message.
|
|
// The first word in the line is taken to be the command name.
|
|
UsageLine string
|
|
|
|
// Short is the short description shown in the 'go help' output.
|
|
Short string
|
|
|
|
// Long is the long message shown in the 'go help <this-command>' output.
|
|
Long string
|
|
|
|
// Flag is a set of flags specific to this command.
|
|
Flag flag.FlagSet
|
|
|
|
IsDebug *bool
|
|
}
|
|
|
|
// Name returns the command's name: the first word in the usage line.
|
|
func (c *Command) Name() string {
|
|
name := c.UsageLine
|
|
i := strings.Index(name, " ")
|
|
if i >= 0 {
|
|
name = name[:i]
|
|
}
|
|
return name
|
|
}
|
|
|
|
func (c *Command) Usage() {
|
|
fmt.Fprintf(os.Stderr, "Example: weed %s\n", c.UsageLine)
|
|
fmt.Fprintf(os.Stderr, "Default Usage:\n")
|
|
c.Flag.PrintDefaults()
|
|
fmt.Fprintf(os.Stderr, "Description:\n")
|
|
fmt.Fprintf(os.Stderr, " %s\n", strings.TrimSpace(c.Long))
|
|
os.Exit(2)
|
|
}
|
|
|
|
// Runnable reports whether the command can be run; otherwise
|
|
// it is a documentation pseudo-command such as importpath.
|
|
func (c *Command) Runnable() bool {
|
|
return c.Run != nil
|
|
}
|