Quasardb API for PHP
Introduction Installation Compilation Configuration API Reference

Classes

  • QdbBatch
  • QdbBatchResult
  • QdbBlob
  • QdbCluster
  • QdbDeque
  • QdbEntry
  • QdbEntryCollection
  • QdbExpirableEntry
  • QdbHashSet
  • QdbInteger
  • QdbTag
  • QdbTagCollection

Exceptions

  • QdbAliasAlreadyExistsException
  • QdbAliasNotFoundException
  • QdbConnectionException
  • QdbContainerEmptyException
  • QdbException
  • QdbIncompatibleTypeException
  • QdbInputException
  • QdbOperationDisabledException
  • QdbOperationException
  • QdbProtocolException
  • QdbSystemException

Class QdbCluster

A connection to a quasardb cluster.

Example:
$cluster = new QdbCluster('qdb://127.0.0.1:2836');

$cluster->blob('key 0')->put('value 0');
$cluster->deque('key 1')->pushBack('value 1');
$cluster->integer('key 2')->add(42);
$cluster->hashSet('key 3')->insert('value 2');

Methods summary
public
# __construct( string $uri )

Connects to a quasardb cluster through the specified URI.

Connects to a quasardb cluster through the specified URI.

The URI contains the addresses of the bootstraping nodes, other nodes are discovered during the first connection. Having more than one node in the URI allows to connect to the cluster even if the first node is down.

Parameters

$uri
A quasardb URI, in the form of qdb://<address1>:<port1>[,<address2:<port2>...].

Throws

QdbConnectionRefusedException
QdbTimeoutException

Example

$cluster = new QdbCluster('qdb://127.0.0.1:2836');
public QdbBlob
# blob( string $alias )

Creates a QdbBlob associated with the specified alias.

Creates a QdbBlob associated with the specified alias.

No query is performed at this point.

Parameters

$alias
The alias of the blob (alias starting with qdb are reserved).

Returns

QdbBlob

Example

$cluster->blob('alias')->put('content');
public QdbDeque
# deque( string $alias )

Creates a QdbDeque associated with the specified alias.

Creates a QdbDeque associated with the specified alias.

No query is performed at this point.

Parameters

$alias
The alias of the queue (alias starting with qdb are reserved).

Returns

QdbDeque

Example

$cluster->deque('alias')->pushBack('content');
public QdbEntry
# entry( string $alias )

Create a QdbBlob, a QdbDeque, a QdbHashSet, a QdbInteger or a QdbTag depending on the actual type of the entry.

Create a QdbBlob, a QdbDeque, a QdbHashSet, a QdbInteger or a QdbTag depending on the actual type of the entry.

The entry must exist in the database.

Parameters

$alias
The alias of the entry (alias starting with qdb are reserved).

Returns

QdbEntry

Throws

QdbAliasNotFoundException

$entry1 = $cluster->entry('alias1'); // $entry1 is a QdbBlob $entry2 = $cluster->entry('alias2'); // $entry2 is a QdbDeque

Example

$cluster->blob('alias1')->put('content'); $cluster->deque('alias2')->pushBack('content');


public QdbHashSet
# hashSet( string $alias )

Creates a QdbHashSet associated with the specified alias.

Creates a QdbHashSet associated with the specified alias.

No query is performed at this point.

Parameters

$alias
The alias of the hash-set (alias starting with qdb are reserved).

Returns

QdbHashSet

Example

$cluster->hashSet('alias')->insert('content');
public QdbInteger
# integer( string $alias )

Creates a QdbInteger associated with the specified alias.

Creates a QdbInteger associated with the specified alias.

No query is performed at this point.

Parameters

$alias
The alias of the integer (alias starting with qdb are reserved).

Returns

QdbInteger

Example

$cluster->integer('alias')->update(42);
public
# purgeAll( integer $timeout = 300 )

Removes all the entries on all the nodes of the quasardb cluster.

Removes all the entries on all the nodes of the quasardb cluster.

This operation is not allowed by default, it must be enabled in the server configuration.

Parameters

$timeout
The maximim number of seconds for the command to execute.

Throws

QdbOperationDisabledException

Example

$cluster->purgeAll();
public QdbBatchResult
# runBatch( QdbBatch $batch )

Executes operations of a QdbBatch.

Executes operations of a QdbBatch.

Parameters

$batch
The batch to run.

Returns

QdbBatchResult

Example

$batch = new QdbBatch();
$batch->put('alias1', 'content1');
$batch->put('alias2', 'content2');
$cluster->runBatch($batch);

public QdbTag
# tag( string $alias )

Creates a QdbTag associated with the specified alias.

Creates a QdbTag associated with the specified alias.

No query is performed at this point.

Parameters

$alias
The alias of the tag (alias starting with qdb are reserved).

Returns

QdbTag

Example

$taggedEntries = $cluster->tag('alias')->getEntries();
Copyright 2009-2017 quasardb SAS Documentation generated by ApiGen