|
Cassandra PHP Client Library
Cassandra PHP-based client library for managing and querying your Cassandra cluster.
|
Public Member Functions | |
| __clone () | |
| useKeyspace ($keyspace, $username=null, $password=null) | |
| getCluster () | |
| getConnection () | |
| closeConnections () | |
| getClient () | |
| setMaxCallRetries ($retryCount) | |
| setDefaultColumnCount ($columnCountLimit) | |
| call () | |
| describeKeyspace ($keyspace=null) | |
| getKeyspaceSchema ($keyspace=null, $useCache=true) | |
| getVersion () | |
| cf ($name) | |
| columnFamily ($name) | |
| get ($request, $consistency=null) | |
| set ($key, array $columns, $consistency=null) | |
| createKeyspace ($name, $replicationFactor=1, $placementStrategyClass=self::PLACEMENT_SIMPLE, $placementStrategyOptions=null) | |
| updateKeyspace ($name, $replicationFactor=1, $placementStrategyClass=self::PLACEMENT_SIMPLE, $placementStrategyOptions=null) | |
| dropKeyspace ($name) | |
| createStandardColumnFamily ($keyspace, $name, $columns=array(), $comparatorType=Cassandra::TYPE_UTF8, $defaultValidationClass=Cassandra::TYPE_UTF8, $comment=null, $rowCacheSize=null, $keyCacheSize=null, $readRepairChance=null, $cgGraceSeconds=null, $minCompactionThreshold=null, $maxCompactionThreshold=null, $rowCacheSavePeriodSeconds=null, $keyCacheSavePeriodSeconds=null, $memtableFlushAfterMins=null, $memtableFlushAfterThroughputMb=null, $memtableFlushAfterOpsMillions=null) | |
| createSuperColumnFamily ($keyspace, $name, $columns=array(), $comparatorType=Cassandra::TYPE_UTF8, $subcomparatorType=Cassandra::TYPE_UTF8, $defaultValidationClass=Cassandra::TYPE_UTF8, $comment=null, $rowCacheSize=null, $keyCacheSize=null, $readRepairChance=null, $cgGraceSeconds=null, $minCompactionThreshold=null, $maxCompactionThreshold=null, $rowCacheSavePeriodSeconds=null, $keyCacheSavePeriodSeconds=null, $memtableFlushAfterMins=null, $memtableFlushAfterThroughputMb=null, $memtableFlushAfterOpsMillions=null) | |
| createColumnFamily ($keyspace, $name, $columnType=Cassandra::COLUMN_STANDARD, $columns=array(), $comparatorType=Cassandra::TYPE_UTF8, $subcomparatorType=null, $defaultValidationClass=Cassandra::TYPE_UTF8, $comment=null, $rowCacheSize=null, $keyCacheSize=null, $readRepairChance=null, $cgGraceSeconds=null, $minCompactionThreshold=null, $maxCompactionThreshold=null, $rowCacheSavePeriodSeconds=null, $keyCacheSavePeriodSeconds=null, $memtableFlushAfterMins=null, $memtableFlushAfterThroughputMb=null, $memtableFlushAfterOpsMillions=null) | |
| truncate ($columnFamilyName) | |
Static Public Member Functions | |
| static | createInstance (array $servers, $name= 'main') |
| static | getInstance ($name= 'main') |
| static | escape ($value) |
| static | unescape ($value) |
Data Fields | |
| const | CONSISTENCY_ONE = cassandra_ConsistencyLevel::ONE |
| const | CONSISTENCY_QUORUM = cassandra_ConsistencyLevel::QUORUM |
| const | CONSISTENCY_ANY = cassandra_ConsistencyLevel::ANY |
| const | CONSISTENCY_ALL = cassandra_ConsistencyLevel::ALL |
| const | COLUMN_STANDARD = 'Standard' |
| const | COLUMN_SUPER = 'Super' |
| const | TYPE_ASCII = 'AsciiType' |
| const | TYPE_BYTES = 'BytesType' |
| const | TYPE_LEXICAL_UUID = 'LexicalUUIDType' |
| const | TYPE_TIME_UUID = 'TimeUUIDType' |
| const | TYPE_LONG = 'LongType' |
| const | TYPE_INTEGER = 'IntegerType' |
| const | TYPE_UTF8 = 'UTF8Type' |
| const | OP_EQ = cassandra_IndexOperator::EQ |
| const | OP_LT = cassandra_IndexOperator::LT |
| const | OP_GT = cassandra_IndexOperator::GT |
| const | OP_LTE = cassandra_IndexOperator::LTE |
| const | OP_GTE = cassandra_IndexOperator::GTE |
| const | PLACEMENT_SIMPLE = 'org.apache.cassandra.locator.SimpleStrategy' |
| const | PLACEMENT_NETWORK = 'org.apache.cassandra.locator.NetworkTopologyStrategy' |
| const | PLACEMENT_OLD_NETWORK = 'org.apache.cassandra.locator.OldNetworkTopologyStrategy' |
| const | INDEX_KEYS = 0 |
Protected Member Functions | |
| registerKeyspace ($keyspace, $username=null, $password=null) | |
| parseRequest ($request) | |
| createColumnDefinition (array $info) | |
Static Protected Member Functions | |
| static | getKeyspaceRequiredMethods () |
Protected Attributes | |
| $cluster | |
| $maxCallRetries = 5 | |
| $defaultColumnCount = 100 | |
| $columnFamilies = array() | |
| $keyspaceAuthentication = array() | |
| $autopack = true | |
Static Protected Attributes | |
| static | $instances = array() |
| static | $keyspaceRequiredMethods |
| static | $requestKeyTokens = array('.', ':', ',', '-', '|') |
Private Member Functions | |
| __construct (array $servers=array(), $autopack=true) |
The main Cassandra client class providing means to manage keyspaces and column families, get info about schema, fetch and store data.
Definition at line 555 of file Cassandra.php.
| Cassandra::__construct | ( | array $ | servers = array() , |
| $ | autopack = true |
||
| ) | [private] |
Sets the list of servers to use and whether keys and values should be automatically packed to the correct format as defined by column families column metadata.
| array | $servers | Array of server connection details. |
| type | $autopack | Should keys and data be autopacked. |
Definition at line 779 of file Cassandra.php.
{ $this->cluster = new CassandraCluster($servers); $this->autopack = $autopack; }
| Cassandra::__clone | ( | ) |
Prevent users cloning the instance.
Definition at line 787 of file Cassandra.php.
{
trigger_error('Clone is not allowed.', E_USER_ERROR);
}
| Cassandra::call | ( | ) |
Makes a call to a Cassandra node.
This method accepts a variable number of parameters where the first one is the Cassandra client method name and the rest the parameters to pass to it.
If a call fails, it will be retried for {
| CassandraInvalidRequestException | If the request is invalid |
| CassandraMaxRetriesException | If The call failed all retries |
Definition at line 943 of file Cassandra.php.
{ $args = func_get_args(); $methodName = array_shift($args); $tries = $this->maxCallRetries; $lastException = null; $keyspaceRequiredMethods = self::getKeyspaceRequiredMethods(); if ( in_array($methodName, $keyspaceRequiredMethods) && $this->cluster->getCurrentKeyspace() === null ) { throw new CassandraInvalidRequestException( 'Unable to call "'.$methodName.'", no keyspace has been set' ); } $try = 0; while($tries-- > 0) { $client = $this->getClient(); $try++; try { return call_user_func_array(array($client, $methodName), $args); } catch (Exception $e) { $lastException = $e; usleep(0.1 * pow(2, $try) * 1000000); } } throw new CassandraMaxRetriesException( 'Failed calling "'.$methodName.'" the maximum of '. $this->maxCallRetries.' times', $lastException->getCode(), $lastException ); }
| Cassandra::cf | ( | $ | name | ) |
Column family factory for manipulating a specific column family.
| string | $name | Name of the column family. |
Definition at line 1100 of file Cassandra.php.
{ if (!isset($this->columnFamilies[$name])) { $this->columnFamilies[$name] = new CassandraColumnFamily( $this, $name, Cassandra::CONSISTENCY_ONE, Cassandra::CONSISTENCY_ONE, $this->autopack ); } return $this->columnFamilies[$name]; }
| Cassandra::closeConnections | ( | ) |
Closes all open connections to nodes.
Proxies the call to cluster.
Definition at line 894 of file Cassandra.php.
{ $this->cluster->closeConnections(); }
| Cassandra::columnFamily | ( | $ | name | ) |
Column family factory for manipulating a specific column family.
Alias to {
| string | $name | Name of the column family. |
Definition at line 1122 of file Cassandra.php.
{ return $this->cf($name); }
| Cassandra::createColumnDefinition | ( | array $ | info | ) | [protected] |
Creates column definition.
| array | $info | Column info |
Definition at line 1690 of file Cassandra.php.
{ $def = new cassandra_ColumnDef(); $def->name = $info['name']; if (!empty($info['type'])) { $def->validation_class = $info['type']; } if (isset($info['index-type'])) { $def->index_type = $info['index-type']; } if (!empty($info['index-name'])) { $def->index_type = $info['index-name']; } return $def; }
| Cassandra::createColumnFamily | ( | $ | keyspace, |
| $ | name, | ||
| $ | columnType = Cassandra::COLUMN_STANDARD , |
||
| $ | columns = array() , |
||
| $ | comparatorType = Cassandra::TYPE_UTF8 , |
||
| $ | subcomparatorType = null , |
||
| $ | defaultValidationClass = Cassandra::TYPE_UTF8 , |
||
| $ | comment = null , |
||
| $ | rowCacheSize = null , |
||
| $ | keyCacheSize = null , |
||
| $ | readRepairChance = null , |
||
| $ | cgGraceSeconds = null , |
||
| $ | minCompactionThreshold = null , |
||
| $ | maxCompactionThreshold = null , |
||
| $ | rowCacheSavePeriodSeconds = null , |
||
| $ | keyCacheSavePeriodSeconds = null , |
||
| $ | memtableFlushAfterMins = null , |
||
| $ | memtableFlushAfterThroughputMb = null , |
||
| $ | memtableFlushAfterOpsMillions = null |
||
| ) |
Creates a new column family, either standard or super.
You might want to use the {
| string | $keyspace | Keyspace to create in |
| string | $name | Name of the column family |
| array | $columns | Column metadata |
| string | $comparatorType | Key comparator type |
| string | $defaultValidationClass | Default column value type |
| string | $comment | Free text comment |
| integer | $rowCacheSize | Row cache size |
| integer | $keyCacheSize | Key cache size |
| float | $readRepairChance | Change for read repair 0..1 |
| integer | $cgGraceSeconds | Carbage collection period |
| integer | $minCompactionThreshold | Minimum compaction threshold |
| integer | $maxCompactionThreshold | Maximum compaction threshold |
| integer | $rowCacheSavePeriodSeconds | Row cache saving period |
| integer | $keyCacheSavePeriodSeconds | Key cache saving period |
| integer | $memtableFlushAfterMins | Memtable flush after minutes |
| integer | $memtableFlushAfterThroughputMb | Memtable flush after data |
| integer | $memtableFlushAfterOpsMillions | Flush after operations |
Definition at line 1433 of file Cassandra.php.
{ $columnMetadata = null; if (!empty($columns)) { $columnMetadata = array(); foreach ($columns as $column) { $columnMetadata[] = $this->createColumnDefinition($column); } } $def = new cassandra_CfDef(); $def->keyspace = $keyspace; $def->name = $name; $def->column_type = $columnType; $def->comparator_type = $comparatorType; $def->subcomparator_type = $subcomparatorType; $def->comment = $comment; $def->row_cache_size = $rowCacheSize; if ($keyCacheSize !== null) { $def->key_cache_size = $keyCacheSize; } $def->read_repair_chance = $readRepairChance; $def->column_metadata = $columnMetadata; $def->gc_grace_seconds = $cgGraceSeconds; $def->default_validation_class = $defaultValidationClass; $def->min_compaction_threshold = $minCompactionThreshold; $def->max_compaction_threshold = $maxCompactionThreshold; $def->row_cache_save_period_in_seconds = $rowCacheSavePeriodSeconds; $def->key_cache_save_period_in_seconds = $keyCacheSavePeriodSeconds; $def->memtable_flush_after_mins = $memtableFlushAfterMins; $def->memtable_throughput_in_mb = $memtableFlushAfterThroughputMb; $def->memtable_operations_in_millions = $memtableFlushAfterOpsMillions; return $this->call('system_add_column_family', $def); }
| static Cassandra::createInstance | ( | array $ | servers, |
| $ | name = 'main' |
||
| ) | [static] |
Creates a new named cassandra instance.
The name can be used in {
| array | $servers | List of seed servers to connect to |
| type | $name | Name of the instance |
Definition at line 801 of file Cassandra.php.
{ self::$instances[$name] = new self($servers); return self::$instances[$name]; }
| Cassandra::createKeyspace | ( | $ | name, |
| $ | replicationFactor = 1 , |
||
| $ | placementStrategyClass = self::PLACEMENT_SIMPLE , |
||
| $ | placementStrategyOptions = null |
||
| ) |
Creates a new keyspace.
Note that the replication factor means how many nodes hold a single piece of information, not to how many nodes its replicated to so a replication factor of one means that a single node has data and no replication is performed.
| string | $name | Name of the keyspace |
| integer | $replicationFactor | How many nodes hold each piece of data |
| string | $placementStrategyClass | Data placement strategy |
| array | $placementStrategyOptions | Strategy options |
| Exception | If anything goes wrong |
Definition at line 1207 of file Cassandra.php.
{ $def = new cassandra_KsDef(); $def->name = $name; $def->strategy_class = $placementStrategyClass; $def->strategy_options = $placementStrategyOptions; $def->cf_defs = array(); $def->replication_factor = $replicationFactor; return $this->call('system_add_keyspace', $def); }
| Cassandra::createStandardColumnFamily | ( | $ | keyspace, |
| $ | name, | ||
| $ | columns = array() , |
||
| $ | comparatorType = Cassandra::TYPE_UTF8 , |
||
| $ | defaultValidationClass = Cassandra::TYPE_UTF8 , |
||
| $ | comment = null , |
||
| $ | rowCacheSize = null , |
||
| $ | keyCacheSize = null , |
||
| $ | readRepairChance = null , |
||
| $ | cgGraceSeconds = null , |
||
| $ | minCompactionThreshold = null , |
||
| $ | maxCompactionThreshold = null , |
||
| $ | rowCacheSavePeriodSeconds = null , |
||
| $ | keyCacheSavePeriodSeconds = null , |
||
| $ | memtableFlushAfterMins = null , |
||
| $ | memtableFlushAfterThroughputMb = null , |
||
| $ | memtableFlushAfterOpsMillions = null |
||
| ) |
Creates a new standard column family.
| string | $keyspace | Keyspace to create in |
| string | $name | Name of the column family |
| array | $columns | Column metadata |
| string | $comparatorType | Key comparator type |
| string | $defaultValidationClass | Default column value type |
| string | $comment | Free text comment |
| integer | $rowCacheSize | Row cache size |
| integer | $keyCacheSize | Key cache size |
| float | $readRepairChance | Change for read repair 0..1 |
| integer | $cgGraceSeconds | Carbage collection period |
| integer | $minCompactionThreshold | Minimum compaction threshold |
| integer | $maxCompactionThreshold | Maximum compaction threshold |
| integer | $rowCacheSavePeriodSeconds | Row cache saving period |
| integer | $keyCacheSavePeriodSeconds | Key cache saving period |
| integer | $memtableFlushAfterMins | Memtable flush after minutes |
| integer | $memtableFlushAfterThroughputMb | Memtable flush after data |
| integer | $memtableFlushAfterOpsMillions | Flush after operations |
Definition at line 1289 of file Cassandra.php.
{ return $this->createColumnFamily( $keyspace, $name, Cassandra::COLUMN_STANDARD, $columns, $comparatorType, null, $defaultValidationClass, $comment, $rowCacheSize, $keyCacheSize, $readRepairChance, $cgGraceSeconds, $minCompactionThreshold, $maxCompactionThreshold, $rowCacheSavePeriodSeconds, $keyCacheSavePeriodSeconds, $memtableFlushAfterMins, $memtableFlushAfterThroughputMb, $memtableFlushAfterOpsMillions ); }
| Cassandra::createSuperColumnFamily | ( | $ | keyspace, |
| $ | name, | ||
| $ | columns = array() , |
||
| $ | comparatorType = Cassandra::TYPE_UTF8 , |
||
| $ | subcomparatorType = Cassandra::TYPE_UTF8 , |
||
| $ | defaultValidationClass = Cassandra::TYPE_UTF8 , |
||
| $ | comment = null , |
||
| $ | rowCacheSize = null , |
||
| $ | keyCacheSize = null , |
||
| $ | readRepairChance = null , |
||
| $ | cgGraceSeconds = null , |
||
| $ | minCompactionThreshold = null , |
||
| $ | maxCompactionThreshold = null , |
||
| $ | rowCacheSavePeriodSeconds = null , |
||
| $ | keyCacheSavePeriodSeconds = null , |
||
| $ | memtableFlushAfterMins = null , |
||
| $ | memtableFlushAfterThroughputMb = null , |
||
| $ | memtableFlushAfterOpsMillions = null |
||
| ) |
Creates a new super column family.
| string | $keyspace | Keyspace to create in |
| string | $name | Name of the column family |
| array | $columns | Column metadata |
| string | $comparatorType | Key comparator type |
| string | $defaultValidationClass | Default column value type |
| string | $comment | Free text comment |
| integer | $rowCacheSize | Row cache size |
| integer | $keyCacheSize | Key cache size |
| float | $readRepairChance | Change for read repair 0..1 |
| integer | $cgGraceSeconds | Carbage collection period |
| integer | $minCompactionThreshold | Minimum compaction threshold |
| integer | $maxCompactionThreshold | Maximum compaction threshold |
| integer | $rowCacheSavePeriodSeconds | Row cache saving period |
| integer | $keyCacheSavePeriodSeconds | Key cache saving period |
| integer | $memtableFlushAfterMins | Memtable flush after minutes |
| integer | $memtableFlushAfterThroughputMb | Memtable flush after data |
| integer | $memtableFlushAfterOpsMillions | Flush after operations |
Definition at line 1353 of file Cassandra.php.
{ foreach ($columns as $column) { if ( array_key_exists('index-type', $column) || array_key_exists('index-name', $column) ) { throw new CassandraUnsupportedException( 'Secondary indexes are not supported by supercolumns' ); } } return $this->createColumnFamily( $keyspace, $name, Cassandra::COLUMN_SUPER, $columns, $comparatorType, $subcomparatorType, $defaultValidationClass, $comment, $rowCacheSize, $keyCacheSize, $readRepairChance, $cgGraceSeconds, $minCompactionThreshold, $maxCompactionThreshold, $rowCacheSavePeriodSeconds, $keyCacheSavePeriodSeconds, $memtableFlushAfterMins, $memtableFlushAfterThroughputMb, $memtableFlushAfterOpsMillions ); }
| Cassandra::describeKeyspace | ( | $ | keyspace = null | ) |
Returns ow-level keyspace description as returned by Cassandra.
Returns the result of "describe_keyspace" call without any processing and does not use cache. Generally you want to use the more friendly version {
If no keyspace name is defined, the currently active keyspace is used.
| string | $keyspace | Optional keyspace name. |
Definition at line 996 of file Cassandra.php.
{ if ($keyspace === null) { $keyspace = $this->cluster->getCurrentKeyspace(); } return $this->call('describe_keyspace', $keyspace); }
| Cassandra::dropKeyspace | ( | $ | name | ) |
Drops an entire keyspace.
| string | $name | Name of the keyspace |
| Exception | If anything goes wrong |
Definition at line 1263 of file Cassandra.php.
{ return $this->call('system_drop_keyspace', $name); }
| static Cassandra::escape | ( | $ | value | ) | [static] |
Escapes keys used in get requests.
| string | $value | Value to escape |
Definition at line 1645 of file Cassandra.php.
{ foreach(self::$requestKeyTokens as $keyToken) { $value = str_replace( $keyToken, '\\'.$keyToken, $value ); } return $value; }
| Cassandra::get | ( | $ | request, |
| $ | consistency = null |
||
| ) |
Requests some data as a single request string.
Supported patterns:
In all of the parts, the following characters shoudl be escaped (\. etc) '.', ':', ',', '-', '|'
| string | $request | The request string, see patterns above |
| integer | $consistency | Consistency level, use constants, has default |
| CassandraInvalidPatternException | If equest pattern is invalid |
Definition at line 1143 of file Cassandra.php.
{ $details = $this->parseRequest($request); return $this->cf($details['column-family'])->get( $details['key'], $details['columns'], $details['start-column'], $details['end-column'], $details['reversed'], $details['column-count'], $details['super-column'], $consistency ); }
| Cassandra::getClient | ( | ) |
Return the low-level thrift client.
Definition at line 903 of file Cassandra.php.
{
return $this->cluster->getConnection()->getClient();
}
| Cassandra::getCluster | ( | ) |
Returns the Cassandra cluster of servers.
Definition at line 876 of file Cassandra.php.
{
return $this->cluster;
}
| Cassandra::getConnection | ( | ) |
Returns random connection to a node.
Definition at line 885 of file Cassandra.php.
{
return $this->cluster->getConnection();
}
| static Cassandra::getInstance | ( | $ | name = 'main' | ) | [static] |
Returns named singleton instance.
Name defaults to "main" the same as createInstance() so when using a single connection pool, the name needs not to be set on neither.
| string | $name | Name of the instance to fetch |
| CassandraInvalidRequestException | If no such instance exists |
Definition at line 817 of file Cassandra.php.
{ if (!isset(self::$instances[$name])) { throw new CassandraInvalidRequestException( 'Instance called "'.$name.'" does not exist' ); } return self::$instances[$name]; }
| static Cassandra::getKeyspaceRequiredMethods | ( | ) | [static, protected] |
Returns the list of low-level cassandra methods that require keyspace to be selected.
Definition at line 1509 of file Cassandra.php.
{ if (self::$keyspaceRequiredMethods === null) { self::$keyspaceRequiredMethods = array( 'login', 'get', 'get_slice', 'get_count', 'multiget_slice', 'multiget_count', 'get_indexed_slices', 'insert', 'remove', 'batch_mutate', 'truncate', 'describe_splits' ); } return self::$keyspaceRequiredMethods; }
| Cassandra::getKeyspaceSchema | ( | $ | keyspace = null , |
| $ | useCache = true |
||
| ) |
Returns processed keyspace schema description that is also cached if possible (APC caching enabled).
| string | $keyspace | Optional keyspace, current used if not set |
| boolean | $useCache | Should caching be used if possible |
Definition at line 1012 of file Cassandra.php.
{ if ($keyspace === null) { $keyspace = $this->cluster->getCurrentKeyspace(); } $cacheKey = 'cassandra.schema|'.$keyspace; $schema = false; $storeSchema = false; if ($useCache && function_exists('apc_fetch')) { $schema = apc_fetch($cacheKey); $storeSchema = true; } if ($schema !== false) { return $schema; } $info = $this->describeKeyspace($keyspace); $schema = array( 'name' => $info->name, 'placement-strategy' => $info->strategy_class, 'placement-strategy-options' => $info->strategy_options, 'replication-factor' => $info->replication_factor, 'column-families' => array() ); foreach ($info->cf_defs as $columnFamily) { $isSuper = $columnFamily->column_type == 'Super' ? true : false; $schema['column-families'][$columnFamily->name] = array( 'name' => $columnFamily->name, 'super' => $isSuper, 'column-type' => $isSuper ? CassandraUtil::extractType( $columnFamily->subcomparator_type ) : CassandraUtil::extractType( $columnFamily->comparator_type ), 'super-type' => $isSuper ? CassandraUtil::extractType( $columnFamily->comparator_type ) : null, 'data-type' => CassandraUtil::extractType( $columnFamily->default_validation_class ), 'column-data-types' => array() ); if ( is_array($columnFamily->column_metadata) && !empty($columnFamily->column_metadata) ) { foreach ($columnFamily->column_metadata as $column) { $schema['column-families'][$columnFamily->name]['column-data-types'][$column->name] = CassandraUtil::extractType($column->validation_class); } } } if ($storeSchema) { apc_store($cacheKey, $schema, 3600); } return $schema; }
| Cassandra::getVersion | ( | ) |
Returns the version of the Cassandra node.
Definition at line 1090 of file Cassandra.php.
{ return $this->call('describe_version'); }
| Cassandra::parseRequest | ( | $ | request | ) | [protected] |
Parses a get request.
| string | $request | Request to parse |
Definition at line 1536 of file Cassandra.php.
{ foreach(self::$requestKeyTokens as $tokenKey => $keyToken) { $request = str_replace( '\\'.$keyToken, '[/'.$tokenKey.'\\]', $request ); } $components = array(); $matchSuccessful = preg_match( '/^(.+)\.(.+)((\.(.*))|\[\])?(:(.*))?(\|(\d*)(R)?)?$/U', // 1 2 34 5 6 7 8 9 10 $request, $components ); if (!$matchSuccessful || empty($components)) { throw new CassandraInvalidPatternException( 'Invalid get request "'.$request.'" provided' ); } $result = array( 'column-family' => $components[1], 'key' => $components[2], 'columns' => null, 'start-column' => null, 'end-column' => null, 'reversed' => false, 'column-count' => $this->defaultColumnCount, 'super-column' => null ); $componentCount = count($components); // @codeCoverageIgnoreStart if ($componentCount < 3 || $componentCount > 11) { throw new CassandraInvalidPatternException( 'Invalid pattern, expected between 3 and 11 components, got '. $componentCount.', this should not happen' ); } // @codeCoverageIgnoreEnd if ($componentCount >= 6) { if ( !empty($components[5]) && $components[5] != '[]' ) { $result['super-column'] = $components[5]; } if ($componentCount >= 8) { if (!empty($components[7])) { if (strpos($components[7], ',') !== false) { $columns = explode(',', $components[7]); foreach ($columns as $columnIndex => $columnName) { $columns[$columnIndex] = trim($columnName); } $result['columns'] = $columns; } else if (strpos($components[7], '-') !== false) { $rangeColumns = explode('-', $components[7]); if (count($rangeColumns) > 2) { throw new CassandraInvalidPatternException( 'Expected no more than 2 columns '. 'to define a range' ); } $result['start-column'] = trim($rangeColumns[0]); $result['end-column'] = trim($rangeColumns[1]); } else { $result['columns'] = array(trim($components[7])); } } if ($componentCount >= 10 && !empty($components[9])) { $columnCount = (int)$components[9]; $result['column-count'] = $columnCount; } if ( $componentCount == 11 && strtoupper($components[10]) == 'R' ) { $result['reversed'] = true; } } } foreach ($result as $key => $item) { $result[$key] = self::unescape($item); } return $result; }
| Cassandra::registerKeyspace | ( | $ | keyspace, |
| $ | username = null , |
||
| $ | password = null |
||
| ) | [protected] |
Registers a keyspace with authentication info.
| string | $keyspace | Keyspace name |
| string | $username | The username |
| string | $password | Password |
Definition at line 834 of file Cassandra.php.
{ $this->keyspaceAuthentication[$keyspace] = array( 'username' => $username, 'password' => $password ); }
| Cassandra::set | ( | $ | key, |
| array $ | columns, | ||
| $ | consistency = null |
||
| ) |
Sets a key value. The key should include column family name as first part before fullstop so key "user.john" would set key "john" in column family called "user".
Used for both inserting new data and updating existing. The columns is expected to be key-value pairs with keys as column names and values as column values.
| string | $key | The key containing column family and row key |
| array | $columns | Column names and their values |
| integer | $consistency | Consistency to use, default used if not set |
Definition at line 1172 of file Cassandra.php.
{ $dotPosition = mb_strpos($key, '.'); if ($dotPosition === false) { throw new CassandraInvalidPatternException( 'Unable to set "'.$key.'", expected the column family name and'. 'key name seperated by a fullstop' ); } $columnFamilyName = mb_substr($key, 0, $dotPosition); $keyName = mb_substr($key, $dotPosition + 1); return $this->cf($columnFamilyName)->set( $keyName, $columns, $consistency ); }
| Cassandra::setDefaultColumnCount | ( | $ | columnCountLimit | ) |
Sets the default number of columns to fetch at maximum.
| integer | $columnCountLimit | The limit |
Definition at line 925 of file Cassandra.php.
{ $this->defaultColumnCount = $columnCountLimit; }
| Cassandra::setMaxCallRetries | ( | $ | retryCount | ) |
Sets the maximum number of times a call to Cassandra will be retried should it fail for any reason.
| integer | $retryCount | Number of times to retry, defaults to 5. |
Definition at line 914 of file Cassandra.php.
{
$this->maxCallRetries = $retryCount;
return $this;
}
| Cassandra::truncate | ( | $ | columnFamilyName | ) |
Truncates a column family of all of its data (entries).
| string | $columnFamilyName | Name of the column family |
Definition at line 1499 of file Cassandra.php.
{ return $this->call('truncate', $columnFamilyName); }
| static Cassandra::unescape | ( | $ | value | ) | [static] |
Unescapes keys used in get requests.
| string | $value | Value to unescape |
Definition at line 1663 of file Cassandra.php.
{ if (empty($value)) { return $value; } else if (is_array($value)) { foreach ($value as $key => $item) { $value[$key] = self::unescape($item); } } else if (is_string($value)) { foreach(self::$requestKeyTokens as $tokenKey => $keyToken) { $value = str_replace( '[/'.$tokenKey.'\\]', $keyToken, $value ); } } return $value; }
| Cassandra::updateKeyspace | ( | $ | name, |
| $ | replicationFactor = 1 , |
||
| $ | placementStrategyClass = self::PLACEMENT_SIMPLE , |
||
| $ | placementStrategyOptions = null |
||
| ) |
Updates keyspace information.
Note that the replication factor means how many nodes hold a single piece of information, not to how many nodes its replicated to so a replication factor of one means that a single node has data and no replication is performed.
| string | $name | Name of the keyspace |
| integer | $replicationFactor | How many nodes hold each piece of data |
| string | $placementStrategyClass | Data placement strategy |
| array | $placementStrategyOptions | Strategy options |
| Exception | If anything goes wrong |
Definition at line 1239 of file Cassandra.php.
{ $def = new cassandra_KsDef(); $def->name = $name; $def->strategy_class = $placementStrategyClass; $def->strategy_options = $placementStrategyOptions; $def->cf_defs = array(); $def->replication_factor = $replicationFactor; return $this->call('system_update_keyspace', $def); }
| Cassandra::useKeyspace | ( | $ | keyspace, |
| $ | username = null , |
||
| $ | password = null |
||
| ) |
Start using a new keyspace.
If the keyspace requires authentication, the username and password of it should be provided the first time this method is called. The username and password are stored so on next calls, they are used automatically if exist.
| string | $keyspace | Keyspace name |
| string | $username | The username |
| string | $password | Password |
Definition at line 858 of file Cassandra.php.
{ if (!empty($username)) { $this->registerKeyspace($keyspace, $username, $password); } else if (isset($this->keyspaceAuthentication[$keyspace])) { $username = $this->keyspaceAuthentication[$keyspace]['username']; $password = $this->keyspaceAuthentication[$keyspace]['password']; } $this->cluster->useKeyspace($keyspace, $username, $password); return $this; }
| const Cassandra::COLUMN_STANDARD = 'Standard' |
Standard column type.
Definition at line 672 of file Cassandra.php.
| const Cassandra::COLUMN_SUPER = 'Super' |
Super column type.
Definition at line 677 of file Cassandra.php.
| const Cassandra::CONSISTENCY_ALL = cassandra_ConsistencyLevel::ALL |
Returns success only if all the nodes holding the data respond.
This makes sure that all the nodes get the same data, but includes a performance penalty and also if a single node of the replication group is down, it's not possible to read or write the data as the requirement can not be fulfilled.
Definition at line 667 of file Cassandra.php.
| const Cassandra::CONSISTENCY_ANY = cassandra_ConsistencyLevel::ANY |
Only meaningful for writes and means as soon as a write is received by any node, the call returns success.
This occurs when your client might be connecting to node 5 but the nodes responsible for it are 6-8. The difference between ONE and ANY is that with ANY, as soon as node 5 receives the write, it returns success (but nodes 6-8 could be down or whatever). CL::ONE means that if you write to node 5, either 6, 7, or 8 have to return success before node 5 returns success.
Definition at line 657 of file Cassandra.php.
| const Cassandra::CONSISTENCY_ONE = cassandra_ConsistencyLevel::ONE |
It is enough if a single node replies.
This makes reads and writes fast, but it also means that depending on what else is reading and writing, it's possible that they could briefly give conflicting answers.
Definition at line 634 of file Cassandra.php.
| const Cassandra::CONSISTENCY_QUORUM = cassandra_ConsistencyLevel::QUORUM |
Majority of the nodes holding the data must reply.
If you have replication factor of 3 then it's enough if two of the nodes holding the data are up and reply. You need to have a replication factor of atleast three for this to work differently from all and should use odd number for replication factor.
Definition at line 644 of file Cassandra.php.
| const Cassandra::INDEX_KEYS = 0 |
Keys index type, currently only one supported.
Definition at line 769 of file Cassandra.php.
| const Cassandra::OP_EQ = cassandra_IndexOperator::EQ |
Equality comparator used in where queries.
Definition at line 726 of file Cassandra.php.
| const Cassandra::OP_GT = cassandra_IndexOperator::GT |
Strict greater-than comparator.
Definition at line 736 of file Cassandra.php.
| const Cassandra::OP_GTE = cassandra_IndexOperator::GTE |
Greater-than-equals comparator.
Definition at line 746 of file Cassandra.php.
| const Cassandra::OP_LT = cassandra_IndexOperator::LT |
Strict less-than comparator.
Definition at line 731 of file Cassandra.php.
| const Cassandra::OP_LTE = cassandra_IndexOperator::LTE |
Less-than-equals comparator.
Definition at line 741 of file Cassandra.php.
| const Cassandra::PLACEMENT_NETWORK = 'org.apache.cassandra.locator.NetworkTopologyStrategy' |
Network topology aware placement strategy.
Definition at line 758 of file Cassandra.php.
| const Cassandra::PLACEMENT_OLD_NETWORK = 'org.apache.cassandra.locator.OldNetworkTopologyStrategy' |
Old network topology aware placement strategy.
Definition at line 764 of file Cassandra.php.
| const Cassandra::PLACEMENT_SIMPLE = 'org.apache.cassandra.locator.SimpleStrategy' |
Default simple placement strategy not taking network topology into account.
Definition at line 752 of file Cassandra.php.
| const Cassandra::TYPE_ASCII = 'AsciiType' |
ASCII text type.
Definition at line 682 of file Cassandra.php.
| const Cassandra::TYPE_BYTES = 'BytesType' |
Simplest binary type
Definition at line 687 of file Cassandra.php.
| const Cassandra::TYPE_INTEGER = 'IntegerType' |
Simple integer data type.
Definition at line 716 of file Cassandra.php.
| const Cassandra::TYPE_LEXICAL_UUID = 'LexicalUUIDType' |
Used for a non-time based comparison. It is compared lexically, by byte value.
(UUID) are a standardized unique indentifier in the form of a 128 bit number. In it's canonical form UUIDs are represented by a 32 digit hexadecimal number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Definition at line 697 of file Cassandra.php.
| const Cassandra::TYPE_LONG = 'LongType' |
Long data type.
Definition at line 711 of file Cassandra.php.
| const Cassandra::TYPE_TIME_UUID = 'TimeUUIDType' |
Used for a time based comparison. It uses a version 1 UUID.
(UUID) are a standardized unique indentifier in the form of a 128 bit number. In it's canonical form UUIDs are represented by a 32 digit hexadecimal number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Definition at line 706 of file Cassandra.php.
| const Cassandra::TYPE_UTF8 = 'UTF8Type' |
UTF8 international text data type.
Definition at line 721 of file Cassandra.php.


Once you install the Jenkins plugin and set up the configuration page, you need to add a ‘build step’ in your pipeline. This is what tells the Jenkins pipeline, when running, to send data to Jira or not.
You can use the optional 'branch' parameter to override the branch name we use to determine the issue keys associated with the current build.
You generate a Pipeline script, then use this in your Jenkinsfile.
Please select the Jira Software Cloud site name you would like to create the pipeline script for. You can only select 1 site at this time. If you want to send information to multiple sites, please create multiple Pipeline Scripts.


Some ordered pairs for a linear function of X_VAR
are given in the table below.
Which equation was used to generate this table?
X_HEADER
Y_HEADER
xval
COEF * xval + CONS
Y_VAR = COEFX_VAR + CONS
Y_VAR = wrong.coefX_VAR + wrong.cons
Take one of the equations and try plugging in the values from the table. If the equality does not hold for at least one set of values, then we can eliminate that answer choice.
For example, consider Y_VAR = WRONG_ANSWERS[0].coefX_VAR + WRONG_ANSWERS[0].cons
. Substituting in \color{ORANGE}{X_VAR = XVALS[0]}
and \color{BLUE}{Y_VAR = XVALS[0] * COEF + CONS}
shows that the equality holds for the first row of the table :
\color{BLUE}{XVALS[0] * COEF + CONS} = WRONG_ANSWERS[0].coef(\color{ORANGE}{XVALS[0]}) + WRONG_ANSWERS[0].cons
XVALS[0] * COEF + CONS = XVALS[0] * COEF + CONS
However, plugging in \color{ORANGE}{X_VAR = XVALS[1]}
and \color{BLUE}{Y_VAR = XVALS[1] * COEF + CONS}
from the second row of the table gives us:
\color{BLUE}{XVALS[1] * COEF + CONS} = WRONG_ANSWERS[0].coef(\color{ORANGE}{XVALS[1]}) + WRONG_ANSWERS[0].cons
XVALS[1] * COEF + CONS \ne WRONG_ANSWERS[0].coef * XVALS[1] + WRONG_ANSWERS[0].cons
So we can eliminate Y_VAR = WRONG_ANSWERS[0].coefX_VAR + WRONG_ANSWERS[0].cons
from consideration and try a different answer choice.
When we try Y_VAR = COEFX_VAR + CONS
, we see that it holds up for each set of values in the table.
\color{BLUE}{COEF * xval + CONS} = COEF \cdot \color{ORANGE}{xval} + CONS
|
→ |
\color{BLUE}{COEF * xval + CONS} = COEF * xval + CONS
|
The equation that fits this table of values is Y_VAR = COEFX_VAR + CONS
.
The data in the table show the cost of buying bulk vegetables per pound, including the fee for the clerk to package the vegetables in boxes.
Which equation fits the data?
xval
$COEF * xval + CONS
tableval.xval
tableval.yval
The table below was generated using the following equation:\quad f(x) = COEFx + CONS
Find the missing values.
f(tableval.xval)
= COEF * tableval.xval + CONS
Plug the corresponding values of x
into the equation to find the missing values of f(x)
.
\color{BLUE}{f(tableval.xval)} = COEF \cdot \color{ORANGE}{tableval.xval} + CONS = tableval.xval * COEF + CONS = tableval.xval * COEF + CONS
The missing value isvalues are:
f(tableval.xval) = tableval.xval * COEF + CONS


Robert J. Paruch received his Ph.D. in computational physics at the Jagiellonian University in Krakow, Poland. His long-standing research interests are in computer modeling of physical phenomena, associated analytical tools software development and data analysis aimed at improving the efficiency and productivity of experimental setups. His work experience includes a five-year postdoctoral appointment at the Pennsylvania State University, the Department of Chemistry, where his research projects focused on modeling of sputtering of materials by energetic particles and building analytical models. The results of his research helped in the development of new approaches to interpreting computer simulations, as well as optimization of the secondary-ion mass spectrometry analytical technique.
Coauthored over 25 scientific publications as a result of independent and collaborative work within the research group, peer-reviewed research publications, and presented the results of research at numerous international conferences and workshops.
In his spare time, he enjoys cooking, sightseeing and photographing.
Currently attending the Coding Bootcamp at the University of Oregon in order to round out the skills and gain the additional experience required to peruse the career opportunities in the industrial workspace.


Republicans flock to Price funeral
Up to 500 republicans from across Ireland attended the funeral of Old Bailey bomber Dolours Price.
Her sister, Marian, who is in prison accused of dissident republican activity, was not at the service at St Agnes Church in Andersonstown, west Belfast.
Price, 62, was an unrepentant republican hard-liner who fell out with Sinn Fein after the party endorsed the Northern Ireland peace process, encouraged the IRA to give up its guns and embraced power-sharing with unionists at Stormont.
No public representatives from the mainstream republican movement were at the ceremony.
In his address, Father Raymond Murray, who had been prison chaplain at Armagh jail, told mourners that Price and her sister were like bosom twins.
He said: "Dolours' family can relate her nature and her talent, both of which is outside the knowledge and understanding of those who did not know her personally.  She was very devoted to her parents. Her mother, Chrissie, died on February 1 1975.
"Their mother never saw Dolours or Marian back in Ireland. They did not get compassionate leave from prison in England to attend her funeral. A week afterwards they were repatriated to Ireland but that grief of not seeing her mother meant she never found closure."
Price's father, Albert, had also been a prominent IRA member and was interned by the Irish Government at the Curragh Camp during the 1950s.
Price, the former wife of actor Stephen Rea, was convicted and jailed along with her sister for the 1973 car bomb attack on London's Central Criminal Court in which one man died and more than 200 people were injured.
She spent eight years in jail including several weeks on hunger strike before being released in 1980. In recent years she clashed with Sinn Fein president Gerry Adams over her allegations that he had been her IRA Officer Commanding during the early 1970s.
Press Association


| gt {gt} | R Documentation |
The gt()
function creates a gt table object when provided with table
data. Using this function is the first step in a typical gt workflow.
Once we have the gt table object, we can perform styling transformations
before rendering to a display table of various formats.
gt( data, rowname_col = "rowname", groupname_col = dplyr::group_vars(data), caption = NULL, rownames_to_stub = FALSE, auto_align = TRUE, id = NULL, row_group.sep = getOption("gt.row_group.sep", " - ") )
data |
A |
rowname_col |
The column name in the input |
groupname_col |
The column name in the input |
caption |
An optional table caption to use for cross-referencing in R Markdown documents and bookdown book projects. |
rownames_to_stub |
An option to take rownames from the input |
auto_align |
Optionally have column data be aligned depending on the
content contained in each column of the input |
id |
The table ID. By default, with |
row_group.sep |
The separator to use between consecutive group names (a
possibility when providing |
There are a few data ingest options we can consider at this stage. We can
choose to create a table stub with rowname captions using the rowname_col
argument. Further to this, stub row groups can be created with the
groupname_col
. Both arguments take the name of a column in the input table
data. Typically, the data in the groupname_col
will consist of categories
of data in a table and the data in the rowname_col
are unique labels
(perhaps unique across the entire table or unique within groups).
Row groups can also be created by passing a grouped_df
to gt()
by using
the dplyr::group_by()
function on the table data. In this way, two or more
columns of categorical data can be used to make row groups. The
row_group.sep
argument allows for control in how the row group label will
appear in the display table.
An object of class gt_tbl
.
1-1
Other Create Table:
gt_preview()
# Create a table object using the # `exibble` dataset; use the `row` # and `group` columns to add a stub # and row groups tab_1 <- exibble %>% gt( rowname_col = "row", groupname_col = "group" ) # The resulting object can be used # in transformations (with `tab_*()`, # `fmt_*()`, `cols_*()` functions) tab_2 <- tab_1 %>% tab_header( title = "Table Title", subtitle = "Subtitle" ) %>% fmt_number( columns = num, decimals = 2 ) %>% cols_label(num = "number")


After more than Four decades in the industry, Rocket Elevators learned how to design and fabricate exceptional
elevators. We involve our clients in every step of the process.
From a raw idea to a perfect reality and from design to installation.
Excellent material's quality, Excellent installation, Excellent maintenance and Excellent price for our Elevators. We’re strongly proud of our product. We also able to charge less than our competitors thanks to our internal efficient administration and management.
Read more nowWe’re known for our originality, quality, skills, competences, pricing, and our unlimited commitment to safety. This mission is accomplished by product design, complete installation, adequate maintenance and a responsability to our customers.
Read more nowChief Executive Ofiicer
Mathieu Houde Rocket Elevators Ltd.The best employee of the month.
Montasser EL Ferjani Rocket Elavators Ltd.For more informations
Address: 725 Blvd Lebourgneuf. Quebec city, G2J 0C4, Qc, Canada. Phone: 1514-555-5555 Email: support@rocketelevator.com