public function unpack($data, $handle_serialize = true) { $value = UUID::import($data); if ($handle_serialize) { return serialize($value); } else { return $value; } }
public function test_uuid1_generation() { if (PHP_INT_MAX === 2147483647) { $this->markTestSkipped(); } $micros = 1293769171436849.0; $uuid = UUID::import(UUID::uuid1(null, $micros)); $t = (int) ($uuid->time * 1000000); $this->assertEquals($micros, $t, '', 100); }
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'); }
$column_family = new ColumnFamily($pool, $columnfamily_name, $autopack_names); } $no_column = 1; $data = array(); $no_scf = 1; while (isset($_POST['column_key_' . $no_scf]) || $no_scf == 1) { $column_key_name = ''; if (isset($_POST['column_key_' . $no_scf])) { $column_key_name = $_POST['column_key_' . $no_scf]; } $no_column = 1; while (isset($_POST['column_name_' . $no_scf . '_' . $no_column]) && isset($_POST['column_value_' . $no_scf . '_' . $no_column])) { $column_name = $_POST['column_name_' . $no_scf . '_' . $no_column]; switch ($cf_def->comparator_type) { case 'org.apache.cassandra.db.marshal.TimeUUIDType': $uuid = UUID::import($column_name); $column_name = $uuid->bytes; break; } $column_value = $_POST['column_value_' . $no_scf . '_' . $no_column]; if ($_POST['column_name_' . $no_scf . '_' . $no_column] != '' && $_POST['column_value_' . $no_scf . '_' . $no_column] != '') { // CF if ($column_key_name == '') { $data[$column_name] = $column_value; } else { $data[$column_key_name][$column_name] = $column_value; } } $no_column++; } $no_scf++;