Skip to content

Commit

Permalink
remove unnecessary clean path
Browse files Browse the repository at this point in the history
  • Loading branch information
Pengzna committed May 26, 2024
1 parent e0e3c2b commit 18aaf8a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_system_dir"
set dn_system_dir=%%i
)
if "%dn_system_dir%"=="" (
set "dn_system_dir=data\confignode\system"
set "dn_system_dir=data\\datanode\\system"
)
setlocal enabledelayedexpansion
set "dn_system_dir=!dn_system_dir:%delimiter%= !"
Expand Down Expand Up @@ -158,46 +158,6 @@ for %%i in (%dn_sync_dir%) do (
)
)

for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^pipe_receiver_file_dirs"
%IOTDB_DATANODE_CONFIG%') do (
set pipe_receiver_file_dirs=%%i
)
if "%pipe_receiver_file_dirs%"=="" (
set "pipe_receiver_file_dirs=data\\datanode\\system\\pipe\\receiver"
)

set "pipe_receiver_file_dirs=!pipe_receiver_file_dirs:%delimiter%= !"
for %%i in (%pipe_receiver_file_dirs%) do (
set "var=%%i"
if "!var:~0,2!"=="\\" (
rmdir /s /q "%%i" 2>nul
) else if "!var:~1,3!"==":\\" (
rmdir /s /q "%%i" 2>nul
) else (
rmdir /s /q "%IOTDB_HOME%\%%i" 2>nul
)
)

for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^pipe_consensus_receiver_file_dirs"
%IOTDB_DATANODE_CONFIG%') do (
set pipe_consensus_receiver_file_dirs=%%i
)
if "%pipe_consensus_receiver_file_dirs%"=="" (
set "pipe_consensus_receiver_file_dirs=data\\datanode\\system\\pipe\\consensus\\receiver"
)

set "pipe_consensus_receiver_file_dirs=!pipe_consensus_receiver_file_dirs:%delimiter%= !"
for %%i in (%pipe_consensus_receiver_file_dirs%) do (
set "var=%%i"
if "!var:~0,2!"=="\\" (
rmdir /s /q "%%i" 2>nul
) else if "!var:~1,3!"==":\\" (
rmdir /s /q "%%i" 2>nul
) else (
rmdir /s /q "%IOTDB_HOME%\%%i" 2>nul
)
)

for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^sort_tmp_dir"
%IOTDB_DATANODE_CONFIG%') do (
set sort_tmp_dir=%%i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ dn_consensus_dir=$(echo $(grep '^dn_consensus_dir=' ${IOTDB_DATANODE_CONFIG} ||
dn_wal_dirs=$(echo $(grep '^dn_wal_dirs=' ${IOTDB_DATANODE_CONFIG} || echo "data/datanode/wal") | sed 's/.*=//')
dn_tracing_dir=$(echo $(grep '^dn_tracing_dir=' ${IOTDB_DATANODE_CONFIG} || echo "datanode/tracing") | sed 's/.*=//')
dn_sync_dir=$(echo $(grep '^dn_sync_dir=' ${IOTDB_DATANODE_CONFIG} || echo "data/datanode/sync") | sed 's/.*=//')
pipe_receiver_file_dirs=$(echo $(grep '^pipe_receiver_file_dirs=' ${IOTDB_DATANODE_CONFIG} || echo "data/datanode/system/pipe/receiver") | sed 's/.*=//')
pipe_consensus_receiver_file_dirs=$(echo $(grep '^pipe_consensus_receiver_file_dirs=' ${IOTDB_DATANODE_CONFIG} || echo "data/datanode/system/pipe/consensus/receiver") | sed 's/.*=//')
sort_tmp_dir=$(echo $(grep '^sort_tmp_dir=' ${IOTDB_DATANODE_CONFIG} || echo "data/datanode/tmp") | sed 's/.*=//')

function clearPath {
Expand All @@ -64,8 +62,6 @@ clearPath $dn_consensus_dir
clearPath $dn_wal_dirs
clearPath $dn_tracing_dir
clearPath $dn_sync_dir
clearPath $pipe_receiver_file_dirs
clearPath $pipe_consensus_receiver_file_dirs
clearPath $sort_tmp_dir

echo "DataNode clean done ..."

0 comments on commit 18aaf8a

Please sign in to comment.