[JAVA-512] Ability to retrieve GridFSFile from oplog collection Created: 30/Jan/12  Updated: 02/Sep/15  Resolved: 02/Sep/15

Status: Closed
Project: Java Driver
Component/s: GridFS
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Richard Louapre Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When monitoring oplog for GridFS documents. It would be a good idea to have the ability to retrieve the object directly from this collection.
The current implementation does not support it GridFS document must be fetch for its collection.



 Comments   
Comment by Ross Lawley [ 02/Sep/15 ]

There is a new GridFS implementation JAVA-1713 that follows the new GridFS specification. There are no plans to support oplog collections in this way.

Comment by Scott Hernandez (Inactive) [ 30/Jan/12 ]

You do not want to query the oplog for those. You would want to be able to catch them on the stream of documents being written to the oplog so you don't have to query, and that isn't easy since the event which will trigger your "I found a gridfs file" would be the last doc in the files collection. All the chunks will be written first as you can imagine.

You are better to use the gridfs system as it will be faster, most likely in all cases.

Comment by Richard Louapre [ 30/Jan/12 ]

If I insert a new GridFS document using mongofiles utility. I can see multiple entries in oplog.rs for this operation:

  • multiple entries with ns: ....fs.chunks and one final entry with n: ....fs.files.
    It look to me that it contains all data to get GridFSFile from there. Is that correct?

Anyway if there is no performance impact to get the GridFSDile from GridFS interface I will use that option.

Comment by Scott Hernandez (Inactive) [ 30/Jan/12 ]

This doesn't make a lot of sense, unfortunately. The oplog entries are single documents and you won't have a full GridFSFile in a single document.

You should get the _id from the oplog entry (insert/update operation) and just get the GridFSFile from the GridFS interface for that file. This works well, and should be fast as the file was just updated.

Generated at Thu Feb 08 08:52:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.