ColumnOrSuperColumn getColumn ( ByteBuffer key , ColumnPath colPath ) { m_logger . debug ( "Fetching {}.{}" , new Object [ ] { Utils . toString ( key ) , toString ( colPath ) } ) ; ColumnOrSuperColumn column = null ; boolean bSuccess = false ; for ( int attempts = 1 ; ! bSuccess ; attempts ++ ) { try { // Attempt to retrieve a slice list. Date startDate = new Date ( ) ; column = m_client . get ( key , colPath , ConsistencyLevel . ONE ) ; timing ( "get" , startDate ) ; if ( attempts > 1 ) { m_logger . info ( "get() succeeded on attempt #{}" , attempts ) ; } bSuccess = true ; } catch ( NotFoundException ex ) { return null ; } catch ( InvalidRequestException ex ) { // No point in retrying this one. String errMsg = "get() failed for table: " + colPath . getColumn_family ( ) ; m_bFailed = true ; m_logger . error ( errMsg , ex ) ; throw new RuntimeException ( errMsg , ex ) ; } catch ( Exception ex ) { // Abort if all retries exceeded. if ( attempts >= m_max_read_attempts ) { String errMsg = "All retries exceeded; abandoning get() for table: " + colPath . getColumn_family ( ) ; m_bFailed = true ; m_logger . error ( errMsg , ex ) ; throw new RuntimeException ( errMsg , ex ) ; } // Report retry as a warning. m_logger . warn ( "get() attempt #{} failed: {}" , attempts , ex ) ; try { Thread . sleep ( attempts * m_retry_wait_millis ) ; } catch ( InterruptedException e1 ) { // ignore } reconnect ( ex ) ; } } return column ; }
Fetch a single column .