weizuo93 commented on a change in pull request #7521: URL: https://github.com/apache/incubator-doris/pull/7521#discussion_r785864622
########## File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java ########## @@ -7257,4 +7259,46 @@ public static boolean isStoredTableNamesLowerCase() { public static boolean isTableNamesCaseInsensitive() { return GlobalVariable.lowerCaseTableNames == 2; } + + public void compactTable(AdminCompactTableStmt stmt) throws DdlException { + String dbName = stmt.getDbName(); + String tableName = stmt.getTblName(); + + String type = stmt.getCompactionType(); + if (type == null || (!type.equals("base") && !type.equals("cumulative"))) { + throw new DdlException("compaction type should be [BASE] or [CUMULATIVE]"); + } + + Database db = this.getDbOrDdlException(dbName); + OlapTable olapTable = db.getOlapTableOrDdlException(tableName); + + olapTable.writeLock(); Review comment: > readLock is enough OK, thank you. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org