All Downloads are FREE. Search and download functionalities are using the official Maven repository.

brooklyn.entity.nosql.redis.RedisStore Maven / Gradle / Ivy

There is a newer version: 0.7.0-M1
Show newest version
package brooklyn.entity.nosql.redis;

import brooklyn.catalog.Catalog;
import brooklyn.config.ConfigKey;
import brooklyn.entity.basic.SoftwareProcess;
import brooklyn.entity.nosql.DataStore;
import brooklyn.entity.proxying.ImplementedBy;
import brooklyn.event.AttributeSensor;
import brooklyn.event.basic.BasicAttributeSensor;
import brooklyn.event.basic.BasicAttributeSensorAndConfigKey;
import brooklyn.event.basic.BasicConfigKey;
import brooklyn.event.basic.PortAttributeSensorAndConfigKey;
import brooklyn.util.flags.SetFromFlag;

/**
 * An entity that represents a Redis key-value store service.
 *
 * TODO add sensors with Redis statistics using INFO command
 */
@Catalog(name="Redis Server", description="Redis is an open-source, networked, in-memory, key-value data store with optional durability", iconUrl="classpath:///redis-logo.jpeg")
@ImplementedBy(RedisStoreImpl.class)
public interface RedisStore extends SoftwareProcess, DataStore {

    @SetFromFlag("version")
    BasicConfigKey SUGGESTED_VERSION =
            new BasicConfigKey(SoftwareProcess.SUGGESTED_VERSION, "2.6.7");

    @SetFromFlag("downloadUrl")
    BasicAttributeSensorAndConfigKey DOWNLOAD_URL = new BasicAttributeSensorAndConfigKey(
            SoftwareProcess.DOWNLOAD_URL, "http://redis.googlecode.com/files/redis-${version}.tar.gz");

    @SetFromFlag("redisPort")
    PortAttributeSensorAndConfigKey REDIS_PORT = new PortAttributeSensorAndConfigKey("redis.port", "Redis port number", 6379);

    @SetFromFlag("redisConfigTemplateUrl")
    ConfigKey REDIS_CONFIG_TEMPLATE_URL = new BasicConfigKey(
            String.class, "redis.config.templateUrl", "Template file (in freemarker format) for the redis.conf config file", 
            "classpath://brooklyn/entity/nosql/redis/redis.conf");

    AttributeSensor UPTIME = new BasicAttributeSensor(Integer.class, "redis.uptime", "Redis uptime in seconds");

    // See http://redis.io/commands/info for details of all information available
    AttributeSensor TOTAL_CONNECTIONS_RECEIVED = new BasicAttributeSensor(Integer.class, "redis.connections.received.total", "Total number of connections accepted by the server");
    AttributeSensor TOTAL_COMMANDS_PROCESSED = new BasicAttributeSensor(Integer.class, "redis.commands.processed.total", "Total number of commands processed by the server");
    AttributeSensor EXPIRED_KEYS = new BasicAttributeSensor(Integer.class, "redis.keys.expired", "Total number of key expiration events");
    AttributeSensor EVICTED_KEYS = new BasicAttributeSensor(Integer.class, "redis.keys.evicted", "Number of evicted keys due to maxmemory limit");
    AttributeSensor KEYSPACE_HITS = new BasicAttributeSensor(Integer.class, "redis.keyspace.hits", "Number of successful lookup of keys in the main dictionary");
    AttributeSensor KEYSPACE_MISSES = new BasicAttributeSensor(Integer.class, "redis.keyspace.misses", "Number of failed lookup of keys in the main dictionary");

    String getAddress();

    Integer getRedisPort();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy