Пример #1
0
 /**
  * Adds an error message to Core's running log, and sends the message to any registered loggers
  * @param string $errorMsg Error Message
  * @param int $priority error priority level (PandraLog::LOG_)
  */
 public static function registerError($errorMsg, $priority = PandraLog::LOG_WARNING)
 {
     $message = '(PandraCore) ' . $errorMsg;
     PandraLog::logPriorityMessage($priority, $message);
     self::$lastError = $errorMsg;
 }
Пример #2
0
 /**
  * Gets complete slice of Thrift cassandra_Column objects for keyID
  *
  * @return array cassandra_Column objects
  */
 public function getCFSlice($keyID, $keySpace, $cfName, $superName = NULL, $consistencyLevel = NULL)
 {
     $client = self::getClient();
     // build the column path
     $columnParent = new cassandra_ColumnParent();
     $columnParent->column_family = $cfName;
     $columnParent->super_column = $superName;
     $predicate = new cassandra_SlicePredicate();
     $predicate->slice_range = new cassandra_SliceRange();
     $predicate->slice_range->start = '';
     $predicate->slice_range->finish = '';
     try {
         if (is_array($keyID)) {
             return $client->multiget_slice($keySpace, $keyID, $columnParent, $predicate, self::getConsistency($consistencyLevel));
         } else {
             return $client->get_slice($keySpace, $keyID, $columnParent, $predicate, self::getConsistency($consistencyLevel));
         }
     } catch (TException $te) {
         var_dump($te);
         self::$lastError = 'TException: ' . $te->getMessage() . "\n";
         return NULL;
     }
     return NULL;
 }