Esempio n. 1
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $sys = new SystemManager();
     $cfattrs = array("column_type" => "Standard", "key_validation_class" => DataType::LONG_TYPE);
     $sys->create_column_family(self::$KS, 'LongKeys', $cfattrs);
     $sys->create_index(self::$KS, 'LongKeys', 'subcol', DataType::LONG_TYPE);
     $cfattrs = array("column_type" => "Standard", "key_validation_class" => DataType::UUID_TYPE);
     $sys->create_column_family(self::$KS, 'UUIDKeys', $cfattrs);
     $sys->create_index(self::$KS, 'UUIDKeys', 'subcol', DataType::LONG_TYPE);
 }
Esempio n. 2
0
 public static function setUpBeforeClass()
 {
     try {
         $sys = new SystemManager();
         $ksdefs = $sys->describe_keyspaces();
         $exists = False;
         foreach ($ksdefs as $ksdef) {
             $exists = $exists || $ksdef->name == self::$KS;
         }
         if ($exists) {
             $sys->drop_keyspace(self::$KS);
         }
         $sys->create_keyspace(self::$KS, array());
         $sys->create_column_family(self::$KS, self::$CF, self::$cfattrs);
         $sys->create_column_family(self::$KS, 'Indexed1', array("key_validation_class" => "FloatType"));
         $sys->create_index(self::$KS, 'Indexed1', 'birthdate', DataType::LONG_TYPE, 'birthday_index');
         $sys->close();
     } catch (Exception $e) {
         print $e;
         throw $e;
     }
 }