spring-projects / spring-projects/spring-data-mongodb
Extend GridFsOperations to allow for chunkSize parameters [DATAMONGO-1615]
@odrotbohm is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Rainer Schamm opened DATAMONGO-1615 and commented
It would be great if we could extend the GridFsOperations interface to include the chunkSize at various levels.
Increasing the chunkSize can greatly improve performance for certain data scenarios...
E.g.
...
GridFSFile store(InputStream content, String filename, String contentType, DBObject metadata, Long chunkSize);
...
and
...
GridFSFile store(InputStream content, DBObject metadata, Long chunkSize);
...
The implementation would be straight forward:
...
public GridFSFile store(InputStream content, String filename, String contentType, DBObject metadata, Long chunkSize) {
Assert.notNull(content);
GridFSInputFile file = getGridFs().createFile(content);
if (filename != null) {
file.setFilename(filename);
}
if (metadata != null) {
file.setMetaData(metadata);
}
if (contentType != null) {
file.setContentType(contentType);
}
if (chunkSize != null) {
file.setChunkSize(chunkSize);
}
file.save();
return file;
}
...
No workaround seems to be available as far as I can see.
Affects: 1.10 GA (Ingalls)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.