All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.driver.core.TabletInfo Maven / Gradle / Ivy

Go to download

A driver for Scylla and Apache Cassandra 1.2+ that works exclusively with the Cassandra Query Language version 3 (CQL3) and Cassandra's binary protocol.

The newest version!
package com.datastax.driver.core;

import java.util.List;
import java.util.Map;

public class TabletInfo {
  private static final String SCYLLA_TABLETS_STARTUP_OPTION_KEY = "TABLETS_ROUTING_V1";
  private static final String SCYLLA_TABLETS_STARTUP_OPTION_VALUE = "";
  public static final String TABLETS_ROUTING_V1_CUSTOM_PAYLOAD_KEY = "tablets-routing-v1";

  private boolean enabled = false;

  private TabletInfo(boolean enabled) {
    this.enabled = enabled;
  }

  // Currently pertains only to TABLETS_ROUTING_V1
  public boolean isEnabled() {
    return enabled;
  }

  public static TabletInfo parseTabletInfo(Map> supported) {
    List values = supported.get(SCYLLA_TABLETS_STARTUP_OPTION_KEY);
    return new TabletInfo(
        values != null
            && values.size() == 1
            && values.get(0).equals(SCYLLA_TABLETS_STARTUP_OPTION_VALUE));
  }

  public static void addOption(Map options) {
    options.put(SCYLLA_TABLETS_STARTUP_OPTION_KEY, SCYLLA_TABLETS_STARTUP_OPTION_VALUE);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy