Konstantin Lebedev
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
0 deletions
-
weed/storage/needle/needle_read_page.go
|
@ -1,6 +1,7 @@ |
|
|
package needle |
|
|
package needle |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"fmt" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/glog" |
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/backend" |
|
|
"github.com/seaweedfs/seaweedfs/weed/storage/backend" |
|
|
. "github.com/seaweedfs/seaweedfs/weed/storage/types" |
|
|
. "github.com/seaweedfs/seaweedfs/weed/storage/types" |
|
@ -30,6 +31,11 @@ func (n *Needle) ReadNeedleData(r backend.BackendStorageFile, volumeOffset int64 |
|
|
|
|
|
|
|
|
// ReadNeedleMeta fills all metadata except the n.Data
|
|
|
// ReadNeedleMeta fills all metadata except the n.Data
|
|
|
func (n *Needle) ReadNeedleMeta(r backend.BackendStorageFile, offset int64, size Size, version Version) (err error) { |
|
|
func (n *Needle) ReadNeedleMeta(r backend.BackendStorageFile, offset int64, size Size, version Version) (err error) { |
|
|
|
|
|
defer func() { |
|
|
|
|
|
if r := recover(); r != nil { |
|
|
|
|
|
err = fmt.Errorf("panic occurred: %+v", r) |
|
|
|
|
|
} |
|
|
|
|
|
}() |
|
|
|
|
|
|
|
|
bytes := make([]byte, NeedleHeaderSize+DataSizeSize) |
|
|
bytes := make([]byte, NeedleHeaderSize+DataSizeSize) |
|
|
|
|
|
|
|
|