org.apache.hadoop.hbase.client.Connection.isAborted()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(261)

本文整理了Java中org.apache.hadoop.hbase.client.Connection.isAborted()方法的一些代码示例,展示了Connection.isAborted()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Connection.isAborted()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Connection
类名称:Connection
方法名:isAborted

Connection.isAborted介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

@Override
public boolean isAborted() {
 return this.conn.isAborted();
}

代码示例来源:origin: apache/drill

private boolean isValid(Connection conn) {
 return conn != null
   && !conn.isAborted()
   && !conn.isClosed();
}

代码示例来源:origin: alibaba/canal

public Connection getConnection() {
  if (conn == null || conn.isAborted() || conn.isClosed()) {
    initConn();
  }
  return conn;
}

代码示例来源:origin: apache/hbase

synchronized boolean updateAccessTime() {
 if (closed) {
  return false;
 }
 if (connection.isAborted() || connection.isClosed()) {
  LOG.info("Unexpected: cached Connection is aborted/closed, removed from cache");
  connections.remove(userName);
  return false;
 }
 lastAccessTime = EnvironmentEdgeManager.currentTime();
 return true;
}

代码示例来源:origin: apache/phoenix

private void throwFailureIfDone() throws SingleIndexWriteFailureException {
    if (stopped.isStopped()
        || (env != null && (env.getConnection() == null || env.getConnection().isClosed()
        || env.getConnection().isAborted()))
        || Thread.currentThread().isInterrupted()) { throw new SingleIndexWriteFailureException(
            "Pool closed, not attempting to write to the index!", null); }
  }
});

代码示例来源:origin: apache/phoenix

@SuppressWarnings("unchecked")
  @Test
  public void testCheckRegionServerStoppedOnException() throws Exception {
    StatisticsScannerCallable realCallable = mockScanner.new StatisticsScannerCallable();
    doThrow(new IOException()).when(statsWriter).deleteStatsForRegion(any(Region.class), any(StatisticsCollector.class),
        any(ImmutableBytesPtr.class), any(List.class));
    when(conn.isClosed()).thenReturn(false);
    when(conn.isAborted()).thenReturn(true);

    // Should not throw an exception
    realCallable.call();

    verify(conn).isClosed();
    verify(conn).isAborted();
  }
}

代码示例来源:origin: apache/phoenix

@Test
public void testCheckRegionServerStoppedOnClose() throws Exception {
  when(conn.isClosed()).thenReturn(false);
  when(conn.isAborted()).thenReturn(true);
  mockScanner.close();
  verify(conn).isClosed();
  verify(conn).isAborted();
  verify(callable, never()).call();
  verify(runTracker, never()).runTask(callable);
}

代码示例来源:origin: apache/phoenix

private boolean isConnectionClosed() {
  return getConnection() == null || getConnection().isClosed() || getConnection().isAborted();
}

代码示例来源:origin: apache/phoenix

@SuppressWarnings("unchecked")
@Test
public void testCheckRegionServerStoppingOnException() throws Exception {
  StatisticsScannerCallable realCallable = mockScanner.new StatisticsScannerCallable();
  doThrow(new IOException()).when(statsWriter).deleteStatsForRegion(any(Region.class), any(StatisticsCollector.class),
      any(ImmutableBytesPtr.class), any(List.class));
  when(conn.isClosed()).thenReturn(true);
  when(conn.isAborted()).thenReturn(false);
  // Should not throw an exception
  realCallable.call();
  verify(conn).isClosed();
}

代码示例来源:origin: apache/phoenix

@Test
public void testCheckRegionServerStoppingOnClose() throws Exception {
  when(conn.isClosed()).thenReturn(true);
  when(conn.isAborted()).thenReturn(false);
  mockScanner.close();
  verify(conn).isClosed();
  verify(callable, never()).call();
  verify(runTracker, never()).runTask(callable);
}

代码示例来源:origin: dremio/dremio-oss

@Override
public boolean isAborted() {
 return delegate.isAborted();
}

代码示例来源:origin: dremio/dremio-oss

private static boolean isValid(Connection conn) {
 return conn != null
   && !conn.isAborted()
   && !conn.isClosed();
}

代码示例来源:origin: dremio/dremio-oss

private boolean isValid(Connection conn) {
 return conn != null
   && !conn.isAborted()
   && !conn.isClosed();
}

代码示例来源:origin: org.apache.drill.contrib/drill-storage-hbase

private boolean isValid(Connection conn) {
 return conn != null
   && !conn.isAborted()
   && !conn.isClosed();
}

代码示例来源:origin: ManbangGroup/cantor

@Override
public boolean available() {
  return available && !connection.isAborted() && !connection.isClosed();
}

代码示例来源:origin: DarkPhoenixs/connection-pool-client

@Override
public boolean validateObject(PooledObject<Connection> p) {
  Connection connection = p.getObject();
  if (connection != null)
    return ((!connection.isAborted()) && (!connection.isClosed()));
  return false;
}

代码示例来源:origin: harbby/presto-connectors

synchronized boolean updateAccessTime() {
 if (closed) {
  return false;
 }
 if (connection.isAborted() || connection.isClosed()) {
  LOG.info("Unexpected: cached HConnection is aborted/closed, removed from cache");
  connections.remove(userName);
  return false;
 }
 lastAccessTime = EnvironmentEdgeManager.currentTime();
 return true;
}

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

private void throwFailureIfDone() throws SingleIndexWriteFailureException {
    if (stopped.isStopped()
        || (env != null && (env.getConnection() == null || env.getConnection().isClosed()
        || env.getConnection().isAborted()))
        || Thread.currentThread().isInterrupted()) { throw new SingleIndexWriteFailureException(
            "Pool closed, not attempting to write to the index!", null); }
  }
});

代码示例来源:origin: org.apache.phoenix/phoenix-core

private void throwFailureIfDone() throws SingleIndexWriteFailureException {
    if (stopped.isStopped()
        || (env != null && (env.getConnection() == null || env.getConnection().isClosed()
        || env.getConnection().isAborted()))
        || Thread.currentThread().isInterrupted()) { throw new SingleIndexWriteFailureException(
            "Pool closed, not attempting to write to the index!", null); }
  }
});

代码示例来源:origin: com.aliyun.phoenix/ali-phoenix-core

private boolean isConnectionClosed() {
  return getConnection() == null || getConnection().isClosed() || getConnection().isAborted();
}

相关文章