Esempio n. 1
0
 public function select($columnFamilyName)
 {
     list($keySpace, $columnFamily) = explode('.', $columnFamilyName);
     if (empty($keySpace) || empty($columnFamily)) {
         $message = 'Keyspace or ColumnFamily missing.  Expect "Keyspace.ColumnFamilyName"';
         PandraLog::crit($message);
         throw new RuntimeException($message);
     }
     $this->_keySpace = $keySpace;
     $this->_columnFamily = $columnFamily;
     return $this;
 }
Esempio n. 2
0
 public function buildPredicateAttribute(array $predicateAttribute)
 {
     if ($this->_slicePredicateType === self::TYPE_COLUMNS) {
         $this->slice_range = NULL;
         if (empty($predicateAttribute)) {
             // Warn that there's no point in building an empty predicate
             PandraLog::warning('Empty Predicate : an empty result set will be returned');
         }
         $this->column_names = $predicateAttribute;
     } elseif ($this->_slicePredicateType === self::TYPE_RANGE) {
         $this->column_names = NULL;
         $this->slice_range = new cassandra_SliceRange(array('start' => '', 'finish' => '', 'reversed' => false, 'count' => DEFAULT_ROW_LIMIT));
         foreach ($predicateAttribute as $key => $value) {
             if (isset($this->slice_range->{$key})) {
                 $this->slice_range->{$key} = $value;
             }
         }
     } else {
         $msg = 'Unsupported Predicate Type';
         PandraLog::crit($msg);
         throw new RuntimeException($msg);
     }
 }