-
Notifications
You must be signed in to change notification settings - Fork 38
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
Delete feed from RDBMS #134
Merged
+296
−102
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
94323ae
feat(delete): add delete feed feature to SQL code path
landonreed c8a77f8
refactor(cmd-line): add delete and json to command line options
landonreed 94a3ae4
refactor(graphql): use non-deprecated method for building GraphQL object
landonreed 67e0763
refactor(load): add filename field to FeedLoadResult
landonreed 7acbc6d
refactor(load): add fileSize field to TableLoadResult
landonreed 0eedbdd
style(comments): fix/add comments
landonreed 44038e9
refactor(delete): mark feed as deleted in feeds table (rather than de…
landonreed e87ab5f
Merge pull request #136 from conveyal/dev
75e54cf
Merge pull request #137 from conveyal/dev
32f17ca
Merge pull request #139 from conveyal/dev
1b394e0
4.0.0 [ci skip]
semantic-release-bot 3328c4b
Prepare next development iteration 4.0.1-SNAPSHOT [ci skip]
semantic-release-bot 811e999
Merge branch 'master' into delete-feed
landonreed a346fca
refactor: address PR #134 comments
landonreed 75200e9
refactor: add comment
landonreed 8c9d605
move object mapper closer to instantiation
landonreed c08ba7f
clean up whitespace for options, feedId -> namespace
landonreed 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 |
---|---|---|
|
@@ -179,8 +179,8 @@ public static DataSource createDataSource (String url, String username, String p | |
* It also lets you run a GraphQL API for all the feeds loaded into the database. | ||
*/ | ||
public static void main (String[] args) throws IOException { | ||
// Object mapper used for writing load or validation results to file. | ||
ObjectMapper mapper = new ObjectMapper(); | ||
// Object mapper used for writing load or validation results to file (instantia). | ||
ObjectMapper mapper = null; | ||
Options options = getOptions(); | ||
CommandLine cmd; | ||
try { | ||
|
@@ -210,6 +210,7 @@ public static void main (String[] args) throws IOException { | |
boolean storeResults = cmd.hasOption("json"); | ||
File directory = null; | ||
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 would move the creation of the objectMapper down here, conditional upon storeResults=true. |
||
if (storeResults) { | ||
mapper = new ObjectMapper(); | ||
directory = cmd.getOptionValue("json") != null ? new File(cmd.getOptionValue("json")) : Files.createTempDir(); | ||
LOG.info("Storing results in directory: {}", directory.getAbsolutePath()); | ||
} | ||
|
@@ -296,7 +297,7 @@ public static void main (String[] args) throws IOException { | |
String namespaceToDelete = cmd.getOptionValue("delete"); | ||
|
||
if (namespaceToDelete != null) { | ||
LOG.info("Exporting feed with unique identifier {}", namespaceToDelete); | ||
LOG.info("Deleting feed with unique identifier {}", namespaceToDelete); | ||
try { | ||
delete(namespaceToDelete, dataSource); | ||
LOG.info("Feed {} has been successfully deleted.", namespaceToDelete); | ||
|
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.
There appears to be stray text in this comment. This is a detail, but I'd find the code easier to read if the variable were declared and initialized to null just before it is conditionally set to a new instance, around line 211 where we also declare
File directory = null;