HBASE-13419 Thrift gateway should propagate text from exception causes (Michael Muller)
This commit is contained in:
parent
e75c6201c6
commit
679e0e8d2e
|
@ -130,6 +130,7 @@ import org.mortbay.jetty.servlet.ServletHolder;
|
||||||
import org.mortbay.thread.QueuedThreadPool;
|
import org.mortbay.thread.QueuedThreadPool;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
import com.google.common.base.Throwables;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -755,7 +756,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
getAdmin().enableTable(getTableName(tableName));
|
getAdmin().enableTable(getTableName(tableName));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -765,7 +766,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
getAdmin().disableTable(getTableName(tableName));
|
getAdmin().disableTable(getTableName(tableName));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -775,7 +776,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return this.connectionCache.getAdmin().isTableEnabled(getTableName(tableName));
|
return this.connectionCache.getAdmin().isTableEnabled(getTableName(tableName));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -788,7 +789,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
((HBaseAdmin) getAdmin()).compact(getBytes(tableNameOrRegionName));
|
((HBaseAdmin) getAdmin()).compact(getBytes(tableNameOrRegionName));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,7 +802,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
((HBaseAdmin) getAdmin()).majorCompact(getBytes(tableNameOrRegionName));
|
((HBaseAdmin) getAdmin()).majorCompact(getBytes(tableNameOrRegionName));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -816,7 +817,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return list;
|
return list;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -849,7 +850,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
} catch (IOException e){
|
} catch (IOException e){
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -894,7 +895,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return ThriftUtilities.cellFromHBase(result.rawCells());
|
return ThriftUtilities.cellFromHBase(result.rawCells());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -937,7 +938,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return ThriftUtilities.cellFromHBase(result.rawCells());
|
return ThriftUtilities.cellFromHBase(result.rawCells());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -981,7 +982,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return ThriftUtilities.cellFromHBase(result.rawCells());
|
return ThriftUtilities.cellFromHBase(result.rawCells());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1038,7 +1039,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return ThriftUtilities.rowResultFromHBase(result);
|
return ThriftUtilities.rowResultFromHBase(result);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1103,7 +1104,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return ThriftUtilities.rowResultFromHBase(result);
|
return ThriftUtilities.rowResultFromHBase(result);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1135,7 +1136,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1157,7 +1158,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
table.delete(delete);
|
table.delete(delete);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1178,10 +1179,10 @@ public class ThriftServerRunner implements Runnable {
|
||||||
getAdmin().createTable(desc);
|
getAdmin().createTable(desc);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IllegalArgument(e.getMessage());
|
throw new IllegalArgument(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1202,7 +1203,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
getAdmin().deleteTable(tableName);
|
getAdmin().deleteTable(tableName);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1260,10 +1261,10 @@ public class ThriftServerRunner implements Runnable {
|
||||||
table.put(put);
|
table.put(put);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IllegalArgument(e.getMessage());
|
throw new IllegalArgument(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1331,10 +1332,10 @@ public class ThriftServerRunner implements Runnable {
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IllegalArgument(e.getMessage());
|
throw new IllegalArgument(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1360,7 +1361,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
getBytes(row), family, qualifier, amount);
|
getBytes(row), family, qualifier, amount);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1396,7 +1397,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
return ThriftUtilities.rowResultFromHBase(results, resultScannerWrapper.isColumnSorted());
|
return ThriftUtilities.rowResultFromHBase(results, resultScannerWrapper.isColumnSorted());
|
||||||
}
|
}
|
||||||
|
@ -1450,7 +1451,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return addScanner(table.getScanner(scan), tScan.sortColumns);
|
return addScanner(table.getScanner(scan), tScan.sortColumns);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1475,7 +1476,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return addScanner(table.getScanner(scan), false);
|
return addScanner(table.getScanner(scan), false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1501,7 +1502,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return addScanner(table.getScanner(scan), false);
|
return addScanner(table.getScanner(scan), false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1531,7 +1532,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return addScanner(table.getScanner(scan), false);
|
return addScanner(table.getScanner(scan), false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1557,7 +1558,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return addScanner(table.getScanner(scan), false);
|
return addScanner(table.getScanner(scan), false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1585,7 +1586,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return addScanner(table.getScanner(scan), false);
|
return addScanner(table.getScanner(scan), false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1606,7 +1607,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return columns;
|
return columns;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1619,7 +1620,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return ThriftUtilities.cellFromHBase(result.rawCells());
|
return ThriftUtilities.cellFromHBase(result.rawCells());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1658,7 +1659,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return region;
|
return region;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1696,7 +1697,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
table.increment(inc);
|
table.increment(inc);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1724,7 +1725,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
return ThriftUtilities.cellFromHBase(result.rawCells());
|
return ThriftUtilities.cellFromHBase(result.rawCells());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1745,7 +1746,7 @@ public class ThriftServerRunner implements Runnable {
|
||||||
put.setDurability(mput.writeToWAL ? Durability.SYNC_WAL : Durability.SKIP_WAL);
|
put.setDurability(mput.writeToWAL ? Durability.SYNC_WAL : Durability.SKIP_WAL);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IllegalArgument(e.getMessage());
|
throw new IllegalArgument(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
Table table = null;
|
Table table = null;
|
||||||
|
@ -1756,10 +1757,10 @@ public class ThriftServerRunner implements Runnable {
|
||||||
value != null ? getBytes(value) : HConstants.EMPTY_BYTE_ARRAY, put);
|
value != null ? getBytes(value) : HConstants.EMPTY_BYTE_ARRAY, put);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IOError(e.getMessage());
|
throw new IOError(Throwables.getStackTraceAsString(e));
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
LOG.warn(e.getMessage(), e);
|
LOG.warn(e.getMessage(), e);
|
||||||
throw new IllegalArgument(e.getMessage());
|
throw new IllegalArgument(Throwables.getStackTraceAsString(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue