Skip to content

Commit c48da07

Browse files
feeblefakieinv-jishnuypeckstadt
authored
Backport to branch(3.12) : Add enum, constants for data loader (#2402)
Co-authored-by: inv-jishnu <[email protected]> Co-authored-by: Peckstadt Yves <[email protected]>
1 parent f876df7 commit c48da07

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.scalar.db.dataloader.core;
2+
3+
/** The constants that are used in the com.scalar.dataloader.core package */
4+
public class Constants {
5+
6+
public static final String IMPORT_LOG_ENTRY_STATUS_FIELD = "data_loader_import_status";
7+
public static final String TABLE_LOOKUP_KEY_FORMAT = "%s.%s";
8+
9+
public static final String LOG_UPDATE_SUCCESS = "Row %s has been updated in table %s.%s";
10+
public static final String LOG_INSERT_SUCCESS = "Row %s has been inserted into table %s.%s";
11+
public static final String LOG_IMPORT_VALIDATION = "Validating data for line %s ...";
12+
public static final String LOG_IMPORT_GET_DATA =
13+
"Retrieving existing data record from database ...";
14+
public static final String LOG_IMPORT_LINE_SUCCESS = "Row %s import is completed";
15+
public static final String LOG_IMPORT_LINE_FAILED = "Row %s import has failed: %s";
16+
public static final String LOG_IMPORT_COMPLETED =
17+
"The import process has been completed. Please check the success and failed output files for a detailed report";
18+
19+
public static final String LOG_SCANNING_START = "Retrieving data from %s.%s table ...";
20+
public static final String LOG_CONVERTING = "Converting %s.%s data to %s ...";
21+
public static final String MISSING_CSV_HEADERS =
22+
"Valid headers are not present or missing in the provided CSV file";
23+
public static final String ERROR_MISSING_SOURCE_FIELD =
24+
"the data mapping source field '%s' for table '%s' is missing in the json data record";
25+
public static final String ABORT_TRANSACTION_STATUS =
26+
"Transaction aborted as part of batch transaction aborted";
27+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.scalar.db.dataloader.core;
2+
3+
/** Type of key in database */
4+
public enum DatabaseKeyType {
5+
PARTITION,
6+
CLUSTERING
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.scalar.db.dataloader.core;
2+
3+
/** The available modes a ScalarDB instance can run in */
4+
public enum ScalarDBMode {
5+
STORAGE,
6+
TRANSACTION
7+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.scalar.db.dataloader.core;
2+
3+
import com.scalar.db.io.Key;
4+
import lombok.Value;
5+
6+
/** * The scan range which is used in data export scan filtering */
7+
@Value
8+
public class ScanRange {
9+
/** The key for scan start filter */
10+
Key scanStartKey;
11+
/** The key for scan end filter */
12+
Key scanEndKey;
13+
/** To include the scan start key value in the export data scan */
14+
boolean isStartInclusive;
15+
/** To include the scan end key value in the export data scan */
16+
boolean isEndInclusive;
17+
}

0 commit comments

Comments
 (0)