From 50a85876ecbdce46689fab33883545e1358247a9 Mon Sep 17 00:00:00 2001 From: WeiXinChan Date: Wed, 26 Nov 2025 14:41:41 +0800 Subject: [PATCH] remove unreasonable logs --- .../com/alipay/oceanbase/hbase/OHTable.java | 25 +++---------------- .../hbase/result/ClientStreamScanner.java | 1 - .../hbase/util/OHBufferedMutatorImpl.java | 3 --- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/alipay/oceanbase/hbase/OHTable.java b/src/main/java/com/alipay/oceanbase/hbase/OHTable.java index 5efbb7f7..cdff002f 100644 --- a/src/main/java/com/alipay/oceanbase/hbase/OHTable.java +++ b/src/main/java/com/alipay/oceanbase/hbase/OHTable.java @@ -1003,8 +1003,6 @@ public Result call() throws IOException { } } } catch (Exception e) { - logger.error(LCD.convert("01-00002"), tableNameString, Bytes.toString(family), - e); throw new IOException("query table:" + tableNameString + " family " + Bytes.toString(family) + " error.", e); } @@ -1104,8 +1102,6 @@ public ResultScanner call() throws IOException { } } } catch (Exception e) { - logger.error(LCD.convert("01-00003"), tableNameString, Bytes.toString(family), - e); throw new IOException("scan table:" + tableNameString + " family " + Bytes.toString(family) + " error.", e); } @@ -1206,8 +1202,6 @@ public List call() throws IOException { } } } catch (Exception e) { - logger.error(LCD.convert("01-00003"), tableNameString, Bytes.toString(family), - e); throw new IOException("scan table:" + tableNameString + " family " + Bytes.toString(family) + " error.", e); } @@ -1342,7 +1336,6 @@ public boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, try { return checkAndMutation(row, family, qualifier, compareOp, value, null, rowMutations); } catch (Exception e) { - logger.error(LCD.convert("01-00005"), put, tableNameString, e); throw new IOException("checkAndPut type table:" + tableNameString + " e.msg:" + e.getMessage() + " error.", e); } @@ -1362,7 +1355,6 @@ private void innerDelete(Delete delete) throws IOException { Object[] results = new Object[actions.size()]; batch(actions, results); } catch (Exception e) { - logger.error(LCD.convert("01-00004"), tableNameString, e); throw e; } } @@ -1405,7 +1397,6 @@ public boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, try { return checkAndMutation(row, family, qualifier, compareOp, value, null, rowMutations); } catch (Exception e) { - logger.error(LCD.convert("01-00005"), delete, tableNameString, e); throw new IOException("checkAndDelete type table:" + tableNameString + " e.msg:" + e.getMessage() + " error.", e); } @@ -1425,7 +1416,6 @@ public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier, try { return checkAndMutation(row, family, qualifier, compareOp, value, null, rowMutations); } catch (Exception e) { - logger.error(LCD.convert("01-00005"), rowMutations, tableNameString, e); throw new IOException("checkAndMutate type table:" + tableNameString + " e.msg:" + e.getMessage() + " error.", e); } @@ -1529,7 +1519,6 @@ public Result append(Append append) throws IOException { } return Result.create(keyValues); } catch (Exception e) { - logger.error(LCD.convert("01-00006"), tableNameString, e); throw new IOException("append table " + tableNameString + " error.", e); } } @@ -1580,7 +1569,6 @@ public Result increment(Increment increment) throws IOException { } return Result.create(keyValues); } catch (Exception e) { - logger.error(LCD.convert("01-00007"), tableNameString, e); throw new IOException("increment table " + tableNameString + " error.", e); } } @@ -1625,7 +1613,6 @@ public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, lo } return Bytes.toLong((byte[]) queryResult.getPropertiesRows().get(0).get(3).getValue()); } catch (Exception e) { - logger.error(LCD.convert("01-00007"), tableNameString, e); throw new IOException("increment table " + tableNameString + " error.", e); } } @@ -1656,10 +1643,10 @@ public void flushCommits() throws IOException { } } } catch (Exception e) { - logger.error(LCD.convert("01-00008"), tableNameString, null, autoFlush, - writeBuffer.size(), e); if (e instanceof IOException) { throw (IOException) e; + } else { + throw new IOException(tableNameString + " table occurred unexpected error.", e); } } finally { // mutate list so that it is empty for complete success, or contains @@ -1706,10 +1693,10 @@ public void flushCommitsV2() throws IOException { throw new IOException(tableNameString + " table occurred unexpected error.", e); } } catch (Exception e) { - logger.error(LCD.convert("01-00008"), tableNameString, null, autoFlush, - writeBuffer.size(), e); if (e instanceof IOException) { throw (IOException) e; + } else { + throw new IOException(tableNameString + " table occurred unexpected error.", e); } } } finally { @@ -2302,7 +2289,6 @@ private BatchOperation buildBatchOperation(String tableName, List try { query.setRowKey(row(colVal("K", Bytes.toString(get.getRow())), colVal("Q", null), colVal("T", Integer.MAX_VALUE))); } catch (Exception e) { - logger.error("unexpected error occurs when set row key", e); throw new IOException(e); } batch.addOperation(query); @@ -2694,7 +2680,6 @@ public boolean thenPut(Put put) throws IOException { return checkAndMutation(row, family, qualifier, getCompareOp(cmpOp), value, timeRange, rowMutations); } catch (Exception e) { - logger.error(LCD.convert("01-00005"), rowMutations, tableNameString, e); throw new IOException("checkAndMutate type table: " + tableNameString + " e.msg: " + e.getMessage() + " error.", e); } @@ -2709,7 +2694,6 @@ public boolean thenDelete(Delete delete) throws IOException { return checkAndMutation(row, family, qualifier, getCompareOp(cmpOp), value, timeRange, rowMutations); } catch (Exception e) { - logger.error(LCD.convert("01-00005"), rowMutations, tableNameString, e); throw new IOException("checkAndMutate type table: " + tableNameString + " e.msg: " + e.getMessage() + " error.", e); } @@ -2722,7 +2706,6 @@ public boolean thenMutate(RowMutations mutation) throws IOException { return checkAndMutation(row, family, qualifier, getCompareOp(cmpOp), value, timeRange, mutation); } catch (Exception e) { - logger.error(LCD.convert("01-00005"), mutation, tableNameString, e); throw new IOException("checkAndMutate type table: " + tableNameString + " e.msg: " + e.getMessage() + " error.", e); } diff --git a/src/main/java/com/alipay/oceanbase/hbase/result/ClientStreamScanner.java b/src/main/java/com/alipay/oceanbase/hbase/result/ClientStreamScanner.java index b5f41c9c..c139d8b6 100644 --- a/src/main/java/com/alipay/oceanbase/hbase/result/ClientStreamScanner.java +++ b/src/main/java/com/alipay/oceanbase/hbase/result/ClientStreamScanner.java @@ -131,7 +131,6 @@ public Result next() throws IOException { OHBaseFuncUtils.sortHBaseResult(keyValues); return Result.create(keyValues); } catch (Exception e) { - logger.error(LCD.convert("01-00000"), streamResult.getTableName(), e); throw new IOException(String.format("get table %s stream next result error ", streamResult.getTableName()), e); } diff --git a/src/main/java/com/alipay/oceanbase/hbase/util/OHBufferedMutatorImpl.java b/src/main/java/com/alipay/oceanbase/hbase/util/OHBufferedMutatorImpl.java index 6b02994c..f5b11610 100644 --- a/src/main/java/com/alipay/oceanbase/hbase/util/OHBufferedMutatorImpl.java +++ b/src/main/java/com/alipay/oceanbase/hbase/util/OHBufferedMutatorImpl.java @@ -275,9 +275,7 @@ private void execute(boolean flushAll) throws IOException { execBuffer.clear(); } catch (Exception ex) { // do not recollect error operations, notify outside - LOGGER.error("error happens, table name: {}", tableName.getNameAsString(), ex); if (ex instanceof RetriesExhaustedWithDetailsException) { - LOGGER.error("TableName: {}, One or more of the operations have failed after retries.", tableName.getNameAsString(), ex); RetriesExhaustedWithDetailsException retryException = (RetriesExhaustedWithDetailsException) ex; if (listener != null) { listener.onException(retryException, this); @@ -285,7 +283,6 @@ private void execute(boolean flushAll) throws IOException { throw retryException; } } else { - LOGGER.error("Errors unrelated to operations occur during mutation operation", ex); throw ex; } }