Support for content-level compression (#1076)

* cli: added a flag to create repository with v2 index features

* content: plumb through compression.ID parameter to content.Manager.WriteContent()

* content: expose content.Manager.SupportsContentCompression

This allows object manager to decide whether to create compressed object
or let the content manager do it.

* object: if compression is requested and the repo supports it, pass compression ID to the content manager

* cli: show compression status in 'repository status'

* cli: output compression information in 'content list' and 'content stats'

* content: compression and decompression support

* content: unit tests for compression

* object: compression tests

* testing: added integration tests against v2 index

* testing: run all e2e tests with and without content-level compression

* htmlui: added UI for specifying index format on creation

* cli: additional tests for 'content ls' and 'content stats'

* applied pr suggestions
This commit is contained in:
Jarek Kowalski
2021-05-22 05:35:27 -07:00
committed by GitHub
parent 99b7a6e5d2
commit 40510c043d
36 changed files with 915 additions and 362 deletions

View File

@@ -61,6 +61,7 @@ export class SetupRepository extends Component {
hash: result.data.defaultHash,
encryption: result.data.defaultEncryption,
splitter: result.data.defaultSplitter,
indexVersion: "",
});
});
axios.get('/api/v1/current-user').then(result => {
@@ -107,7 +108,7 @@ export class SetupRepository extends Component {
return;
}
const request = {
let request = {
storage: {
type: this.state.provider,
config: this.state.providerSettings,
@@ -124,6 +125,10 @@ export class SetupRepository extends Component {
},
};
if (this.state.indexVersion) {
request.options.blockFormat.indexVersion = parseInt(this.state.indexVersion)
}
request.clientOptions = this.clientOptions();
axios.post('/api/v1/repo/create', request).then(result => {
@@ -360,6 +365,18 @@ export class SetupRepository extends Component {
{this.state.algorithms.splitter.map(x => <option key={x} value={x}>{x}</option>)}
</Form.Control>
</Form.Group>
<Form.Group as={Col}>
<Form.Label className="required">Index Format</Form.Label>
<Form.Control as="select"
name="indexVersion"
onChange={this.handleChange}
data-testid="control-indexVersion"
value={this.state.indexVersion}>
<option value="">(default)</option>
<option value={1}>v1</option>
<option value={2}>v2 (experimental)</option>
</Form.Control>
</Form.Group>
</Form.Row>
{this.overrideUsernameHostnameRow()}
<Form.Row>