|
package com .test .log .makefriends
import redis .clients .jedis .{ JedisPool , JedisPoolConfig }
import scala .collection .mutable .ArrayBuffer
/**
* @Author: jxx
* @Date: 2018/3/27 16:28
*/
object RedisUtil extends Serializable {
def redisUtil (data: ArrayBuffer [ Array [ Byte ]]): java .util . ArrayList [ AnyRef ] = {
var pool: JedisPool = null
if (pool == null ) {
val config = new JedisPoolConfig ()
config .setMaxTotal ( 96 )
config .setMaxIdle ( 64 )
config .setMaxWaitMillis ( 30000 )
config .setTestOnBorrow ( false )
pool = new JedisPool (config , "localhost" , port )
}
val jedis = pool .getResource
try {
val sids = new java .util .ArrayList [ AnyRef ]
for (key <- data ) sids .add (jedis .get (key ))
sids
} catch {
case _: Exception => null
} finally {
pool .close ()
}
}
} |
----------------------------
原文链接:https://blog.csdn.net/jxx4903049/article/details/79733021
程序猿的技术大观园:www.javathinker.net
[这个贴子最后由 flybird 在 2020-03-21 16:01:46 重新编辑]
|
网站系统异常
系统异常信息 |
Request URL:
http://www.javathinker.net/WEB-INF/lybbs/jsp/topic.jsp?postID=2942
java.lang.NullPointerException
如果你不知道错误发生的原因,请把上面完整的信息提交给本站管理人员。
|
|