@@ -69,14 +69,14 @@ public Integer call() throws Exception {
6969 spec .commandLine (), dataChunkQueueSize , DataLoaderError .INVALID_DATA_CHUNK_QUEUE_SIZE );
7070 ControlFile controlFile = parseControlFileFromPath (controlFilePath ).orElse (null );
7171 ImportOptions importOptions = createImportOptions (controlFile );
72- ImportLoggerConfig config =
72+ ImportLoggerConfig importLoggerConfig =
7373 ImportLoggerConfig .builder ()
7474 .logDirectoryPath (logDirectory )
7575 .isLogRawSourceRecordsEnabled (importOptions .isLogRawRecord ())
7676 .isLogSuccessRecordsEnabled (importOptions .isLogSuccessRecords ())
7777 .prettyPrint (prettyPrint )
7878 .build ();
79- LogWriterFactory logWriterFactory = createLogWriterFactory (config );
79+ LogWriterFactory logWriterFactory = createLogWriterFactory (importLoggerConfig );
8080 File configFile = new File (configFilePath );
8181 TransactionFactory transactionFactory = TransactionFactory .create (configFile );
8282
@@ -92,8 +92,8 @@ public Integer call() throws Exception {
9292 importOptions ,
9393 tableMetadataMap ,
9494 reader ,
95+ importLoggerConfig ,
9596 logWriterFactory ,
96- config ,
9797 transactionFactory );
9898 importManager .startImport ();
9999 }
@@ -149,17 +149,17 @@ private Map<String, TableMetadata> createTableMetadataMap(
149149 * @param importOptions import options
150150 * @param tableMetadataMap table metadata map
151151 * @param reader buffered reader with source data
152+ * @param importLoggerConfig import logging config
152153 * @param logWriterFactory log writer factory object
153- * @param config import logging config
154154 * @param transactionFactory transaction factory to use
155155 * @return ImportManager object
156156 */
157157 private ImportManager createImportManager (
158158 ImportOptions importOptions ,
159159 Map <String , TableMetadata > tableMetadataMap ,
160160 BufferedReader reader ,
161+ ImportLoggerConfig importLoggerConfig ,
161162 LogWriterFactory logWriterFactory ,
162- ImportLoggerConfig config ,
163163 TransactionFactory transactionFactory )
164164 throws IOException {
165165 ImportProcessorFactory importProcessorFactory = new DefaultImportProcessorFactory ();
@@ -172,9 +172,10 @@ private ImportManager createImportManager(
172172 scalarDbMode ,
173173 transactionFactory .getTransactionManager ());
174174 if (importOptions .getLogMode ().equals (LogMode .SPLIT_BY_DATA_CHUNK )) {
175- importManager .addListener (new SplitByDataChunkImportLogger (config , logWriterFactory ));
175+ importManager .addListener (
176+ new SplitByDataChunkImportLogger (importLoggerConfig , logWriterFactory ));
176177 } else {
177- importManager .addListener (new SingleFileImportLogger (config , logWriterFactory ));
178+ importManager .addListener (new SingleFileImportLogger (importLoggerConfig , logWriterFactory ));
178179 }
179180 return importManager ;
180181 }
@@ -275,18 +276,14 @@ void validateTransactionMode(TransactionFactory transactionFactory) {
275276 // Transaction mode is not supported by the configured transaction manager
276277 throw new ParameterException (
277278 spec .commandLine (),
278- DataLoaderError .INVALID_TRANSACTION_MODE .buildMessage (
279- "Please try with STORAGE mode or check your ScalarDB configuration. "
280- + "Error: "
281- + e .getClass ().getSimpleName ()
282- + " - "
283- + e .getMessage ()));
279+ DataLoaderError .INVALID_TRANSACTION_MODE .buildMessage (e .getMessage ()),
280+ e );
284281 } catch (Exception e ) {
285282 // Other exceptions - configuration or runtime error
286283 throw new ParameterException (
287284 spec .commandLine (),
288- DataLoaderError .TRANSACTION_MODE_VALIDATION_FAILED .buildMessage (
289- "Error: " + e . getClass (). getSimpleName () + " - " + e . getMessage ()) );
285+ DataLoaderError .TRANSACTION_MODE_VALIDATION_FAILED .buildMessage (e . getMessage ()),
286+ e );
290287 } finally {
291288 // Ensure transaction is aborted
292289 if (transaction != null ) {
0 commit comments