File tree Expand file tree Collapse file tree
integration-test/src/test/java/org/apache/iotdb/confignode/it/regionmigration/pass/commit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131import org .apache .iotdb .rpc .StatementExecutionException ;
3232import org .apache .iotdb .session .Session ;
3333
34- import org .apache .commons .io .FileUtils ;
3534import org .apache .tsfile .read .common .RowRecord ;
3635import org .awaitility .Awaitility ;
3736import org .junit .Assert ;
@@ -57,6 +56,22 @@ public class IoTDBRegionReconstructForIoTV1IT extends IoTDBRegionOperationReliab
5756 private static final String RECONSTRUCT_FORMAT = "reconstruct region %d on %d" ;
5857 private static Logger LOGGER = LoggerFactory .getLogger (IoTDBRegionReconstructForIoTV1IT .class );
5958
59+ private boolean deleteTsFiles (File file ) {
60+ if (file .isDirectory ()) {
61+ File [] files = file .listFiles ();
62+ if (files != null ) {
63+ for (File f : files ) {
64+ if (!deleteTsFiles (f )) {
65+ return false ;
66+ }
67+ }
68+ }
69+ } else if (file .getName ().endsWith (".tsfile" )) {
70+ return file .delete ();
71+ }
72+ return true ;
73+ }
74+
6075 @ Test
6176 public void normal1C3DTest () throws Exception {
6277 EnvFactory .getEnv ()
@@ -110,7 +125,11 @@ public void normal1C3DTest() throws Exception {
110125 .get ()
111126 .getDataPath ());
112127
113- FileUtils .deleteQuietly (dataDirToBeReconstructed );
128+ if (!deleteTsFiles (dataDirToBeReconstructed )) {
129+ statement .execute (FLUSH_COMMAND );
130+ deleteTsFiles (dataDirToBeReconstructed );
131+ }
132+
114133 EnvFactory .getEnv ().dataNodeIdToWrapper (dataNodeToBeClosed ).get ().stopForcibly ();
115134
116135 // now, the query should throw exception
You can’t perform that action at this time.
0 commit comments