/** * @param \Kbrw\RiakBundle\Model\Cluster\Cluster $cluster * @param \Kbrw\RiakBundle\Model\Bucket\Bucket $bucket * @param string | array<string> | \Kbrw\RiakBundle\Model\KV\Data | array<\Kbrw\RiakBundle\Model\KV\Data> | \Kbrw\RiakBundle\Model\KV\Datas $datas * @return \Kbrw\RiakBundle\Model\KV\Datas */ public function fetch($cluster, $bucket, $datas) { // normalize $datas parameter $datas = $this->normalizeDatas($datas, $bucket->getFormat(), $cluster->getClientId(), true); // Split work in smaller pieces to avoid exception caused by too many opened connections $result = new Datas(); $chunks = $datas->chunk($cluster->getMaxParallelCalls()); foreach ($chunks as $chunk) { $result->addAll($this->doFetch($cluster, $bucket, $chunk)); } return $result; }
/** * @param string $key * @param mixed $data * @param \Kbrw\RiakBundle\Model\Bucket\Bucket $bucket */ protected function insertData($key, $data) { $serializedContent = $this->getService("jms_serializer")->serialize($data, $this->bucket->getFormat()); $this->bucket->riakBucketServiceClient->content[$key] = $serializedContent; $this->bucket->riakKVServiceClient->content[$key] = $serializedContent; }