Example usage for org.apache.cassandra.utils FBUtilities getReleaseVersionString

List of usage examples for org.apache.cassandra.utils FBUtilities getReleaseVersionString

Introduction

In this page you can find the example usage for org.apache.cassandra.utils FBUtilities getReleaseVersionString.

Prototype

public static String getReleaseVersionString() 

Source Link

Usage

From source file:com.netflix.priam.cassandra.extensions.PriamStartupAgent.java

License:Apache License

private void setPriamProperties() {
    String token = null;/*from   www  .j  a  v a  2 s  .  c  om*/
    String seeds = null;
    boolean isReplace = false;
    String replacedIp = "";

    while (true) {
        try {
            token = DataFetcher.fetchData("http://127.0.0.1:8080/Priam/REST/v1/cassconfig/get_token");
            seeds = DataFetcher.fetchData("http://127.0.0.1:8080/Priam/REST/v1/cassconfig/get_seeds");
            isReplace = Boolean.parseBoolean(
                    DataFetcher.fetchData("http://127.0.0.1:8080/Priam/REST/v1/cassconfig/is_replace_token"));
            replacedIp = DataFetcher
                    .fetchData("http://127.0.0.1:8080/Priam/REST/v1/cassconfig/get_replaced_ip");
        } catch (Exception e) {
            System.out
                    .println("Failed to obtain startup data from priam, can not start yet. will retry shortly");
            e.printStackTrace();
        }

        if (token != null && seeds != null)
            break;
        try {
            Thread.sleep(5 * 1000);
        } catch (InterruptedException e1) {
            // do nothing.
        }
    }

    System.setProperty("cassandra.initial_token", token);

    if (isReplace) {
        System.out.println("Detect cassandra version : " + FBUtilities.getReleaseVersionString());
        if (FBUtilities.getReleaseVersionString().compareTo(REPLACED_ADDRESS_MIN_VER) < 0) {
            System.setProperty("cassandra.replace_token", token);
        } else {
            System.setProperty("cassandra.replace_address", replacedIp);
        }
    }

}

From source file:com.perpetumobile.bit.orm.cassandra.CliMain.java

License:Apache License

public void printBanner() {
    sessionState.out//from   www . j  a  va2 s .  co  m
            .println("Welcome to Cassandra CLI version " + FBUtilities.getReleaseVersionString() + "\n");
    sessionState.out.println(getHelp().banner);
}