首页天道酬勤redis实时计算,sparkstreaming部署

redis实时计算,sparkstreaming部署

张世龙 05-05 19:23 11次浏览
import Java.util.propertiesimportredis.clients.jedis.{ jedis,JedisPool, jdispoolconfig }/* * * @ class name : redis util * @ description : * @ author : kele * @ date :2021/3/17153360021 objectredisutil (varjedispool : Jedi spool=_ defgetjedisclient : jedis={ if (Jedi spool==null ) ) ) { pridi ropertiesutil.load (config.properties () val host : string=config.getproperty () ) reddoperties ) )。 val port : string=config.getproperty (redis.port ) (valjedispoolconfig=newjedispoolconfig ) ) jedis polconfig.strt config.setmaxidle(20 )//最大空闲数Jedispoolconfig.setminidle ) 20 )//最小空闲数jedispolconfig.setblockwhenexhauster忙/忙碌时等待毫秒的jedis poolconfig.settestonborrow ) (true ) /每次获取连接时Jedi spool=newjedispool (jedis poolconfig,host,host
常用的一些工具类,redis工具类封装