public void start()

in src/main/java/org/apache/fineract/cn/cassandra/core/CassandraJourney.java [51:77]


  public void start(final CassandraJourneyRoute cassandraJourneyRoute) {
    // check for version
    final ResultSet resultSet = session.execute(
        QueryBuilder
            .select("hash_value")
            .from(this.schemaTableName)
            .where(QueryBuilder.eq("version", cassandraJourneyRoute.getVersion()))
    );

    if (!resultSet.isExhausted()) {
      final Row row = resultSet.one();
      final Integer fetchedHashValue = row.get("hash_value", Integer.class);
      if (!Objects.equals(fetchedHashValue, cassandraJourneyRoute.getHashValue())) {
        throw new IllegalStateException("Version mismatch for " + cassandraJourneyRoute.getVersion());
      }
    } else {
      cassandraJourneyRoute.getCassandraJourneyWaypoints()
          .forEach(waypoint -> this.session.execute(waypoint.getStatement()));

      this.session.execute(
          QueryBuilder
              .insertInto(this.schemaTableName)
              .value("version", cassandraJourneyRoute.getVersion())
              .value("hash_value", cassandraJourneyRoute.getHashValue())
      );
    }
  }