[SalesForce] Bulk API Query Explaination

So I am new to the Bulk API provided by Salesforce and I was going through their developers guide. I have few questions that need some clarification:

  1. Bulk API Query part of the guide says that one can retrieve a batch of 1GB at once and one can retrieve 15 such batches. However, I also read that there is a batch size limitation of 10,000 records. Does this apply to Bulk Query also?
  2. I went through the sample java bulk query code. And the part where the code says:
    for(int i=0; i<10000; i++) {
    Thread.sleep(i==0 ? 30 * 1000 : 30 * 1000); //30 sec
    .
    .
    .
    Many developers have explained that this 10,000 value is being used to set the batch size but I don't get it how is it being used to set the batch size. From my understanding it is just for the number of retries to check if the batch is completed.
    URL for code location in developer guide:
    https://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_using_bulk_query.htm
  3. How does creating a job determines number of batches that need to be created to retrieve all the data. Is it handled automatically? Or do we need write some code to do that?
  4. Is there a proper code sample available so that I can go through that and understand things.
  5. How do I use the PK chunking header in Java code?

Thanks,
Prateek

Best Answer

  1. This link may help: https://www.salesforce.com/us/developer/docs/api_asynch/Content/asynch_api_concepts_limits.htm

  2. When creating a job, salesforce internally decides the number of batches to be created to cover all the data. No need to write code for that.

Related Topic