File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ usage() {
1717 echo " --data-dir PATH Directory to store processed data (default: ./)"
1818 echo " --memory SIZE JVM heap size (default: 16g)"
1919 echo " --threads NUM Maximum number of import threads (default: half of CPU cores)"
20+ echo " -y, --skip-mem-check Skip memory availability check and warning prompt"
2021 echo " -h, --help Show this help message"
2122 echo " "
2223 echo " Examples:"
@@ -40,6 +41,7 @@ THREADS=""
4041PBF_FILE=" "
4142
4243# Parse arguments
44+ SKIP_MEM_CHECK=false
4345while [[ $# -gt 0 ]]; do
4446 case $1 in
4547 --jar-file)
@@ -58,6 +60,10 @@ while [[ $# -gt 0 ]]; do
5860 THREADS=" $2 "
5961 shift 2
6062 ;;
63+ -y|--skip-mem-check)
64+ SKIP_MEM_CHECK=true
65+ shift
66+ ;;
6167 -h|--help)
6268 usage
6369 ;;
@@ -129,7 +135,7 @@ REQUESTED_MEM_GB=$(echo "$MEMORY" | sed 's/[^0-9]//g')
129135echo " System memory: ${AVAILABLE_MEM_GB} GB available"
130136echo " Requested heap: $MEMORY "
131137
132- if [ " $REQUESTED_MEM_GB " -gt " $AVAILABLE_MEM_GB " ]; then
138+ if [ " $SKIP_MEM_CHECK " = false ] && [ " $ REQUESTED_MEM_GB" -gt " $AVAILABLE_MEM_GB " ]; then
133139 echo " "
134140 echo " ⚠️ WARNING: Requested heap size ($MEMORY ) exceeds available memory (${AVAILABLE_MEM_GB} GB)"
135141 echo " This may cause the process to be killed by the OOM killer."
@@ -141,6 +147,8 @@ if [ "$REQUESTED_MEM_GB" -gt "$AVAILABLE_MEM_GB" ]; then
141147 echo " Import cancelled."
142148 exit 1
143149 fi
150+ elif [ " $SKIP_MEM_CHECK " = true ]; then
151+ echo " Skipping memory check (--skip-mem-check flag used)"
144152fi
145153
146154# Build JVM arguments with memory management optimizations
Original file line number Diff line number Diff line change @@ -23,10 +23,6 @@ IMPORT_THREADS="${IMPORT_THREADS:-10}"
2323# --- Remote Machine Settings ---
2424REMOTE_BASE_DIR=" /opt/paikka/data"
2525
26- # --- Geocoder API Settings ---
27- GEOCODER_ADMIN_URL=" http://localhost:8080/admin/refresh-db"
28- GEOCODER_TEST_URL_BASE=" http://localhost:8080/v1/reverse"
29-
3026# Global variables that will be set by parse_args_and_configure or environment
3127REMOTE_USER=" "
3228REMOTE_HOST=" "
@@ -120,6 +116,7 @@ local_create_import_bundle() {
120116 --memory " $IMPORT_MEMORY " \
121117 --threads " $IMPORT_THREADS " \
122118 --data-dir " /import/" \
119+ --skip-mem-check \
123120 " /download/$PBF_FILTERED_FILE "
124121}
125122
You can’t perform that action at this time.
0 commit comments