-
Notifications
You must be signed in to change notification settings - Fork 49
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
Initial commit for gcsync command line tool #796
base: main
Are you sure you want to change the base?
Changes from all commits
331b5c8
8b2cfa7
950a0c2
bb67a0e
0e60696
e700ec9
9639321
7c064d8
03687be
604fcad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ message Checksum { | |
uint64 blockOffset = 1; | ||
uint32 blockLength = 2; | ||
int32 weakChecksum = 3; | ||
int64 strongChecksum = 4; | ||
string strongChecksum = 4; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be safer as bytes - although bytes are really expensive in protobuf, so it might as well be string. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can leave it as string. |
||
} | ||
|
||
message Instruction { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
*/ | ||
|
||
plugins { | ||
alias libs.plugins.shadow | ||
id 'dbsync.java-application-conventions' | ||
} | ||
|
||
dependencies { | ||
implementation project(':dbsync:common') | ||
implementation project(':dbsync:storage-aws') | ||
implementation project(':dbsync:storage-gcs') | ||
implementation libs.jopt.simple | ||
implementation libs.jdiagnostics | ||
implementation libs.commons.lang3 | ||
implementation libs.google.cloud.run | ||
|
||
// Test dependencies | ||
testImplementation 'junit:junit:4.13.2' | ||
testImplementation 'org.mockito:mockito-core:4.11.0' | ||
testImplementation 'org.mockito:mockito-inline:4.11.0' | ||
} | ||
|
||
application { | ||
mainClass = 'com.google.edwmigration.dbsync.gcsync.GcsyncMain' | ||
} | ||
|
||
shadowJar { | ||
mergeServiceFiles() | ||
} | ||
|
||
test { | ||
useJUnit() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.google.edwmigration.dbsync.gcsync; | ||
|
||
public class Constants { | ||
|
||
public static final String FILES_TO_RSYNC_FILE_NAME = "filesToRsync.txt"; | ||
|
||
public static final String JAR_FILE_NAME = "gcsync-all.jar"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this and other constants which are only used in one file, I'd move it to that file. |
||
|
||
public static final String CHECK_SUM_FILE_SUFFIX = "checksum"; | ||
|
||
public static final String INSTRUCTION_FILE_SUFFIX = "instruction"; | ||
|
||
public static final String TMP_FILE_SUFFIX = "updated"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd consider adding an enum instead of the |
||
|
||
public static final int BLOCK_SIZE = 4096; | ||
|
||
// 10 MiB | ||
public static final long RSYNC_SIZE_THRESHOLD = 10 * 1024 * 1024; | ||
|
||
public static final String GENERATE_CHECK_SUM_MAIN = GenerateCheckSumMain.class.getName(); | ||
|
||
public static final String RECONSTRUCT_FILE_MAIN = ReconstructFilesMain.class.getName(); | ||
} |
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.
What does the value
-1
mean forcopyStart
?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.
It means copyStart is unset
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.
Please document this, e.g.