카산드라에서 엄청난 수의 레코드를 삭제하고 있습니다. 다음 오류가 발생합니다.PHPCassa + Cassandra의 TFramedTransport 오류
<?php
set_time_limit(2000);
require 'connection.php';
require 'columnfamily.php';
$servers[0]['host'] = 'private ip';
$servers[0]['port'] = '9160';
$conn = new Connection('Server11', $servers);
$urlFamily = new ColumnFamily($conn, 'Domain'); // ColumnFamily
$start = microtime(true);
$limit = 100000000;
$rows = $urlFamily->get_range($key_start='', $key_finish='zzzzzzzzzzzzzzz',100000000);
$num = 0;
$delCount = 0;
foreach($rows as $key => $columns) {
// Do stuff with $key or $columns
if (strpos($key, ' .net') !== false) {
//echo 'deleting ' . $key . "\n";
$urlFamily->remove($key);
$delCount++;
}
if ($num++ > 100000000) break;
//$num++;
if ($num % 100000 == 0) echo $num . "\n";
}
$end = microtime(true);
echo $num . " total\n";
echo $delCount . ' deleted in ' . ($end - $start) . " seconds\n";
echo $delCount/($end - $start) . " deleted per second\n";
?>
우리는 페도라 14 래 플린에 PHP 5.3.5을 실행 :
여기Error performing remove on 10.130.279.40:9160: exception 'TTransportException' with message 'TSocket: timed out reading 4 bytes from 10.130.279.40:9160' in /home/zonefiles/php/thrift/transport/TSocket.php:268
Stack trace:
0 /home/zonefiles/php/thrift/transport/TTransport.php(87): TSocket->read(4)
1 /home/zonefiles/php/thrift/transport/TFramedTransport.php(135): TTransport->readAll(4)
2 /home/zonefiles/php/thrift/transport/TFramedTransport.php(102): TFramedTransport->readFrame()
3 [internal function]: TFramedTransport->read(8192)
4 /home/zonefiles/php/thrift/packages/cassandra/Cassandra.php(691): thrift_protocol_read_binary(Object(TBinaryProtocolAccelerated), 'cassandra_Cassa...', false)
5 /home/zonefiles/php/thrift/packages/cassandra/Cassandra.php(664): CassandraClient->recv_remove()
6 [internal function]: CassandraClient->remove('CUSTOMERSERVICE...', Object(cassandra_ColumnPath), 1301555573936295, 1)
7 /home/zonefiles/php/connection.php(230): call_user_func_array(Array, Array)
8 /home/zonefiles/php/columnfamily.php(582): ConnectionPool->call('remove', 'CUSTOMERSERVICE...', Object(cassandra_ColumnPath), 1301555573936295, 1)
9 /home/zonefiles/php/delete.php(34): ColumnFamily->remove('CUSTOMERSERVICE...')
10 {main}
Error connecting to 10.130.279.40:9160: exception 'TTransportException' with message 'TSocket: timed out reading 4 bytes from 10.130.279.40:9160' in /home/zonefiles/php/thrift/transport/TSocket.php:268
Stack trace:
0 /home/zonefiles/php/thrift/transport/TTransport.php(87): TSocket->read(4)
1 /home/zonefiles/php/thrift/transport/TFramedTransport.php(135): TTransport->readAll(4)
2 /home/zonefiles/php/thrift/transport/TFramedTransport.php(102): TFramedTransport->readFrame()
3 [internal function]: TFramedTransport->read(8192)
4 /home/zonefiles/php/thrift/packages/cassandra/Cassandra.php(1015): thrift_protocol_read_binary(Object(TBinaryProtocolAccelerated), 'cassandra_Cassa...', false)
5 /home/zonefiles/php/thrift/packages/cassandra/Cassandra.php(992): CassandraClient->recv_describe_version()
6 /home/zonefiles/php/connection.php(63): CassandraClient->describe_version()
7 /home/zonefiles/php/connection.php(163): ConnectionWrapper->__construct('CDTMain1', '10.130.279.40:9...', NULL, true, 5000, 5000)
8 /home/zonefiles/php/connection.php(254): ConnectionPool->make_conn()
9 /home/zonefiles/php/connection.php(241): ConnectionPool->handle_conn_failure(Object(ConnectionWrapper), 'remove', Object(TTransportException), 1)
10 /home/zonefiles/php/columnfamily.php(582): ConnectionPool->call('remove', 'CUSTOMERSERVICE...', Object(cassandra_ColumnPath), 1301555573936295, 1)
11 /home/zonefiles/php/delete.php(34): ColumnFamily->remove('CUSTOMERSERVICE...')
12 {main}
우리가 오류를 생성하는 데 사용하는 PHP는 : 우리는 기록의 거대한 수를 삽입 할 때 우리는 또한이 오류가 그리고 0.5 리터.
한 가지 이론은 이것이 카산드라가 명령을 충분히 빠르게 처리 할 수 없기 때문이라는 이론이 있습니다. 동의 하시겠습니까/동의하지 않습니까? 전에 본 적 있어요?
다른 방법 (예 : 잘림)을 삭제할 것을 권장하는 경우 Google에서 Cassandra와 다른 작업을 수행 할 때이 문제가 계속 발생하지 않도록하려면 어떻게해야합니까?
이 삭제 성명의 목적은 그물에 종료 도메인의 목록을 삭제했다. 그 안에 .net이있는 모든 URL을 검색하기 위해 cassandra를 쿼리하는 방법이 있습니까? 나는 MySQL에서 SELECT * WHERE 도메인과 같은 것이 될 것이라는 것을 알고있다. * .net ' – dengeltrees