|
From: Ning L. <nin...@gm...> - 2008-04-02 00:39:50
|
On Mon, Mar 31, 2008 at 6:03 PM, Doug Cutting <cu...@ap...> wrote: > The naive approach is simply to db.getDoc() and check the version, no? Yes. The current implementation does that. I was worried about its performance because I thought db.getDoc() means retrieving a full document. But you mentioned the semantics of retrieving the outline of a document. That would work. It's time to have db.getDoc(id) and db.getDoc(id, fields)? > If the existing version is newer, then we ignore. Note that deletes > come with a version, so if the indexed version is newer than the > deletion, we ignore the delete, just like an add. Do we index a delete? > Yes, in general. We might be able to avoid it when copying new ranges > into a node, if the log is de-duplicated. But for general > synchronization I think we always need to check versions. > > So it might be worth optimizing the doc->version implementation. So the > method to add might be db.getVersion(String id). This doesn't make sense > for end users, so should be added to the Database API we use in a node, > not to the base abstract class. So we have index deletes and keep them? > Yes, that sounds reasonable. I was just questioning whether this > belongs the top-level Database API, or rather just in > HostToHostProtocol. I just want to hide as much as we can from > end-users, so that we can more freely re-arrange things underneath later. > > Eventually the top-level API might add a method like getDocs(String[] > ids, String[] fields), which looks similar, but has a different purpose. I see. Ning |