Skip to content

Commit

Permalink
Backport to branch(3.11) : Add enum, constants for data loader (#2403)
Browse files Browse the repository at this point in the history
Co-authored-by: inv-jishnu <31100916+inv-jishnu@users.noreply.github.com>
Co-authored-by: Peckstadt Yves <peckstadt.yves@gmail.com>
  • Loading branch information
3 people authored Dec 13, 2024
1 parent 6dbe9d4 commit 2b03721
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.scalar.db.dataloader.core;

/** The constants that are used in the com.scalar.dataloader.core package */
public class Constants {

public static final String IMPORT_LOG_ENTRY_STATUS_FIELD = "data_loader_import_status";
public static final String TABLE_LOOKUP_KEY_FORMAT = "%s.%s";

public static final String LOG_UPDATE_SUCCESS = "Row %s has been updated in table %s.%s";
public static final String LOG_INSERT_SUCCESS = "Row %s has been inserted into table %s.%s";
public static final String LOG_IMPORT_VALIDATION = "Validating data for line %s ...";
public static final String LOG_IMPORT_GET_DATA =
"Retrieving existing data record from database ...";
public static final String LOG_IMPORT_LINE_SUCCESS = "Row %s import is completed";
public static final String LOG_IMPORT_LINE_FAILED = "Row %s import has failed: %s";
public static final String LOG_IMPORT_COMPLETED =
"The import process has been completed. Please check the success and failed output files for a detailed report";

public static final String LOG_SCANNING_START = "Retrieving data from %s.%s table ...";
public static final String LOG_CONVERTING = "Converting %s.%s data to %s ...";
public static final String MISSING_CSV_HEADERS =
"Valid headers are not present or missing in the provided CSV file";
public static final String ERROR_MISSING_SOURCE_FIELD =
"the data mapping source field '%s' for table '%s' is missing in the json data record";
public static final String ABORT_TRANSACTION_STATUS =
"Transaction aborted as part of batch transaction aborted";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.scalar.db.dataloader.core;

/** Type of key in database */
public enum DatabaseKeyType {
PARTITION,
CLUSTERING
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.scalar.db.dataloader.core;

/** The available modes a ScalarDB instance can run in */
public enum ScalarDBMode {
STORAGE,
TRANSACTION
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.scalar.db.dataloader.core;

import com.scalar.db.io.Key;
import lombok.Value;

/** * The scan range which is used in data export scan filtering */
@Value
public class ScanRange {
/** The key for scan start filter */
Key scanStartKey;
/** The key for scan end filter */
Key scanEndKey;
/** To include the scan start key value in the export data scan */
boolean isStartInclusive;
/** To include the scan end key value in the export data scan */
boolean isEndInclusive;
}

0 comments on commit 2b03721

Please sign in to comment.