MCPcopy Index your code
hub / github.com/Terry-Mao/bfs

github.com/Terry-Mao/bfs @v2.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.1.0 ↗ · + Follow
2,488 symbols 4,313 edges 161 files 633 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

bfs

bfs 是基于facebook haystack 用golang实现的小文件存储系统。



特性

  • 高吞吐量和低延迟
  • 容错性
  • 高效
  • 维护简单

安装

一、安装hbase、zookeeper

  • 参考hbase官网. 安装、启动请查看这里.
  • 参考zookeeper官网. 安装、启动请查看这里.

二、搭建golang、python环境

  • 参考golang官网. 安装请查看这里.
  • 参考python官网. 安装请查看[这里] (https://www.python.org/)

三、安装gosnowflake

四、部署

1.下载bfs及依赖包

$ go get -u github.com/Terry-Mao/bfs
$ cd /data/apps/go/src/github.com/Terry-Mao/bfs
$ go get ./...

2.安装directory、store、pitchfork、proxy模块(配置文件请依据实际机器环境配置)

$ cd $GOPATH/src/github.com/Terry-Mao/bfs/directory
$ go install
$ cp directory.toml $GOPATH/bin/directory.toml
$ cd ../store/
$ go install
$ cp store.toml $GOPATH/bin/store.toml
$ cd ../pitchfork/
$ go install
$ cp pitchfork.toml $GOPATH/bin/pitchfork.toml
$ cd ../proxy
$ go install
$ cp proxy.toml $GOPATH/bin/proxy.toml

到此所有的环境都搭建完成!

五、启动

$ cd /$GOPATH/bin
$ nohup $GOPATH/bin/directory -c $GOPATH/bin/directory.toml &
$ nohup $GOPATH/bin/store -c $GOPATH/bin/store.toml &
$ nohup $GOPATH/bin/pitchfork -c $GOPATH/bin/pitchfork.toml &
$ nohup $GOPATH/bin/proxy -c $GOPATH/bin/proxy.toml &
$ cd $GOPATH/github.com/Terry-Mao/bfs/ops
$ nohup python runserver.py &

六、测试

  • bfs初始化,分配存储空间,请查看这里
  • 请求bfs,请查看这里

集群

Aaron Swartz

directory

  • directory主要负责请求的均匀调度和元数据管理,元数据存放在hbase,由gosnowflake产生文件key

store

  • store主要负责文件的物理存储

pitchfork

  • pitchfork负责监控store的服务状态、可用性和磁盘状态

proxy

  • proxy作为bfs存储的代理以及维护bucket相关

ops

  • ops作为bfs的后台管理界面,负责分配存储、扩容、压缩等维护工作

API

api文档

更多

Extension points exported contracts — how you extend this code

Conn (Interface)
Conn represents a connection to a Memcache server. Command Reference: https://github.com/memcached/memcached/wiki/Comman [4 …
libs/memcache/gomemcache/memcache/memcache.go
Filter (Interface)
Filter is TODO [2 implementers]
libs/gohbase/filter/filter.go
Client (Interface)
Client a regular HBase client [1 implementers]
libs/gohbase/client.go
AdminClient (Interface)
AdminClient to perform admistrative operations with HMaster [1 implementers]
libs/gohbase/client.go
Comparator (Interface)
Comparator is TODO [1 implementers]
libs/gohbase/filter/comparator.go
Call (Interface)
Call represents an HBase RPC call.
libs/gohbase/hrpc/call.go

Core symbols most depended-on inside this repo

Error
called by 136
libs/errors/errors.go
Close
called by 85
libs/gohbase/client.go
Get
called by 69
libs/gohbase/client.go
Set
called by 55
store/index/ring.go
Write
called by 38
store/index/index.go
Info
called by 34
libs/meta/store.go
Add
called by 28
store/index/index.go
Error
called by 25
libs/gohbase/region/client.go

Shape

Method 1,752
Struct 337
Function 314
TypeAlias 69
Interface 8
Route 5
FuncType 2
Class 1

Languages

Go99%
Python1%

Modules by API surface

libs/gohbase/pb/Master.pb.go462 symbols
libs/gohbase/pb/Client.pb.go258 symbols
libs/gohbase/pb/Filter.pb.go172 symbols
libs/gohbase/pb/HBase.pb.go156 symbols
libs/gohbase/pb/ClusterStatus.pb.go101 symbols
libs/gohbase/filter/filter.go98 symbols
libs/gohbase/pb/ZooKeeper.pb.go90 symbols
libs/gohbase/client.go74 symbols
libs/gohbase/pb/RPC.pb.go57 symbols
libs/gohbase/pb/Comparator.pb.go54 symbols
libs/gohbase/pb/Quota.pb.go47 symbols
libs/gohbase/hrpc/call.go37 symbols

For agents

$ claude mcp add bfs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact