private void createKeyspace()

in cassandra/src/main/java/org/apache/ignite/activestore/impl/cassandra/session/CassandraSessionImpl.java [527:556]


    private void createKeyspace(KeyValuePersistenceSettings settings) {
        if (settings.getKeyspace() == null || settings.getKeyspace().trim().isEmpty()) {
            throw new IllegalArgumentException("Keyspace name should be specified");
        }
        int attempt = 0;
        Throwable error = null;
        String errorMsg = "Failed to create Cassandra keyspace '" + settings.getKeyspace() + "'";
        RandomSleeper sleeper = newSleeper();
        String statement = settings.getKeyspaceDDLStatement();
        while (attempt < CQL_EXECUTION_ATTEMPTS_COUNT) {
            try {
                session().execute(statement);
                return;
            }
            catch (AlreadyExistsException ignored) {
                return;
            }
            catch (Throwable e) {
                if (!CassandraHelper.isHostsAvailabilityError(e)) {
                    throw new IgniteException(errorMsg, e);
                }
                handleHostsAvailabilityError(e, attempt, errorMsg);
                error = e;
            }
            sleeper.sleep();
            attempt++;
        }

        throw new IgniteException(errorMsg, error);
    }