Ejemplo n.º 1
0
 public function setUp()
 {
     $this->client = new ConnectionPool(self::$KS);
     $this->cf_float = new ColumnFamily($this->client, 'StdFloat');
     $this->cf_double = new ColumnFamily($this->client, 'StdDouble');
     $this->cf_time = new ColumnFamily($this->client, 'StdTimeUUID');
     $this->cf_lex = new ColumnFamily($this->client, 'StdLexicalUUID');
     $this->cf_date = new ColumnFamily($this->client, 'StdDate');
     $this->cf_composite = new ColumnFamily($this->client, 'StdComposite');
     $this->cfs = array($this->cf_float, $this->cf_double, $this->cf_time, $this->cf_lex, $this->cf_composite);
     // make a millisecond precision timestamp
     if (PHP_INT_MAX === 2147483647) {
         $base_time = (double) time();
     } else {
         // make a millisecond precision timestamp
         $base_time = Clock::get_time();
         $base_time -= (int) $base_time % 1000;
         $base_time /= 1000000.0;
     }
     $this->DATE1 = $base_time + 0;
     $this->DATE2 = $base_time + 1;
     $this->DATE3 = $base_time + 2;
     $this->TIME1 = UUID::mint();
     $this->TIME2 = UUID::mint();
     $this->TIME3 = UUID::mint();
     $this->LEX1 = UUID::import('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
     $this->LEX2 = UUID::import('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
     $this->LEX3 = UUID::import('cccccccccccccccccccccccccccccccc');
 }
Ejemplo n.º 2
0
 public function test_default_validated_columns()
 {
     $time = UUID::mint();
     $this->cf_def_valid = new ColumnFamily($this->client, 'DefaultValidator');
     $col_cf = array('aaaaaa' => 222222222222);
     $col_cm = array('subcol' => $time);
     # Both of these inserts work, as cf allows
     # longs and cm for 'subcol' allows TimeUUIDs
     $this->cf_def_valid->insert(self::$KEYS[0], $col_cf);
     $this->cf_def_valid->insert(self::$KEYS[0], $col_cm);
     $this->assertEquals($this->cf_def_valid->get(self::$KEYS[0]), array('aaaaaa' => 222222222222, 'subcol' => $time));
 }
 public function setUp()
 {
     $this->client = new ConnectionPool(self::$KS);
     $this->cf_suplong_subfloat = new SuperColumnFamily($this->client, 'SuperLongSubFloat');
     $this->cf_suplong_subdouble = new SuperColumnFamily($this->client, 'SuperLongSubDouble');
     $this->cf_suplong_subtime = new SuperColumnFamily($this->client, 'SuperLongSubTime');
     $this->cf_suplong_sublex = new SuperColumnFamily($this->client, 'SuperLongSubLex');
     $this->cf_suplong_subcomposite = new SuperColumnFamily($this->client, 'SuperLongSubComposite');
     $this->cfs = array($this->cf_suplong_subfloat, $this->cf_suplong_subdouble, $this->cf_suplong_subtime, $this->cf_suplong_sublex, $this->cf_suplong_subcomposite);
     $this->TIME1 = UUID::mint();
     $this->TIME2 = UUID::mint();
     $this->TIME3 = UUID::mint();
     $this->LEX1 = UUID::import('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
     $this->LEX2 = UUID::import('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
     $this->LEX3 = UUID::import('cccccccccccccccccccccccccccccccc');
 }
 public function setUp()
 {
     $this->client = new ConnectionPool(self::$KS);
     $this->cf_supfloat = new SuperColumnFamily($this->client, 'SuperFloat');
     $this->cf_supdouble = new SuperColumnFamily($this->client, 'SuperDouble');
     $this->cf_suptime = new SuperColumnFamily($this->client, 'SuperTime');
     $this->cf_suplex = new SuperColumnFamily($this->client, 'SuperLex');
     // $this->cf_supcomposite = new SuperColumnFamily($this->client, 'SuperComposite');
     $this->cfs = array($this->cf_supfloat, $this->cf_supdouble, $this->cf_suptime, $this->cf_suplex);
     // $this->cf_supcomposite);
     $this->TIME1 = UUID::mint();
     $this->TIME2 = UUID::mint();
     $this->TIME3 = UUID::mint();
     $this->LEX1 = UUID::import('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
     $this->LEX2 = UUID::import('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
     $this->LEX3 = UUID::import('cccccccccccccccccccccccccccccccc');
 }
Ejemplo n.º 5
0
 /**
  * Generate a v5 UUID
  * @return string a byte[] representation of a UUID 
  */
 public static function uuid5($node, $namespace = null)
 {
     return UUID::mint(5, $node, $namespace);
 }