code: func retrieveNsMetadata(db *couchdb.CouchDatabase, keys []string) ([]*couchdb.DocMetadata, error) {
  	// consturct one batch per group of keys based on maxBacthSize
  	maxBacthSize := ledgerconfig.GetMaxBatchUpdateSize()
  	batches := []batch{}
  	remainingKeys := keys
  	for {
  		numKeys := minimum(maxBacthSize, len(remainingKeys))
  		if numKeys == 0 {
  			break
  		}
  		batch := &subNsMetadataRetriever{db: db, keys: remainingKeys[:numKeys]}
  		batches = append(batches, batch)
  		remainingKeys = remainingKeys[numKeys:]
  	}
  	if err := executeBatches(batches); err != nil {
  		return nil, err
  	}
  	// accumulate results from each batch
  	var executionResults []*couchdb.DocMetadata
  	for _, b := range batches {
  		executionResults = append(executionResults, b.(*subNsMetadataRetriever).executionResult...)
  	}
  	return executionResults, nil
  }
docs: // retrieveNsMetadata retrieves metadata for a given namespace