protected function setUp() { parent::setUp(); $namespace = new RiakNamespace('default', 'bucket'); $store = StoreBucketProperties::builder()->withAllowMulti(true)->withNVal(3)->withNamespace($namespace)->build(); $this->client->execute($store); }
protected function setUp() { parent::setUp(); $namespace = new RiakNamespace('sets', 'sets'); $command = StoreBucketProperties::builder()->withAllowMulti(true)->withNVal(3)->withNamespace($namespace)->build(); $this->client->execute($command); $this->key = uniqid(); $this->location = new RiakLocation($namespace, $this->key); }
public function testConfigureCommitHooks() { $namespace = new RiakNamespace(null, 'bucket_hooks'); $store = StoreBucketProperties::builder($namespace)->withPostcommitHook(new NamedJsFunction('Riak.mapValuesJson'))->withPrecommitHook(new ErlangFunction('riak_kv_mapreduce', 'map_object_value'))->build(); $fetch = FetchBucketProperties::builder()->withNamespace($namespace)->build(); $storeResponse = $this->client->execute($store); $fetchResponse = $this->client->execute($fetch); $fetchProperties = $fetchResponse->getProperties(); $this->assertInstanceOf('Riak\\Client\\Core\\Query\\BucketProperties', $fetchProperties); $this->assertInstanceOf('Riak\\Client\\Command\\Bucket\\Response\\StoreBucketPropertiesResponse', $storeResponse); $this->assertInstanceOf('Riak\\Client\\Command\\Bucket\\Response\\FetchBucketPropertiesResponse', $fetchResponse); $postcommitHooks = $fetchProperties->getPostcommitHooks(); $precommitHooks = $fetchProperties->getPrecommitHooks(); $this->assertCount(1, $precommitHooks); $this->assertCount(1, $postcommitHooks); $this->assertInstanceOf('Riak\\Client\\Core\\Query\\Func\\NamedJsFunction', $precommitHooks[0]); $this->assertInstanceOf('Riak\\Client\\Core\\Query\\Func\\ErlangFunction', $postcommitHooks[0]); }
private function setUpBucket() { $this->client->execute(StoreBucketProperties::builder()->withNamespace($this->namespace)->withAllowMulti(true)->withNVal(3)->build()); }
public function testBuildCommand() { $builder = StoreBucketProperties::builder($this->namespace)->withLinkwalkFunction(new ErlangFunction('module_linkwalk', 'function'))->withChashkeyFunction(new ErlangFunction('module_chashkey', 'function'))->withPostcommitHook(new ErlangFunction('module_postcommit', 'function'))->withPrecommitHook(new ErlangFunction('module_precommit', 'function'))->withNamespace($this->namespace)->withSearchIndex('search-index')->withBackend('backend')->withLastWriteWins(true)->withBasicQuorum(true)->withNotFoundOk(true)->withAllowMulti(true)->withSmallVClock(4444)->withYoungVClock(3333)->withOldVClock(2222)->withBigVClock(11111)->withNVal(5)->withRw(2)->withDw(2)->withPr(1)->withPw(1)->withW(3)->withR(3); $this->assertInstanceOf('Riak\\Client\\Command\\Bucket\\StoreBucketProperties', $builder->build()); }
protected function setUpBucket() { $store = StoreBucketProperties::builder()->withSearchIndex($this->indexName)->withNamespace($this->namespace)->withAllowMulti(false)->build(); $this->client->execute($store); }