text
stringlengths
0
14.1k
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage YouTube
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Username.php 24594 2012-01-05 21:27:01Z matthew $
*/
/**
* @see Zend_Gdata_Extension
*/
// require_once 'Zend/Gdata/Extension.php';
/**
* Represents the yt:username element
*
* @category Zend
* @package Zend_Gdata
* @subpackage YouTube
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_YouTube_Extension_Username extends Zend_Gdata_Extension
{
protected $_rootElement = 'username';
protected $_rootNamespace = 'yt';
public function __construct($text = null)
{
$this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces);
parent::__construct();
$this->_text = $text;
}
}
" mit
film42/mondrian_redis_segment_cache README.md 3298 "# MondrianRedisSegmentCache
Mondrian ships with an in memory segment cache that is great for standalone deployments of Mondrian, but doesn't
scale out with multiple nodes. An interface is provided for extending Mondrian with a shared Segment Cache and
examples of other implementations are in the links below.
In order to use Mondrian with Redis (our preferred caching layer) and Ruby (our preferred language -- Jruby) we had
to implement the SegmentCache interface from Mondrian and use the Redis notifications api.
Mondrian's segment cache needs to be able to get/set/remove cache items and also get any updates from the caching server
as other nodes are getting/setting/removing entries. This means that we need to use both the notifications and subscribe
api's from Redis.
http://stackoverflow.com/questions/17533594/implementing-a-mondrian-shared-segmentcache
http://mondrian.pentaho.com/api/mondrian/spi/SegmentCache.html
https://github.com/pentaho/mondrian/blob/master/src/main/mondrian/rolap/cache/MemorySegmentCache.java
https://github.com/webdetails/cdc
http://redis.io/topics/notifications
## Installation
Add this line to your application's Gemfile:
gem 'mondrian_redis_segment_cache'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mondrian_redis_segment_cache
## Usage
If using Rails you can put the configuration in an initializer
```ruby
require 'redis'
require 'mondrian_redis_segment_cache'
# Setup a Redis connection
MONDRIAN_REDIS_CONNECTION = Redis.new(:url => ""redis://localhost:1234/2"")
MONDRIAN_SEGMENT_CACHE = ::MondrianRedisSegmentCache::Cache.new(MONDRIAN_REDIS_CONNECTION)
# Register the segment cache with the Mondrian Injector
::Java::MondrianSpi::SegmentCache::SegmentCacheInjector::add_cache(MONDRIAN_SEGMENT_CACHE)
```
In Redis we use the notifications api, so you must turn it on!
It is off by default because it is a new feature and can be CPU intensive. Redis does a ton, so there is a minimum of notifications
that must be turned on for this gem to work.