示例#1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * To test multiple nodes, add their connection strings here
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->parentCF = new TestCFSuper();
     $this->parentCF->keyID = $this->keyID;
     $this->obj = new TestSuperColumn($this->superName, $this->parentCF);
     PandraCore::connect('default', 'localhost');
 }
示例#2
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * To test multiple nodes, add their connection strings here
  *
  * @access protected
  */
 protected function setUp()
 {
     PandraCore::connect('default', 'localhost');
     $this->parent = new PandraColumnFamily();
     $this->parent->setKeySpace('Keyspace1');
     $this->parent->setName('Standard1');
     $this->obj = new PandraColumn($this->columnName);
 }
示例#3
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * To test multiple nodes, add their connection strings here
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->superColumnFamily = new PandraSuperColumnFamily();
     $this->superColumnFamily->setKeySpace('Keyspace1');
     $this->superColumnFamily->setName('Super1');
     $this->superColumnFamily->setKeyID($this->keyID);
     $this->obj = new PandraSuperColumn($this->superName);
     $this->obj->setParent($this->superColumnFamily);
     $this->obj->addColumn('city', 'string');
     $this->obj->addColumn('street', 'string');
     $this->obj->addColumn('zip', 'int');
     PandraCore::connect('default', 'localhost');
 }
示例#4
0
 /**
  * Connect to a good and bad host
  */
 public function testConnect()
 {
     $this->assertTrue(PandraCore::connect('default', 'localhost'));
     $this->assertFalse(PandraCore::connect('default_BAD', 'ih-opethishostdoesntexist'));
 }
<?php

/**
 * Example TimeUUIDType SuperColumnFamily.  The following new schema is needed
 * for Keyspace1 in Cassandra's storage-conf.xml
 *
 * <ColumnFamily ColumnType="Super"
 *                   CompareWith="TimeUUIDType"
 *                   CompareSubcolumnsWith="BytesType"
 *                   Name="SuperUUID1"
 *                   Comment="A column family with timeuuid ordered supercolumns and bytes type subcolumns"/>
 *
 */
require_once '../config.php';
PandraCore::connect('default', 'localhost');
$ks = 'Keyspace1';
$cfName = 'SuperUUID1';
$keyID = 'PandraTestUUID1';
$scf = new PandraSuperColumnFamily($keyID, $ks, $cfName, PandraColumnContainer::TYPE_UUID);
class BlogPost extends PandraSuperColumn
{
    public function init()
    {
        $this->addColumn('title');
        $this->addColumn('body');
    }
}
// A helper function to pump some random data into our blog entires
// @link http://www.php.net/manual/en/function.rand.php#90773
function rand_str($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890')
{
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->obj = new ColumnFamilyTestObject($this->_keyID);
     //$this->obj->setKeyID($this->_keyID);
     PandraCore::connect('default', 'localhost');
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @access protected
  */
 protected function setUp()
 {
     $this->obj = new TestCFSuper();
     $this->obj->setKeyID($this->_keyID);
     PandraCore::connect('default', 'localhost');
 }