0

Cassandra-Cluster-Admin を使用して単純なキースペースと列ファミリーを作成しました

プレイヤーという名前の列ファミリーがあります

create column family player
  with column_type = 'Standard'
  and comparator = 'TimeUUIDType'
  and default_validation_class = 'BytesType'
  and key_validation_class = 'BytesType'
  and rows_cached = 0.0
  and row_cache_save_period = 0
  and row_cache_keys_to_save = 2147483647
  and keys_cached = 200000.0
  and key_cache_save_period = 14400
  and read_repair_chance = 1.0
  and gc_grace = 864000
  and min_compaction_threshold = 4
  and max_compaction_threshold = 32
  and replicate_on_write = true
  and row_cache_provider = 'ConcurrentLinkedHashCacheProvider'
  and compaction_strategy = 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy';

行キー TimeUUIDType で行を挿入しようとしています。

次のように ConnectionPool を初期化しています。

$this->_connection_pool = new ConnectionPool($key_space, $this->_config['servers']);

次のように ColumnFamily インスタンスを初期化しています。

$this->_column_family = new ColumnFamily($this->_connection_pool, $column_family);

最後に、このコードを使用して列ファミリーに挿入しています。

this->_column_family->insert(UUID::uuid1, $data);

データ配列は次のようなものです。

$data = array('user_name' => 'aacanakin', 'full_name' => 'Aras Can Akin');

挿入ではなく、次のように表示されます。

Notice: unserialize(): Error at offset 0 of 9 bytes in /home/arascan/projects/peak-api/vendor/phpcassa/lib/phpcassa/Schema/DataType/UUIDType.php on line 16 

Notice: Trying to get property of non-object in /home/arascan/projects/peak-api/vendor/phpcassa/lib/phpcassa/Schema/DataType/UUIDType.php on line 17

Notice: unserialize(): Error at offset 0 of 9 bytes in /home/arascan/projects/peak-api/vendor/phpcassa/lib/phpcassa/Schema/DataType/UUIDType.php on line 16

 Notice: Trying to get property of non-object in /home/arascan/projects/peak-api/vendor/phpcassa/lib/phpcassa/Schema/DataType/UUIDType.php on line 17

Warning: Illegal offset type in /home/arascan/projects/peak-api/vendor/phpcassa/lib/phpcassa/AbstractColumnFamily.php on line 683

私は本当に助けが必要です。ありがとう

4

2 に答える 2

1

Java用のヘクタークライアントを使用しています

以下のようにUTF8TypeとTimeUUIDの複合キーを使用して成功しました。手がかりが得られることを願っています

Composite compKey = new Composite();
compKey.addComponent("c1", HFactoryHelper.stringSerializer);
compKey.addComponent(TimeUUIDUtils.getUniqueTimeUUIDinMillis(),HFactoryHelper.uuidSerializer);

mutator.addInsertion("my row key",
                     "my CF",
                      HFactory.createColumn
                (compKey,"my column value",
                 new CompositeSerializer()
                , HFactoryHelper.stringSerializer
                )
             );
于 2013-06-12T06:26:08.653 に答える