Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java View.beginIndex doesn't support multiple view indexing #47

Closed
pasin opened this issue Dec 17, 2015 · 4 comments
Closed

Java View.beginIndex doesn't support multiple view indexing #47

pasin opened this issue Dec 17, 2015 · 4 comments
Assignees
Milestone

Comments

@pasin
Copy link
Contributor

pasin commented Dec 17, 2015

Can we make the interface below support multiple view indexing?

JNIEXPORT jlong JNICALL Java_com_couchbase_cbforest_View_beginIndex
(JNIEnv *env, jobject self, jlong dbHandle, jlong viewHandle)
{
C4View* view = (C4View*)viewHandle;
C4Error error;
C4Indexer* indexer = c4indexer_begin((C4Database*)dbHandle, &view, 1, &error);
if (!indexer)
throwError(env, error);
return (jlong)indexer;
}

@hideki hideki self-assigned this Dec 17, 2015
@hideki
Copy link

hideki commented Dec 17, 2015

@hideki hideki added this to the 1.2 milestone Dec 17, 2015
@snej
Copy link
Contributor

snej commented Dec 18, 2015

The intent is that you can create multiple c4Indexers at the same time, and then iterate through the docs once, feeding each indexer its keys and values.

Looking at the API, what's missing is a version of c4indexer_enumerateDocuments that takes multiple indexers as input, computes the earliest sequence that needs to be indexed, and starts from there. Should be easy to do.

@pasin
Copy link
Contributor Author

pasin commented Dec 18, 2015

@snej I think the enumerateDocuments logic that you described above has already been implemented as C4Indexer extended from MapReduceIndexer. The only missing piece is that multiple views if available should be given to c4indexer_begin() instead of only just 1 from the current view (See beginIndex code). Probably we also need to extract an Indexer class from the View class in order to do that.

@snej
Copy link
Contributor

snej commented Dec 18, 2015

Just uploaded PR #48 to support this.

@snej snej closed this as completed in f60425d Dec 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants