congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ConnectionClosingException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.hadoop.hbase.exceptions.ConnectionClosingException
constructor

Best Java code snippets using org.apache.hadoop.hbase.exceptions.ConnectionClosingException.<init> (Showing top 15 results out of 315)

origin: apache/hbase

 /**
  * Cleans the call not yet sent when we finish.
  */
 public void cleanup(IOException e) {
  IOException ie = new ConnectionClosingException(
    "Connection to " + remoteId.address + " is closing.");
  for (Call call : callsToWrite) {
   call.setException(ie);
  }
  callsToWrite.clear();
 }
}
origin: apache/hbase

   "Call to " + addr + " failed because " + exception).initCause(exception);
} else if (exception instanceof ConnectionClosingException) {
 return (ConnectionClosingException) new ConnectionClosingException(
   "Call to " + addr + " failed on local exception: " + exception).initCause(exception);
} else if (exception instanceof ServerTooBusyException) {
origin: apache/hbase

 @Test
 public void testWrapException() throws Exception {
  final InetSocketAddress address = InetSocketAddress.createUnresolved("localhost", 0);
  assertTrue(wrapException(address, new ConnectException()) instanceof ConnectException);
  assertTrue(
   wrapException(address, new SocketTimeoutException()) instanceof SocketTimeoutException);
  assertTrue(wrapException(address, new ConnectionClosingException(
    "Test AbstractRpcClient#wrapException")) instanceof ConnectionClosingException);
  assertTrue(
   wrapException(address, new CallTimeoutException("Test AbstractRpcClient#wrapException"))
     .getCause() instanceof CallTimeoutException);
 }
}
origin: org.apache.hbase/hbase-client

 /**
  * Cleans the call not yet sent when we finish.
  */
 public void cleanup(IOException e) {
  IOException ie = new ConnectionClosingException(
    "Connection to " + remoteId.address + " is closing.");
  for (Call call : callsToWrite) {
   call.setException(ie);
  }
  callsToWrite.clear();
 }
}
origin: org.apache.hbase/hbase-client

   "Call to " + addr + " failed because " + exception).initCause(exception);
} else if (exception instanceof ConnectionClosingException) {
 return (ConnectionClosingException) new ConnectionClosingException(
   "Call to " + addr + " failed on local exception: " + exception).initCause(exception);
} else if (exception instanceof ServerTooBusyException) {
origin: org.apache.hbase/hbase-client

 @Test
 public void testWrapException() throws Exception {
  final InetSocketAddress address = InetSocketAddress.createUnresolved("localhost", 0);
  assertTrue(wrapException(address, new ConnectException()) instanceof ConnectException);
  assertTrue(
   wrapException(address, new SocketTimeoutException()) instanceof SocketTimeoutException);
  assertTrue(wrapException(address, new ConnectionClosingException(
    "Test AbstractRpcClient#wrapException")) instanceof ConnectionClosingException);
  assertTrue(
   wrapException(address, new CallTimeoutException("Test AbstractRpcClient#wrapException"))
     .getCause() instanceof CallTimeoutException);
 }
}
origin: com.aliyun.hbase/alihbase-client

 /**
  * Cleans the call not yet sent when we finish.
  */
 public void cleanup(IOException e) {
  IOException ie = new ConnectionClosingException(
    "Connection to " + remoteId.address + " is closing.");
  for (Call call : callsToWrite) {
   call.setException(ie);
  }
  callsToWrite.clear();
 }
}
origin: harbby/presto-connectors

/**
 * @throws IOException if the connection is not open.
 */
private void checkIsOpen() throws IOException {
 if (shouldCloseConnection.get()) {
  throw new ConnectionClosingException(getName() + " is closing");
 }
}
origin: harbby/presto-connectors

 /**
  * Cleans the call not yet sent when we finish.
  */
 private void cleanup() {
  assert shouldCloseConnection.get();
  IOException ie = new ConnectionClosingException("Connection to " + server + " is closing.");
  while (true) {
   CallFuture cts = callsToWrite.poll();
   if (cts == null) {
    break;
   }
   if (cts.call != null && !cts.call.done) {
    cts.call.setException(ie);
   }
  }
 }
}
origin: harbby/presto-connectors

/**
 * Takes an Exception and the address we were trying to connect to and return an IOException with
 * the input exception as the cause. The new exception provides the stack trace of the place where
 * the exception is thrown and some extra diagnostics information. If the exception is
 * ConnectException or SocketTimeoutException, return a new one of the same type; Otherwise return
 * an IOException.
 * @param addr target address
 * @param exception the relevant exception
 * @return an exception to throw
 */
protected IOException wrapException(InetSocketAddress addr, Exception exception) {
 if (exception instanceof ConnectException) {
  // connection refused; include the host:port in the error
  return (ConnectException) new ConnectException("Call to " + addr
    + " failed on connection exception: " + exception).initCause(exception);
 } else if (exception instanceof SocketTimeoutException) {
  return (SocketTimeoutException) new SocketTimeoutException("Call to " + addr
    + " failed because " + exception).initCause(exception);
 } else if (exception instanceof ConnectionClosingException) {
  return (ConnectionClosingException) new ConnectionClosingException("Call to " + addr
    + " failed on local exception: " + exception).initCause(exception);
 } else {
  return (IOException) new IOException("Call to " + addr + " failed on local exception: "
    + exception).initCause(exception);
 }
}
origin: harbby/presto-connectors

 /**
  * Cleanup the calls older than a given timeout, in milli seconds.
  * @param allCalls true for all calls, false for only the calls in timeout
  */
 protected synchronized void cleanupCalls(boolean allCalls) {
  Iterator<Entry<Integer, Call>> itor = calls.entrySet().iterator();
  while (itor.hasNext()) {
   Call c = itor.next().getValue();
   if (c.done) {
    // To catch the calls without timeout that were cancelled.
    itor.remove();
   } else if (allCalls) {
    long waitTime = EnvironmentEdgeManager.currentTime() - c.getStartTime();
    IOException ie = new ConnectionClosingException("Connection to " + getRemoteAddress()
      + " is closing. Call id=" + c.id + ", waitTime=" + waitTime);
    c.setException(ie);
    itor.remove();
   } else if (c.checkAndSetTimeout()) {
    itor.remove();
   } else {
    // We expect the call to be ordered by timeout. It may not be the case, but stopping
    //  at the first valid call allows to be sure that we still have something to do without
    //  spending too much time by reading the full list.
    break;
   }
  }
 }
}
origin: com.aliyun.hbase/alihbase-client

   "Call to " + addr + " failed because " + exception).initCause(exception);
} else if (exception instanceof ConnectionClosingException) {
 return (ConnectionClosingException) new ConnectionClosingException(
   "Call to " + addr + " failed on local exception: " + exception).initCause(exception);
} else if (exception instanceof ServerTooBusyException) {
origin: harbby/presto-connectors

call.setFailed(closeException != null ? closeException : new ConnectionClosingException(
  "Call id=" + call.id + " on server " + address + " aborted: connection is closing"));
origin: harbby/presto-connectors

throw new ConnectionClosingException("This connection is closing");
origin: harbby/presto-connectors

throw new ConnectionClosingException("Call id=" + call.id +
  " on server " + addr + " aborted: connection is closing");
org.apache.hadoop.hbase.exceptionsConnectionClosingException<init>

Popular methods of ConnectionClosingException

  • initCause

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Menu (java.awt)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • 21 Best IntelliJ Plugins
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