private void loadProperties()

in riak/src/main/java/site/ycsb/db/riak/RiakKVClient.java [109:170]


  private void loadProperties() {
    // First, load the default properties...
    loadDefaultProperties();

    // ...then, check for some props set at command line!
    Properties props = getProperties();

    String portString = props.getProperty(PORT_PROPERTY);
    if (portString != null) {
      port = Integer.parseInt(portString);
    }

    String hostsString = props.getProperty(HOST_PROPERTY);
    if (hostsString != null) {
      hosts = hostsString.split(",");
    }

    String bucketTypeString = props.getProperty(BUCKET_TYPE_PROPERTY);
    if (bucketTypeString != null) {
      bucketType = bucketTypeString;
    }

    String rValueString = props.getProperty(R_VALUE_PROPERTY);
    if (rValueString != null) {
      rvalue = new Quorum(Integer.parseInt(rValueString));
    }

    String wValueString = props.getProperty(W_VALUE_PROPERTY);
    if (wValueString != null) {
      wvalue = new Quorum(Integer.parseInt(wValueString));
    }

    String readRetryCountString = props.getProperty(READ_RETRY_COUNT_PROPERTY);
    if (readRetryCountString != null) {
      readRetryCount = Integer.parseInt(readRetryCountString);
    }

    String waitTimeBeforeRetryString = props.getProperty(WAIT_TIME_BEFORE_RETRY_PROPERTY);
    if (waitTimeBeforeRetryString != null) {
      waitTimeBeforeRetry = Integer.parseInt(waitTimeBeforeRetryString);
    }

    String transactionTimeLimitString = props.getProperty(TRANSACTION_TIME_LIMIT_PROPERTY);
    if (transactionTimeLimitString != null) {
      transactionTimeLimit = Integer.parseInt(transactionTimeLimitString);
    }

    String strongConsistencyString = props.getProperty(STRONG_CONSISTENCY_PROPERTY);
    if (strongConsistencyString != null) {
      strongConsistency = Boolean.parseBoolean(strongConsistencyString);
    }

    String strongConsistentScansBucketTypeString = props.getProperty(STRONG_CONSISTENT_SCANS_BUCKET_TYPE_PROPERTY);
    if (strongConsistentScansBucketTypeString != null) {
      strongConsistentScansBucketType = strongConsistentScansBucketTypeString;
    }

    String debugString = props.getProperty(DEBUG_PROPERTY);
    if (debugString != null) {
      debug = Boolean.parseBoolean(debugString);
    }
  }