本文整理汇总了Java中storm.trident.state.BaseQueryFunction类的典型用法代码示例。如果您正苦于以下问题:Java BaseQueryFunction类的具体用法?Java BaseQueryFunction怎么用?Java BaseQueryFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseQueryFunction类属于storm.trident.state包,在下文中一共展示了BaseQueryFunction类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStateQuery
import storm.trident.state.BaseQueryFunction; //导入依赖的package包/类
public static BaseQueryFunction getStateQuery(ConfigData config, String key, String bucket) throws CacheNotValidException{
if(config.getCacheType().equals("gridgain")){
return new GridGainQuery(key);
}else if(config.getCacheType().equals("riak")){
return new RiakQuery(key);
} else if(config.getCacheType().equals("memcached") || config.getCacheType().equals("memory")){
return new MemcachedQuery(key, bucket);
}else{
throw new CacheNotValidException("Not cache backend found: " + config.getCacheType());
}
}
示例2: getStateLocationQuery
import storm.trident.state.BaseQueryFunction; //导入依赖的package包/类
public static BaseQueryFunction getStateLocationQuery(ConfigData config) throws CacheNotValidException {
if(config.getCacheType().equals("gridgain")){
return new GridGainLocationQuery("client_mac");
}else if(config.getCacheType().equals("riak")){
return new RiakLocationQuery("client_mac");
}else if(config.getCacheType().equals("memcached") || config.getCacheType().equals("memory")){
return new MemcachedLocationQuery("client_mac", "location");
} else {
throw new CacheNotValidException("Not cache backend found: " + config.getCacheType());
}
}
示例3: getStateLocationV10Query
import storm.trident.state.BaseQueryFunction; //导入依赖的package包/类
public static BaseQueryFunction getStateLocationV10Query(ConfigData config) throws CacheNotValidException {
if(config.getCacheType().equals("gridgain")){
return new GridGainLocationV10Query("deviceId");
}else if(config.getCacheType().equals("riak")){
return new RiakLocationV10Query("deviceId");
}else if(config.getCacheType().equals("memcached") || config.getCacheType().equals("memory")){
return new MemcachedLocationV10Query("deviceId", "location-info");
} else {
throw new CacheNotValidException("Not cache backend found: " + config.getCacheType());
}
}
示例4: getStateTrapQuery
import storm.trident.state.BaseQueryFunction; //导入依赖的package包/类
public static BaseQueryFunction getStateTrapQuery(ConfigData config) throws CacheNotValidException {
if(config.getCacheType().equals("gridgain")){
return new GridGainTrapQuery("client_mac");
}else if(config.getCacheType().equals("riak")){
return new RiakTrapQuery("client_mac");
}else if(config.getCacheType().equals("memcached") || config.getCacheType().equals("memory")){
return new MemcachedTrapQuery("client_mac", "trap");
} else {
throw new CacheNotValidException("Not cache backend found: " + config.getCacheType());
}
}
示例5: getStateNmspMeasureQuery
import storm.trident.state.BaseQueryFunction; //导入依赖的package包/类
public static BaseQueryFunction getStateNmspMeasureQuery(ConfigData config) throws CacheNotValidException {
if(config.getCacheType().equals("gridgain")){
return new GridGainNmspMeasureQuery("client_mac");
}else if(config.getCacheType().equals("riak")){
return new RiakNmspMeasureQuery("client_mac");
}else if(config.getCacheType().equals("memcached") || config.getCacheType().equals("memory")){
return new MemcachedNmspMeasureQuery("client_mac", "nmsp");
} else {
throw new CacheNotValidException("Not cache backend found: " + config.getCacheType());
}
}
示例6: getStateEventsLocationNmspQuery
import storm.trident.state.BaseQueryFunction; //导入依赖的package包/类
public static BaseQueryFunction getStateEventsLocationNmspQuery(ConfigData config, String key, String bucket) throws CacheNotValidException {
if(config.getCacheType().equals("gridgain")){
return new GridGainEventsLocationNmspQuery(key);
}else if(config.getCacheType().equals("riak")){
return new RiakEventsLocationNmspQuery(key);
}else if(config.getCacheType().equals("memcached") || config.getCacheType().equals("memory")){
return new MemcachedEventsLocationNmspQuery(key, bucket);
} else {
throw new CacheNotValidException("Not cache backend found: " + config.getCacheType());
}
}
示例7: getStateEventsLocationMseQuery
import storm.trident.state.BaseQueryFunction; //导入依赖的package包/类
public static BaseQueryFunction getStateEventsLocationMseQuery(ConfigData config, String key, String bucket) throws CacheNotValidException {
if(config.getCacheType().equals("gridgain")){
return new GridGainEventsLocationMseQuery(key);
}else if(config.getCacheType().equals("riak")){
return new RiakEventsLocationMseQuery(key);
}else if(config.getCacheType().equals("memcached") || config.getCacheType().equals("memory")){
return new MemcachedEventsLocationMseQuery(key, bucket);
} else {
throw new CacheNotValidException("Not cache backend found: " + config.getCacheType());
}
}