Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Feat/reconstruct dfget interface #1343

Merged

Conversation

wangforthinker
Copy link
Contributor

Ⅰ. Describe what this PR did

Define some interface of dfget to reconstruct the dfget.

Ⅱ. Does this pull request fix one issue?

NONE.

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

No need.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@wangforthinker wangforthinker force-pushed the feat/reconstruct-dfget-interface branch 5 times, most recently from 18ee22a to c9332ef Compare May 14, 2020 06:06
@codecov-io
Copy link

codecov-io commented May 14, 2020

Codecov Report

Merging #1343 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1343      +/-   ##
==========================================
+ Coverage   51.35%   51.36%   +0.01%     
==========================================
  Files         130      130              
  Lines        8576     8576              
==========================================
+ Hits         4404     4405       +1     
  Misses       3804     3804              
+ Partials      368      367       -1     
Impacted Files Coverage Δ
supernode/daemon/mgr/scheduler/manager.go 22.60% <0.00%> (+0.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f131b5f...d04b08c. Read the comment docs.

"github.com/dragonflyoss/Dragonfly/pkg/protocol/distributiondata"
)

// ClientStream defines how to organize distribution data and get read stream for range request.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use downloading task instead of range request, and the downloading task defined here supports file downloading and range downloading.

@wangforthinker wangforthinker force-pushed the feat/reconstruct-dfget-interface branch from e5191eb to 7edba40 Compare May 15, 2020 09:39
Get(key string) (interface{}, error)
Set(key string, value interface{})
Del(key string)
Extra() interface{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very clear what the Extra() is for? Maybe, use All() which returns all the meta info?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

* limitations under the License.
*/

package url
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMOP, it's unnecessary to move this file into a sub-package of pkg/protocol.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Expire(ctx context.Context) (bool, interface{}, error)

// Close the resource.
io.Closer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move it to the bottom of this interface

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Content(ctx context.Context) (io.Reader, error)
}

type EOFDataType struct{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EOF type should be private and provides public instances of EOFDataType and EOFDistributionData. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIx it。

@wangforthinker wangforthinker force-pushed the feat/reconstruct-dfget-interface branch 2 times, most recently from 648f16c to 4968d1d Compare May 16, 2020 07:52
…gister, uploader, data_protocol and url protocol.

Signed-off-by: allen.wq <[email protected]>
@wangforthinker wangforthinker force-pushed the feat/reconstruct-dfget-interface branch from 4968d1d to d04b08c Compare May 18, 2020 02:21
Copy link
Member

@lowzj lowzj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lowzj lowzj merged commit 54f0a67 into dragonflyoss:master May 18, 2020
@wangforthinker wangforthinker deleted the feat/reconstruct-dfget-interface branch May 21, 2020 06:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants