MCPcopy
hub / github.com/cubefs/cubefs / GetMetaPartition

Method GetMetaPartition

cli/api/metaapi.go:192–213  ·  view source on GitHub ↗
(pid uint64)

Source from the content-addressed store, hash-verified

190}
191
192func (mc *MetaHttpClient) GetMetaPartition(pid uint64) (cursor uint64, err error) {
193 defer func() {
194 if err != nil {
195 log.LogErrorf("action[GetMetaPartition],pid:%v,err:%v", pid, err)
196 }
197 }()
198 request := newAPIRequest(http.MethodGet, "/getPartitionById")
199 request.params["pid"] = fmt.Sprintf("%v", pid)
200 respData, err := mc.serveRequest(request)
201 log.LogInfof("err:%v,respData:%v\n", err, string(respData))
202 if err != nil {
203 return
204 }
205 type RstData struct {
206 Cursor uint64
207 }
208 body := &RstData{}
209 if err = json.Unmarshal(respData, body); err != nil {
210 return
211 }
212 return body.Cursor, nil
213}
214
215func (mc *MetaHttpClient) GetAllDentry(pid uint64) (dentryMap map[string]*metanode.Dentry, err error) {
216 defer func() {

Callers 5

newMetaCompatibilityCmdFunction · 0.95
canRemoveSelfMethod · 0.45
newMetaPartitionGetCmdFunction · 0.45
newVolGetInodeByIdCmdFunction · 0.45

Calls 5

serveRequestMethod · 0.95
LogErrorfFunction · 0.92
LogInfofFunction · 0.92
newAPIRequestFunction · 0.70
UnmarshalMethod · 0.65

Tested by

no test coverage detected