Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-blockservice
Commits
2a7a5b63
Commit
2a7a5b63
authored
Oct 08, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some performance tweaks for the dagwriter write path
parent
bdf9a42a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
blockservice.go
blockservice.go
+2
-2
No files found.
blockservice.go
View file @
2a7a5b63
...
@@ -36,7 +36,7 @@ func NewBlockService(d ds.Datastore, rem exchange.Interface) (*BlockService, err
...
@@ -36,7 +36,7 @@ func NewBlockService(d ds.Datastore, rem exchange.Interface) (*BlockService, err
// AddBlock adds a particular block to the service, Putting it into the datastore.
// AddBlock adds a particular block to the service, Putting it into the datastore.
func
(
s
*
BlockService
)
AddBlock
(
b
*
blocks
.
Block
)
(
u
.
Key
,
error
)
{
func
(
s
*
BlockService
)
AddBlock
(
b
*
blocks
.
Block
)
(
u
.
Key
,
error
)
{
k
:=
b
.
Key
()
k
:=
b
.
Key
()
log
.
Debug
(
"blockservice: storing [%s] in datastore"
,
k
.
Pretty
()
)
log
.
Debug
(
"blockservice: storing [%s] in datastore"
,
k
)
// TODO(brian): define a block datastore with a Put method which accepts a
// TODO(brian): define a block datastore with a Put method which accepts a
// block parameter
// block parameter
err
:=
s
.
Datastore
.
Put
(
k
.
DsKey
(),
b
.
Data
)
err
:=
s
.
Datastore
.
Put
(
k
.
DsKey
(),
b
.
Data
)
...
@@ -53,7 +53,7 @@ func (s *BlockService) AddBlock(b *blocks.Block) (u.Key, error) {
...
@@ -53,7 +53,7 @@ func (s *BlockService) AddBlock(b *blocks.Block) (u.Key, error) {
// GetBlock retrieves a particular block from the service,
// GetBlock retrieves a particular block from the service,
// Getting it from the datastore using the key (hash).
// Getting it from the datastore using the key (hash).
func
(
s
*
BlockService
)
GetBlock
(
k
u
.
Key
)
(
*
blocks
.
Block
,
error
)
{
func
(
s
*
BlockService
)
GetBlock
(
k
u
.
Key
)
(
*
blocks
.
Block
,
error
)
{
log
.
Debug
(
"BlockService GetBlock: '%s'"
,
k
.
Pretty
()
)
log
.
Debug
(
"BlockService GetBlock: '%s'"
,
k
)
datai
,
err
:=
s
.
Datastore
.
Get
(
k
.
DsKey
())
datai
,
err
:=
s
.
Datastore
.
Get
(
k
.
DsKey
())
if
err
==
nil
{
if
err
==
nil
{
log
.
Debug
(
"Blockservice: Got data in datastore."
)
log
.
Debug
(
"Blockservice: Got data in datastore."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment