-
Notifications
You must be signed in to change notification settings - Fork 40
Add enum, constants for data loader #2386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
df78881
Enum, constants for data loader
inv-jishnu 5343891
Removed error messages
inv-jishnu 64b0334
spotless applied
inv-jishnu b0ae7d9
Merge branch 'master' into feat/dataloader/enum
ypeckstadt f9c81b6
Merge branch 'master' into feat/dataloader/enum
ypeckstadt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
data-loader/core/src/main/java/com/scalar/db/dataloader/core/Constants.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"; | ||
| } | ||
7 changes: 7 additions & 0 deletions
7
data-loader/core/src/main/java/com/scalar/db/dataloader/core/DatabaseKeyType.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
7 changes: 7 additions & 0 deletions
7
data-loader/core/src/main/java/com/scalar/db/dataloader/core/ScalarDBMode.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
17 changes: 17 additions & 0 deletions
17
data-loader/core/src/main/java/com/scalar/db/dataloader/core/ScanRange.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this will be used like
String.format(LOG_UPDATE_SUCCESS, namespace, table), but IntelliJ doesn't detect parameter mismatch likeString.format(LOG_UPDATE_SUCCESS, namespace)in this way. It might be a slight drawback.