From 58b52595aa0017cb15e119f44cb0e62f028815e3 Mon Sep 17 00:00:00 2001 From: Yuyuan Kang Date: Sat, 26 Jan 2019 15:45:55 +0800 Subject: [PATCH] remove code smell #1840 - #2069 --- .../iotdb/jdbc/IoTDBDatabaseMetadata.java | 23 ++-- .../org/apache/iotdb/jdbc/IoTDBDriver.java | 4 +- .../iotdb/jdbc/IoTDBPrepareStatement.java | 103 +++++++++--------- .../org/apache/iotdb/jdbc/IoTDBStatement.java | 66 +++++------ .../java/org/apache/iotdb/jdbc/Utils.java | 70 +++++++----- .../iotdb/tsfile/common/cache/Cache.java | 5 +- 6 files changed, 150 insertions(+), 121 deletions(-) diff --git a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java index 82d1eb001..369ee3111 100644 --- a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java +++ b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java @@ -30,9 +30,14 @@ import org.apache.iotdb.service.rpc.thrift.TSFetchMetadataResp; import org.apache.iotdb.service.rpc.thrift.TSIService; import org.apache.thrift.TException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class IoTDBDatabaseMetadata implements DatabaseMetaData { + private static final Logger LOGGER = LoggerFactory + .getLogger(IoTDBDatabaseMetadata.class); + private IoTDBConnection connection; private TSIService.Iface client; @@ -1186,7 +1191,12 @@ public boolean usesLocalFiles() throws SQLException { throw new SQLException("Method not supported"); } - /* + + + + + /** + * @deprecated * recommend using getMetadataInJson() instead of toString() */ @Deprecated @@ -1195,7 +1205,7 @@ public String toString() { try { return getMetadataInJsonFunc(); } catch (IoTDBSQLException e) { - System.out.println("Failed to fetch metadata in json because: " + e); + LOGGER.info("Failed to fetch metadata in json because: ", e); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; @@ -1203,15 +1213,14 @@ public String toString() { try { return getMetadataInJsonFunc(); } catch (TException e2) { - System.out.println( - "Fail to get all timeseries " + "info after reconnecting." - + " please check server status"); + LOGGER.info("Fail to get all timeseries " + "info after reconnecting." + + " please check server status", e2); } catch (IoTDBSQLException e1) { // ignored } } else { - System.out.println("Fail to reconnect to server " - + "when getting all timeseries info. please check server status"); + LOGGER.info("Fail to reconnect to server " + + "when getting all timeseries info. please check server status"); } } return null; diff --git a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDriver.java b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDriver.java index a0965bfdd..92643abf1 100644 --- a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDriver.java +++ b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDriver.java @@ -50,7 +50,7 @@ public class IoTDBDriver implements Driver { private final String TSFILE_URL_PREFIX = Config.IOTDB_URL_PREFIX + ".*"; public IoTDBDriver() { - + // This is a constructor. } @Override @@ -89,7 +89,7 @@ public Logger getParentLogger() throws SQLFeatureNotSupportedException { @Override public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { // TODO Auto-generated method stub - return null; + return new DriverPropertyInfo[0]; } @Override diff --git a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPrepareStatement.java b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPrepareStatement.java index cdb8f2320..2751db0dc 100644 --- a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPrepareStatement.java +++ b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBPrepareStatement.java @@ -53,10 +53,12 @@ public class IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { private final String sql; + private static final String Method_Not_Supported_String = "Method not supported"; + /** * save the SQL parameters as (paramLoc,paramValue) pairs. */ - private final Map parameters = new HashMap(); + private final Map parameters = new HashMap<>(); public IoTDBPrepareStatement(IoTDBConnection connection, Iface client, TS_SessionHandle sessionHandle, String sql, @@ -67,7 +69,7 @@ public IoTDBPrepareStatement(IoTDBConnection connection, Iface client, @Override public void addBatch() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -92,186 +94,186 @@ public int executeUpdate() throws SQLException { @Override public ResultSetMetaData getMetaData() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public ParameterMetaData getParameterMetaData() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setArray(int parameterIndex, Array x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBlob(int parameterIndex, Blob x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBoolean(int parameterIndex, boolean x) throws SQLException { - this.parameters.put(parameterIndex, "" + x); + this.parameters.put(parameterIndex, Boolean.toString(x)); } @Override public void setByte(int parameterIndex, byte x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setBytes(int parameterIndex, byte[] x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setClob(int parameterIndex, Clob x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setClob(int parameterIndex, Reader reader) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setDate(int parameterIndex, Date x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setDouble(int parameterIndex, double x) throws SQLException { - this.parameters.put(parameterIndex, "" + x); + this.parameters.put(parameterIndex, Double.toString(x)); } @Override public void setFloat(int parameterIndex, float x) throws SQLException { - this.parameters.put(parameterIndex, "" + x); + this.parameters.put(parameterIndex, Float.toString(x)); } @Override public void setInt(int parameterIndex, int x) throws SQLException { - this.parameters.put(parameterIndex, "" + x); + this.parameters.put(parameterIndex, Integer.toString(x)); } @Override public void setLong(int parameterIndex, long x) throws SQLException { - this.parameters.put(parameterIndex, "" + x); + this.parameters.put(parameterIndex, Long.toString(x)); } @Override public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setNClob(int parameterIndex, NClob value) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setNClob(int parameterIndex, Reader reader) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setNString(int parameterIndex, String value) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setNull(int parameterIndex, int sqlType) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -301,49 +303,48 @@ public void setObject(int parameterIndex, Object x) throws SQLException { @Override public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setRef(int parameterIndex, Ref x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setRowId(int parameterIndex, RowId x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setShort(int parameterIndex, short x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setString(int parameterIndex, String x) throws SQLException { - x = x.replace("'", "\\'"); - this.parameters.put(parameterIndex, "'" + x + "'"); + this.parameters.put(parameterIndex, "'" + x.replace("'", "\\'") + "'"); } @Override public void setTime(int parameterIndex, Time x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -356,17 +357,17 @@ public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException { @Override public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setURL(int parameterIndex, URL x) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } private String createCompleteSql(final String sql, Map parameters) diff --git a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java index ea5d5eceb..5c3763500 100644 --- a/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java +++ b/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java @@ -44,12 +44,15 @@ import org.apache.iotdb.service.rpc.thrift.TS_SessionHandle; import org.apache.iotdb.service.rpc.thrift.TS_StatusCode; import org.apache.thrift.TException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class IoTDBStatement implements Statement { private static final String SHOW_TIMESERIES_COMMAND_LOWERCASE = "show timeseries"; private static final String SHOW_STORAGE_GROUP_COMMAND_LOWERCASE = "show storage group"; + private static final String Method_Not_Supported_String = "Method not supported"; ZoneId zoneId; private ResultSet resultSet = null; private IoTDBConnection connection; @@ -59,6 +62,8 @@ public class IoTDBStatement implements Statement { private TS_SessionHandle sessionHandle = null; private TSOperationHandle operationHandle = null; private List batchSQLList; + private static final Logger LOGGER = LoggerFactory + .getLogger(IoTDBStatement.class); /** * Keep state so we can fail certain calls made after close(). */ @@ -132,7 +137,7 @@ public void cancel() throws SQLException { Utils.verifySuccess(closeResp.getStatus()); } } catch (Exception e) { - throw new SQLException("Error occurs when canceling statement because " + e.getMessage()); + throw new SQLException("Error occurs when canceling statement because " + e.getMessage(), e); } isCancelled = true; } @@ -158,7 +163,7 @@ private void closeClientOperation() throws SQLException { Utils.verifySuccess(closeResp.getStatus()); } } catch (Exception e) { - throw new SQLException("Error occurs when closing statement because " + e.getMessage()); + throw new SQLException("Error occurs when closing statement because " + e.getMessage(), e); } } @@ -169,13 +174,12 @@ public void close() throws SQLException { } closeClientOperation(); - // client = null; isClosed = true; } @Override public void closeOnCompletion() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -193,7 +197,7 @@ public boolean execute(String sql) throws SQLException { } catch (TException e2) { throw new SQLException( String.format("Fail to execute %s after reconnecting. please check server status", - sql)); + sql), e2); } } else { throw new SQLException(String @@ -205,17 +209,17 @@ public boolean execute(String sql) throws SQLException { @Override public boolean execute(String arg0, int arg1) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public boolean execute(String arg0, int[] arg1) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public boolean execute(String arg0, String[] arg1) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } /** @@ -271,11 +275,11 @@ public int[] executeBatch() throws SQLException { return executeBatchSQL(); } catch (TException e2) { throw new SQLException( - "Fail to execute batch sqls after reconnecting. please check server status"); + "Fail to execute batch sqls after reconnecting. please check server status", e); } } else { throw new SQLException( - "Fail to reconnect to server when executing batch sqls. please check server status"); + "Fail to reconnect to server when executing batch sqls. please check server status", e); } } } @@ -328,12 +332,12 @@ public ResultSet executeQuery(String sql) throws SQLException { return executeQuerySQL(sql); } catch (TException e2) { throw new SQLException( - "Fail to executeQuery " + sql + "after reconnecting. please check server status"); + "Fail to executeQuery " + sql + "after reconnecting. please check server status", e); } } else { throw new SQLException( "Fail to reconnect to server when execute query " + sql - + ". please check server status"); + + ". please check server status", e); } } } @@ -364,29 +368,29 @@ public int executeUpdate(String sql) throws SQLException { return executeUpdateSQL(sql); } catch (TException e2) { throw new SQLException( - "Fail to execute update " + sql + "after reconnecting. please check server status"); + "Fail to execute update " + sql + "after reconnecting. please check server status", e); } } else { throw new SQLException( "Fail to reconnect to server when execute update " + sql - + ". please check server status"); + + ". please check server status", e); } } } @Override public int executeUpdate(String arg0, int arg1) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public int executeUpdate(String arg0, int[] arg1) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public int executeUpdate(String arg0, String[] arg1) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } private int executeUpdateSQL(String sql) throws TException, IoTDBSQLException { @@ -433,17 +437,17 @@ public void setFetchSize(int fetchSize) throws SQLException { @Override public ResultSet getGeneratedKeys() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public int getMaxFieldSize() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setMaxFieldSize(int arg0) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -463,12 +467,12 @@ public void setMaxRows(int num) throws SQLException { @Override public boolean getMoreResults() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public boolean getMoreResults(int arg0) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -493,12 +497,12 @@ public ResultSet getResultSet() throws SQLException { @Override public int getResultSetConcurrency() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public int getResultSetHoldability() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -509,7 +513,7 @@ public int getResultSetType() throws SQLException { @Override public int getUpdateCount() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -519,7 +523,7 @@ public SQLWarning getWarnings() throws SQLException { @Override public boolean isCloseOnCompletion() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override @@ -529,22 +533,22 @@ public boolean isClosed() throws SQLException { @Override public boolean isPoolable() throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setPoolable(boolean arg0) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setCursorName(String arg0) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } @Override public void setEscapeProcessing(boolean enable) throws SQLException { - throw new SQLException("Method not supported"); + throw new SQLException(Method_Not_Supported_String); } private void checkConnection(String action) throws SQLException { @@ -579,7 +583,7 @@ private String getColumnType(String columnName) throws SQLException { return resp.getDataType(); } catch (TException | IoTDBSQLException e) { throw new SQLException( - String.format("Cannot get column %s data type because %s", columnName, e.getMessage())); + String.format("Cannot get column %s data type because %s", columnName, e.getMessage()), e); } } diff --git a/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java b/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java index a9e65eecc..0df715b4a 100644 --- a/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java +++ b/jdbc/src/main/java/org/apache/iotdb/jdbc/Utils.java @@ -40,6 +40,13 @@ */ public class Utils { + /** + * Private constructor of Utils Class. + */ + private Utils(){ + throw new IllegalAccessError("Utility class"); + } + /** * Parse JDBC connection URL The only supported format of the URL is: * jdbc:iotdb://localhost:6667/. @@ -56,7 +63,7 @@ public static IoTDBConnectionParams parseUrl(String url, Properties info) boolean isUrlLegal = false; while (matcher.find()) { params.setHost(matcher.group(1)); - params.setPort(Integer.parseInt((matcher.group(2)))); + params.setPort(Integer.parseInt(matcher.group(2))); isUrlLegal = true; } if (!isUrlLegal) { @@ -104,31 +111,7 @@ public static List convertRowRecords(TSQueryDataSet tsQueryDataSet) { } else { TSDataType dataType = TSDataType.valueOf(value.getType()); Field field = new Field(dataType); - switch (dataType) { - case BOOLEAN: - field.setBoolV(value.isBool_val()); - break; - case INT32: - field.setIntV(value.getInt_val()); - break; - case INT64: - field.setLongV(value.getLong_val()); - break; - case FLOAT: - field.setFloatV((float) value.getFloat_val()); - break; - case DOUBLE: - field.setDoubleV(value.getDouble_val()); - break; - case TEXT: - field.setBinaryV(new Binary(value.getBinary_val())); - ; - break; - default: - throw new UnSupportedDataTypeException( - String.format("data type %s is not supported when convert data at client", - dataType)); - } + addFieldAccordingToDataType(field, dataType, value); r.getFields().add(field); } } @@ -136,4 +119,39 @@ public static List convertRowRecords(TSQueryDataSet tsQueryDataSet) { } return records; } + + /** + * + * @param field -the field need to add new data + * @param dataType, -the data type of the new data + * @param value, -the value of the new data + */ + private static void addFieldAccordingToDataType(Field field, TSDataType dataType, TSDataValue value){ + switch (dataType) { + case BOOLEAN: + field.setBoolV(value.isBool_val()); + break; + case INT32: + field.setIntV(value.getInt_val()); + break; + case INT64: + field.setLongV(value.getLong_val()); + break; + case FLOAT: + field.setFloatV((float) value.getFloat_val()); + break; + case DOUBLE: + field.setDoubleV(value.getDouble_val()); + break; + case TEXT: + field.setBinaryV(new Binary(value.getBinary_val())); + break; + default: + throw new UnSupportedDataTypeException( + String.format("data type %s is not supported when convert data at client", + dataType)); + } + } } + + diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/cache/Cache.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/cache/Cache.java index 453dde83a..6962c0b13 100644 --- a/tsfile/src/main/java/org/apache/iotdb/tsfile/common/cache/Cache.java +++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/common/cache/Cache.java @@ -19,12 +19,9 @@ */ package org.apache.iotdb.tsfile.common.cache; -import java.io.IOException; -import org.apache.iotdb.tsfile.exception.cache.CacheException; - public interface Cache { - T get(K key) throws CacheException, IOException; + T get(K key) throws Exception; void clear(); }