Thanks to user wolpert for the example (http://github.com/wolpert/)
private static final ThreadLocal <Keyspace> keyspaceHolder = new ThreadLocal <Keyspace> () { @Override protected Keyspace initialValue() { Cluster cluster = HFactory.getOrCreateCluster(clusterName, servers); return createKeyspace(keyspace, cluster); } }; public static Keyspace getKeyspace() { return keyspaceHolder.get(); }
There was an error while loading. Please reload this page.