congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Host
Code IndexAdd Tabnine to your IDE (free)

How to use
Host
in
com.aerospike.client

Best Java code snippets using com.aerospike.client.Host (Showing top 20 results out of 315)

origin: aerospike/aerospike-client-java

/**
 * Initialize Aerospike client.
 * The client policy is used to set defaults and size internal data structures.
 * If the host connection succeeds, the client will:
 * <p>
 * - Add host to the cluster map <br>
 * - Request host's list of other nodes in cluster <br>
 * - Add these nodes to cluster map <br>
 * <p>
 * If the connection succeeds, the client is ready to process database requests.
 * If the connection fails and the policy's failOnInvalidHosts is true, a connection
 * exception will be thrown. Otherwise, the cluster will remain in a disconnected state
 * until the server is activated.
 *
 * @param policy                client configuration parameters, pass in null for defaults
 * @param hostname                host name
 * @param port                    host port
 * @throws AerospikeException    if host connection fails
 */
public AerospikeClient(ClientPolicy policy, String hostname, int port) throws AerospikeException {
  this(policy, new Host(hostname, port));
}
origin: aerospike/aerospike-client-java

private final boolean findSeed(Host search) {
  for (Host seed : seeds) {
    if (seed.equals(search)) {
      return true;
    }
  }
  return false;
}
origin: aerospike/aerospike-loader

  hosts = Host.parseHosts(cl.getOptionValue("hosts"), port);
} else {
  hosts = new Host[1];
  hosts[0] = new Host("127.0.0.1", port);
origin: com.aerospike/aerospike-client

List<Host> hosts = Host.parseServiceHosts(result);
Host h;
      h = new Host(alt, h.port);
  if (h.equals(this.primaryHost)) {
        h = new Host(alt, h.port);
          this.primaryHost = new Host(address.getHostAddress(), tlsName, h.port);
          this.primaryAddress = socketAddress;
          this.primaryConn.close();
origin: com.aerospike/aerospike-client

List<Host> hosts = Host.parseServiceHosts(result);
Host clearHost;
        clearHost = new Host(alternativeHost, clearHost.port);
origin: aerospike/aerospike-client-java

/**
 * Connect and run one or more client examples.
 */
public static void runExamples(Console console, Parameters params, List<String> examples) throws Exception {
  ClientPolicy policy = new ClientPolicy();
  policy.user = params.user;
  policy.password = params.password;
  policy.authMode = params.authMode;
  policy.tlsPolicy = params.tlsPolicy;
  
  params.policy = policy.readPolicyDefault;
  params.writePolicy = policy.writePolicyDefault;
  Host[] hosts = Host.parseHosts(params.host, params.port);
  AerospikeClient client = new AerospikeClient(policy, hosts);
  try {
    params.setServerSpecific(client);
    for (String exampleName : examples) {
      runExample(exampleName, client, params, console);
    }
  }
  finally {
    client.close();
  }
}
origin: aerospike/aerospike-client-java

this.hosts = Host.parseHosts(line.getOptionValue("hosts"), this.port);
this.hosts[0] = new Host("127.0.0.1", this.port);
origin: aerospike/aerospike-client-java

List<Host> hosts = Host.parseServiceHosts(result);
Host h;
      h = new Host(alt, h.port);
  if (h.equals(this.primaryHost)) {
        h = new Host(alt, h.port);
          this.primaryHost = new Host(address.getHostAddress(), tlsName, h.port);
          this.primaryAddress = socketAddress;
          this.primaryConn.close();
origin: aerospike/aerospike-client-java

List<Host> hosts = Host.parseServiceHosts(result);
Host clearHost;
        clearHost = new Host(alternativeHost, clearHost.port);
origin: aerospike/aerospike-client-java

params.writePolicy = policy.writePolicyDefault;
Host[] hosts = Host.parseHosts(params.host, params.port);
origin: com.aerospike/aerospike-client

/**
 * Initialize Aerospike client.
 * The client policy is used to set defaults and size internal data structures.
 * If the host connection succeeds, the client will:
 * <p>
 * - Add host to the cluster map <br>
 * - Request host's list of other nodes in cluster <br>
 * - Add these nodes to cluster map <br>
 * <p>
 * If the connection succeeds, the client is ready to process database requests.
 * If the connection fails and the policy's failOnInvalidHosts is true, a connection
 * exception will be thrown. Otherwise, the cluster will remain in a disconnected state
 * until the server is activated.
 *
 * @param policy                client configuration parameters, pass in null for defaults
 * @param hostname                host name
 * @param port                    host port
 * @throws AerospikeException    if host connection fails
 */
public AerospikeClient(ClientPolicy policy, String hostname, int port) throws AerospikeException {
  this(policy, new Host(hostname, port));
}
origin: com.aerospike/aerospike-client

private final boolean findSeed(Host search) {
  for (Host seed : seeds) {
    if (seed.equals(search)) {
      return true;
    }
  }
  return false;
}
origin: com.aerospike/aerospike-client

private void setAliases(InetAddress[] addresses, String tlsName, int port) {
  // Add capacity for current address aliases plus IPV6 address and hostname.
  this.aliases = new ArrayList<Host>(addresses.length + 2);
  for (InetAddress address : addresses) {
    this.aliases.add(new Host(address.getHostAddress(), tlsName, port));
  }
}
origin: aerospike/aerospike-client-java

private void setAliases(InetAddress[] addresses, String tlsName, int port) {
  // Add capacity for current address aliases plus IPV6 address and hostname.
  this.aliases = new ArrayList<Host>(addresses.length + 2);
  for (InetAddress address : addresses) {
    this.aliases.add(new Host(address.getHostAddress(), tlsName, port));
  }
}
origin: com.spikeify/core

public static void globalConfig(String defaultNamespace, int port, String... urls) {
  Host[] hosts = new Host[urls.length];
  for (int i = 0; i < hosts.length; i++) {
    hosts[i] = new Host(urls[i], port);
  }
  globalConfig(defaultNamespace, hosts);
}
origin: com.spikeify/core

/**
 * Creates a new instance of Spikeify with given parameters.
 *
 * @param namespace Default namespace
 * @param port      Default port
 * @param hosts     Aerospike server hosts
 * @return Spikeify instance
 */
public static Spikeify instance(String namespace, int port, String... hosts) {
  Host[] hostsH = new Host[hosts.length];
  for (int i = 0; i < hosts.length; i++) {
    hostsH[i] = new Host(hosts[i], port);
  }
  return instance(namespace, hostsH);
}
origin: com.aerospike/aerospike-client

/**
 * Initialize Aerospike client.
 * If the host connection succeeds, the client will:
 * <p>
 * - Add host to the cluster map <br>
 * - Request host's list of other nodes in cluster <br>
 * - Add these nodes to cluster map <br>
 * <p>
 * If the connection succeeds, the client is ready to process database requests.
 * If the connection fails, the cluster will remain in a disconnected state
 * until the server is activated.
 *
 * @param hostname                host name
 * @param port                    host port
 * @throws AerospikeException    if host connection fails
 */
public AerospikeClient(String hostname, int port) throws AerospikeException {
  this(new ClientPolicy(), new Host(hostname, port));
}
origin: aerospike/aerospike-client-java

/**
 * Initialize Aerospike client.
 * If the host connection succeeds, the client will:
 * <p>
 * - Add host to the cluster map <br>
 * - Request host's list of other nodes in cluster <br>
 * - Add these nodes to cluster map <br>
 * <p>
 * If the connection succeeds, the client is ready to process database requests.
 * If the connection fails, the cluster will remain in a disconnected state
 * until the server is activated.
 *
 * @param hostname                host name
 * @param port                    host port
 * @throws AerospikeException    if host connection fails
 */
public AerospikeClient(String hostname, int port) throws AerospikeException {
  this(new ClientPolicy(), new Host(hostname, port));
}
origin: aerospike/aerospike-client-java

private List<Host> parseServiceHosts() {
  ArrayList<Host> list = new ArrayList<Host>();
  String hostname;
  int port;
  while (offset < length) {
    if (c != ',') {
      throw new RuntimeException();
    }
    hostname = parseHost();
    if (c != ':') {
      throw new RuntimeException();
    }
    String s = parseString();
    port = Integer.parseInt(s);
    list.add(new Host(hostname, port));
  }
  return list;
}
origin: com.aerospike/aerospike-client

private List<Host> parseServiceHosts() {
  ArrayList<Host> list = new ArrayList<Host>();
  String hostname;
  int port;
  while (offset < length) {
    if (c != ',') {
      throw new RuntimeException();
    }
    hostname = parseHost();
    if (c != ':') {
      throw new RuntimeException();
    }
    String s = parseString();
    port = Integer.parseInt(s);
    list.add(new Host(hostname, port));
  }
  return list;
}
com.aerospike.clientHost

Javadoc

Host name/port of database server.

Most used methods

  • <init>
    Initialize host.
  • parseHosts
    Parse command-line hosts from string format: hostname1[:tlsname1][:port1],... Hostname may also be
  • equals
  • parseServiceHosts
    Parse server service hosts from string format: hostname1:port1,... Hostname may also be an IP addres

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now