From a848b94a1c50191361d85de252a42e4130e5e561 Mon Sep 17 00:00:00 2001 From: Tigran Mkrtchyan Date: Tue, 8 Aug 2023 13:52:17 +0200 Subject: [PATCH] chimera: rename FsSqlDriver#removeTag into removeAllTags Motivation: Confusing name. As method is only used by driver internally, makes no sense to have it the public API. Modification: Rename FsSqlDriver#removeTag(FsInode inode) to FsSqlDriver#removeAllTags(FsInode). Remove removeTag from the FileSystemProvider public interface. Result: same functionality, less confusion. Fixes: #7277 Acked-by: Albert Rossi Acked-by: Paul Millar Target: master Require-book: no Require-notes: no --- .../main/java/org/dcache/chimera/FileSystemProvider.java | 2 -- .../src/main/java/org/dcache/chimera/FsSqlDriver.java | 6 +++--- .../chimera/src/main/java/org/dcache/chimera/JdbcFs.java | 8 -------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/modules/chimera/src/main/java/org/dcache/chimera/FileSystemProvider.java b/modules/chimera/src/main/java/org/dcache/chimera/FileSystemProvider.java index 291fc547f86..6650ce29134 100644 --- a/modules/chimera/src/main/java/org/dcache/chimera/FileSystemProvider.java +++ b/modules/chimera/src/main/java/org/dcache/chimera/FileSystemProvider.java @@ -361,8 +361,6 @@ int setTag(FsInode inode, String tagName, byte[] data, void removeTag(FsInode dir, String tagName) throws ChimeraFsException; - void removeTag(FsInode dir) throws ChimeraFsException; - int getTag(FsInode inode, String tagName, byte[] data, int offset, int len) throws ChimeraFsException; diff --git a/modules/chimera/src/main/java/org/dcache/chimera/FsSqlDriver.java b/modules/chimera/src/main/java/org/dcache/chimera/FsSqlDriver.java index 8f62fe294f1..03f4eb0adca 100644 --- a/modules/chimera/src/main/java/org/dcache/chimera/FsSqlDriver.java +++ b/modules/chimera/src/main/java/org/dcache/chimera/FsSqlDriver.java @@ -309,7 +309,7 @@ private boolean removeDir(FsInode parent, FsInode inode, String name) // ensure that t_inodes and t_tags_inodes updated in the same order as // in mkdir decNlink(parent); - removeTag(inode); + removeAllTags(inode); if (!removeInodeIfUnlinked(inode, true)) { throw new DirNotEmptyChimeraFsException("directory is not empty"); @@ -350,7 +350,7 @@ void remove(FsInode inode) throws DirNotEmptyChimeraFsException { boolean isDir = inode.isDirectory(); if (isDir) { - removeTag(inode); + removeAllTags(inode); } for (Long parent : parents) { @@ -1309,7 +1309,7 @@ void removeTag(FsInode dir, String tag) { } } - void removeTag(FsInode dir) { + protected void removeAllTags(FsInode dir) { /* Get the name of the tags to be removed. */ _jdbc.queryForList("SELECT itagname FROM t_tags WHERE inumber=?", String.class, dir.ino()) diff --git a/modules/chimera/src/main/java/org/dcache/chimera/JdbcFs.java b/modules/chimera/src/main/java/org/dcache/chimera/JdbcFs.java index e69f1e8f59f..f80aff7a120 100644 --- a/modules/chimera/src/main/java/org/dcache/chimera/JdbcFs.java +++ b/modules/chimera/src/main/java/org/dcache/chimera/JdbcFs.java @@ -1281,14 +1281,6 @@ public void removeTag(FsInode dir, String tagName) throws ChimeraFsException { }); } - @Override - public void removeTag(FsInode dir) throws ChimeraFsException { - inTransaction(status -> { - _sqlDriver.removeTag(dir); - return null; - }); - } - @Override public int getTag(FsInode inode, String tagName, byte[] data, int offset, int len) throws ChimeraFsException {