private static Keyspace open(String keyspaceName, Schema schema, boolean loadSSTables) { Keyspace keyspaceInstance = schema.getKeyspaceInstance(keyspaceName); if (keyspaceInstance == null) { // instantiate the Keyspace. we could use putIfAbsent but it's important to making sure it is only done once // per keyspace, so we synchronize and re-check before doing it. synchronized (Keyspace.class) { keyspaceInstance = schema.getKeyspaceInstance(keyspaceName); if (keyspaceInstance == null) { // open and store the keyspace keyspaceInstance = new Keyspace(keyspaceName, loadSSTables); schema.storeKeyspaceInstance(keyspaceInstance); } } } return keyspaceInstance; }
private static Keyspace open(String keyspaceName, Schema schema, boolean loadSSTables) { Keyspace keyspaceInstance = schema.getKeyspaceInstance(keyspaceName); if (keyspaceInstance == null) { // instantiate the Keyspace. we could use putIfAbsent but it's important to making sure it is only done once // per keyspace, so we synchronize and re-check before doing it. synchronized (Keyspace.class) { keyspaceInstance = schema.getKeyspaceInstance(keyspaceName); if (keyspaceInstance == null) { // open and store the keyspace keyspaceInstance = new Keyspace(keyspaceName, loadSSTables); schema.storeKeyspaceInstance(keyspaceInstance); } } } return keyspaceInstance; }
private static Keyspace open(String keyspaceName, Schema schema, boolean loadSSTables) { Keyspace keyspaceInstance = schema.getKeyspaceInstance(keyspaceName); if (keyspaceInstance == null) { // instantiate the Keyspace. we could use putIfAbsent but it's important to making sure it is only done once // per keyspace, so we synchronize and re-check before doing it. synchronized (Keyspace.class) { keyspaceInstance = schema.getKeyspaceInstance(keyspaceName); if (keyspaceInstance == null) { // open and store the keyspace keyspaceInstance = new Keyspace(keyspaceName, loadSSTables); schema.storeKeyspaceInstance(keyspaceInstance); } } } return keyspaceInstance; }
private static Keyspace open(String keyspaceName, Schema schema, boolean loadSSTables) { Keyspace keyspaceInstance = schema.getKeyspaceInstance(keyspaceName); if (keyspaceInstance == null) { // instantiate the Keyspace. we could use putIfAbsent but it's important to making sure it is only done once // per keyspace, so we synchronize and re-check before doing it. synchronized (Keyspace.class) { keyspaceInstance = schema.getKeyspaceInstance(keyspaceName); if (keyspaceInstance == null) { // open and store the keyspace keyspaceInstance = new Keyspace(keyspaceName, loadSSTables); schema.storeKeyspaceInstance(keyspaceInstance); } } } return keyspaceInstance; }