Skip to content

Extend GridFsOperations to allow for chunkSize parameters [DATAMONGO-1615] #2523

@spring-projects-issues

Description

@spring-projects-issues

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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions