This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Documentation changes, class name changes, runAsService() #21
Open
nverwer
wants to merge
8
commits into
StreakYC:master
Choose a base branch
from
nverwer:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ba53d7a
extend .gitignore for eclipse
1f8db25
Added some things to readme.md.
7ba9944
runAsService parameter added
deb755b
Corrections to documentation.
fc79427
Added error handling.
8ee9d6a
Catch error that happened during backup.
4fc5821
Prevent endless loop when trying to find non-existing gs-handle for b…
aa4cdbb
Modify logging to find out why Members are not ingested any more.
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
This file contains 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 |
---|---|---|
|
@@ -2,3 +2,5 @@ bin/ | |
build/ | ||
build.properties | ||
/target | ||
.classpath | ||
.project |
This file contains 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,3 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding/<project>=UTF-8 |
This file contains 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,5 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | ||
org.eclipse.jdt.core.compiler.source=1.7 |
This file contains 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,4 @@ | ||
activeProfiles= | ||
eclipse.preferences.version=1 | ||
resolveWorkspaceProjects=true | ||
version=1 |
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -4,11 +4,11 @@ | |
|
||
<groupId>com.streak</groupId> | ||
<artifactId>mache</artifactId> | ||
<version>0.2.0-SNAPSHOT</version> | ||
<version>0.5.0-NVE</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>Mache</name> | ||
<url>https://github.com/StreakYC/mache</url> | ||
<url>https://github.com/nverwer/mache</url> | ||
|
||
<licenses> | ||
<license> | ||
|
@@ -25,11 +25,6 @@ | |
<organizationUrl>http://www.streak.com</organizationUrl> | ||
</developer> | ||
</developers> | ||
<scm> | ||
<connection>scm:git:[email protected]:StreakYC/mache.git</connection> | ||
<developerConnection>scm:git:[email protected]:StreakYC/mache.git</developerConnection> | ||
<url>[email protected]:StreakYC/mache.git</url> | ||
</scm> | ||
|
||
|
||
<properties> | ||
|
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -55,6 +55,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc | |
String bigqueryDatasetId = exporterConfig.getBigqueryDatasetId(); | ||
String bigqueryProjectId = exporterConfig.getBigqueryProjectId(); | ||
boolean skipExport = exporterConfig.shouldSkipExportToBigquery(); | ||
boolean runAsService = exporterConfig.runAsService(); | ||
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. is it possible to do this in a backwards compatible way? Maybe have a default implementation of returning fals? 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 have tried several options of adding runAsService in a backward compatible way with default implementation, but they all would break existing code or became very, very complicated. This whole issue arose because of this question. The required changes to existing code are minor, and documented at the end of the readme.md. |
||
|
||
if (!AnalysisUtility.areParametersValid(bucketName, bigqueryProjectId) || (!skipExport && !AnalysisUtility.areParametersValid(bigqueryDatasetId))) { | ||
resp.getWriter().write(AnalysisUtility.failureJson("Exporter config returned null for one of the params")); | ||
|
@@ -74,7 +75,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc | |
String backupName = AnalysisUtility.getPreBackupName(timestamp, exporterConfig.getBackupNamePrefix()); | ||
|
||
// start the backup task | ||
TaskOptions t = createBackupTaskOptions(backupName, exporterConfig.getEntityKindsToExport(), bucketName, queue.getQueueName()); | ||
TaskOptions t = createBackupTaskOptions(backupName, exporterConfig.getEntityKindsToExport(), bucketName, queue.getQueueName(), runAsService); | ||
queue.add(t); | ||
|
||
// start another task to do the actual import into bigquery | ||
|
@@ -85,15 +86,16 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc | |
resp.getWriter().println(AnalysisUtility.successJson("successfully kicked off backup job: " + backupName + ", export to bigquery will begin once backup is complete.")); | ||
} | ||
|
||
private TaskOptions createBackupTaskOptions(String backupName, List<String> kindsToExport, String bucketName, String queueName) { | ||
private TaskOptions createBackupTaskOptions(String backupName, List<String> kindsToExport, String bucketName, String queueName, boolean runAsService) { | ||
TaskOptions t = TaskOptions.Builder.withUrl("/_ah/datastore_admin/backup.create"); | ||
t.param("name", backupName); | ||
for (String kind : kindsToExport) { | ||
t.param("kind", kind); | ||
} | ||
t.param("filesystem", "gs"); | ||
t.param("gs_bucket_name", bucketName); | ||
t.param("run_as_a_service", Boolean.TRUE.toString()); | ||
// Do not include run_as_a_service parameter when runAsService is false, because setting it to 'false' will not work. | ||
if (runAsService) t.param("run_as_a_service", Boolean.valueOf(runAsService).toString()); | ||
|
||
t.param("queue", queueName); | ||
|
||
|
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.
this is optional and only if they want to use datastore export
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.
Then I will add that to this point.