使用astyanax cassandra驱动程序

时间:2016-03-21 14:13:22

标签: java multithreading tomcat cassandra astyanax

我在tomcat上使用astyanax cassandra驱动程序来访问cassandra中的数据。 同时停止tomcat服务器;它挂在从astyanax库开始的线程上。 有没有人遇到过这个问题?

Stacktrace

appears to have started a thread named [SMA_ScoreReset] but has failed to stop it. This is very likely to create a memory leak .

appears to have started a thread named [pool-7-thread-35] but has failed to stop it. This is very likely to create a memory leak

我确实有代码可以在关机时关闭连接

AstyanaxContext context = (AstyanaxContext)this.contextMap.get(ksName);
            if(context != null) {
                logger.info("shutdown context for keyspace " + ksName);
                ExecutorService asyncExecutor = context.getAstyanaxConfiguration().getAsyncExecutor();
                asyncExecutor.shutdown();

                try {
                    asyncExecutor.awaitTermination(10000L, TIMEUNIT);
                } catch (InterruptedException var6) {
                    ;
                }

                context.shutdown();`

0 个答案:

没有答案