Пример #1
0
        $client = self::getClient();
        try {
            return $client->get($keySpace, $keyID, $columnPath, self::getConsistency($consistencyLevel));
        } catch (TException $te) {
            self::registerError('TException: ' . $te->getMessage() . ' ' . $te->why);
            return NULL;
        }
    }
    /**
     * @param string $keySpace keyspace of key
     * @param array $keyRange associative array of keys indexed by 'start' and 'finish'
     * @param cassandra_ColumnParent $columnParent
     * @param cassandra_SlicePredicate $predicate column names or range predicate
     * @param int number of rows to return
     * @param int $consistencyLevel response consistency level
     * @return <type>
     */
    public static function getRangeKeys($keySpace, array $keyRange, cassandra_ColumnParent $columnParent, cassandra_SlicePredicate $predicate, $numRows = DEFAULT_ROW_LIMIT, $consistencyLevel = NULL)
    {
        $client = self::getClient();
        try {
            return $client->get_range_slice($keySpace, $columnParent, $predicate, $keyRange['start'], $keyRange['finish'], $numRows, self::getConsistency($consistencyLevel));
        } catch (TException $te) {
            self::registerError('TException: ' . $te->getMessage() . ' ' . $te->why);
            return NULL;
        }
    }
}
// Setup our capabilities
PandraCore::setMemcachedAvailable(class_exists('Memcached'));
PandraCore::setAPCAvailable(function_exists('apc_sma_info') && apc_sma_info() !== FALSE);