Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Implemented Bulk Read from CouchBase in Java Code

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 390
    Answer it

    I have written a code in Java to read multiple documents in bulk from a Bucket in CouchBase. I have made it functional somehow, but I don't understand how it works.

     

     I'm making my project on NetBeans IDE. I copied this code from some website and made it work somehow. I am completely new to CouchBase and kinda okay with java. But I don't understand anything about CouchBase and it's API.

     

    Here, appbucket is my Bucket in CouchBase.


    --------------------------------------------

    ```
        List<String> docIds = new ArrayList<>();

        List<JsonDocument> docFromCouch = Observable
            .from(docIds)
     .retryWhen(RetryBuilder.anyOf(IllegalStateException.class).max(retries).delay(Delay.linear(TimeUnit.SECONDS,timeout)).build())
            .flatMap(appbucket.async()::get)
            .toList()
            .toBlocking()
            .single();
    ```

    --------------------------------------------
    This is from my pom.xml file. I don't understand this as well except this is the jar file which enables us to use certain functions.
    --------------------------------------------

    ```
        <groupId>com.couchbase.client</groupId>
        <artifactId>java-client</artifactId>
        <version>2.7.7</version>
              <type>jar</type>
    ```


    --------------------------------------------
    Although I tried to understand what these functions do and how from CouchBase Docs, but as I said I'm a newbie and all those things went over my head.
    Explanation for each function is really needed. Thanks a lot guys.

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: