congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ConnectionException.setHost
Code IndexAdd Tabnine to your IDE (free)

How to use
setHost
method
in
com.netflix.astyanax.connectionpool.exceptions.ConnectionException

Best Java code snippets using com.netflix.astyanax.connectionpool.exceptions.ConnectionException.setHost (Showing top 6 results out of 315)

origin: com.bazaarvoice.astyanax/astyanax-core

  private void informException(ConnectionException connectionException) throws ConnectionException {
    connectionException
      .setHost(getCurrentHost())
      .setLatency(System.currentTimeMillis() - startTime)
      .setAttempt(this.attemptCounter)
      .setLatencyWithPool(System.currentTimeMillis() - poolStartTime);

    if (connectionException instanceof IsRetryableException) {
      if (!canRetry()) {
        throw connectionException;
      }
    }
    else {
      // Most likely an operation error
      throw connectionException;
    }
  }        
}
origin: com.netflix.astyanax/astyanax-core

  private void informException(ConnectionException connectionException) throws ConnectionException {
    connectionException
      .setHost(getCurrentHost())
      .setLatency(System.currentTimeMillis() - startTime)
      .setAttempt(this.attemptCounter)
      .setLatencyWithPool(System.currentTimeMillis() - poolStartTime);

    if (connectionException instanceof IsRetryableException) {
      if (!canRetry()) {
        throw connectionException;
      }
    }
    else {
      // Most likely an operation error
      throw connectionException;
    }
  }        
}
origin: com.bazaarvoice.astyanax/astyanax-core

@Override
public void open() throws ConnectionException {
  TestHostType type = TestHostType.get(getHost().getPort());
  try {
    type.open(0);
    isOpen = true;
    monitor.incConnectionCreated(getHost());
  } catch (ConnectionException e) {
    lastException = e;
    e.setHost(getHost());
    monitor.incConnectionCreateFailed(getHost(), e);
    throw e;
  }
}
origin: com.netflix.astyanax/astyanax-core

@Override
public void open() throws ConnectionException {
  TestHostType type = TestHostType.get(getHost().getPort());
  try {
    type.open(0);
    isOpen = true;
    monitor.incConnectionCreated(getHost());
  } catch (ConnectionException e) {
    lastException = e;
    e.setHost(getHost());
    monitor.incConnectionCreateFailed(getHost(), e);
    throw e;
  }
}
origin: com.netflix.astyanax/astyanax-thrift

pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), System.nanoTime());
closeClient();
ConnectionException ce = ThriftConverter.ToConnectionPoolException(e).setHost(getHost())
    .setLatency(System.currentTimeMillis() - startTime);
monitor.incConnectionCreateFailed(getHost(), ce);
pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), System.nanoTime());
closeClient();
ConnectionException ce = ThriftConverter.ToConnectionPoolException(new RuntimeException("Error openning connection", t)).setHost(getHost())
    .setLatency(System.currentTimeMillis() - startTime);
monitor.incConnectionCreateFailed(getHost(), ce);
origin: com.bazaarvoice.astyanax/astyanax-thrift

pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), System.nanoTime());
closeClient();
ConnectionException ce = ThriftConverter.ToConnectionPoolException(e).setHost(getHost())
    .setLatency(System.currentTimeMillis() - startTime);
monitor.incConnectionCreateFailed(getHost(), ce);
pool.addLatencySample(TimeUnit.NANOSECONDS.convert(cpConfig.getSocketTimeout(), TimeUnit.MILLISECONDS), System.nanoTime());
closeClient();
ConnectionException ce = ThriftConverter.ToConnectionPoolException(new RuntimeException("Error openning connection", t)).setHost(getHost())
    .setLatency(System.currentTimeMillis() - startTime);
monitor.incConnectionCreateFailed(getHost(), ce);
com.netflix.astyanax.connectionpool.exceptionsConnectionExceptionsetHost

Popular methods of ConnectionException

  • getMessage
  • printStackTrace
  • setLatency
  • getHost
  • setAttempt
  • setLatencyWithPool

Popular in Java

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • putExtra (Intent)
  • setContentView (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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