mirror of
https://github.com/google/nomulus
synced 2026-08-31 21:27:09 +00:00
Run InitSqlPipeline (#727)
* Run InitSqlPipeline Added the main() method to InitSqlPipeline. Added a Gradle task to run InitSqlPipeline from command line. This task is meant for testing and experiments. Corrected the file name prefix of Datastore export files. Should be 'output-', defined as 'input-'.
This commit is contained in:
@@ -32,7 +32,7 @@ public final class BackupPaths {
|
||||
private BackupPaths() {}
|
||||
|
||||
private static final String WILDCARD_CHAR = "*";
|
||||
private static final String EXPORT_PATTERN_TEMPLATE = "%s/all_namespaces/kind_%s/input-%s";
|
||||
private static final String EXPORT_PATTERN_TEMPLATE = "%s/all_namespaces/kind_%s/output-%s";
|
||||
|
||||
public static final String COMMIT_LOG_NAME_PREFIX = "commit_diff_until_";
|
||||
private static final String COMMIT_LOG_PATTERN_TEMPLATE = "%s/" + COMMIT_LOG_NAME_PREFIX + "*";
|
||||
|
||||
@@ -40,6 +40,7 @@ import java.util.Collection;
|
||||
import java.util.Optional;
|
||||
import org.apache.beam.sdk.Pipeline;
|
||||
import org.apache.beam.sdk.PipelineResult;
|
||||
import org.apache.beam.sdk.options.PipelineOptionsFactory;
|
||||
import org.apache.beam.sdk.transforms.ParDo;
|
||||
import org.apache.beam.sdk.transforms.SerializableFunction;
|
||||
import org.apache.beam.sdk.transforms.Wait;
|
||||
@@ -234,4 +235,10 @@ public class InitSqlPipeline implements Serializable {
|
||||
return entityClasses.stream().map(Key::getKind).collect(ImmutableList.toImmutableList());
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
InitSqlPipelineOptions options =
|
||||
PipelineOptionsFactory.fromArgs(args).withValidation().as(InitSqlPipelineOptions.class);
|
||||
new InitSqlPipeline(options).run();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user