Took out the dumping of the collections file. Now only collection/app data is dumped into s3. Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/d1a4c0d4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/d1a4c0d4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/d1a4c0d4 Branch: refs/pull/60/merge Commit: d1a4c0d48fb49969a92c35f30ffb1acf3c351e32 Parents: 6604061 Author: GERey Authored: Thu Feb 6 13:35:24 2014 -0800 Committer: GERey Committed: Thu Feb 6 13:35:24 2014 -0800 ---------------------------------------------------------------------- .../management/export/ExportServiceImpl.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/d1a4c0d4/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java ---------------------------------------------------------------------- diff --git a/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java b/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java index b9cacc7..5fd6a58 100644 --- a/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java +++ b/stack/services/src/main/java/org/usergrid/management/export/ExportServiceImpl.java @@ -181,12 +181,16 @@ public class ExportServiceImpl implements ExportService{ // Get the JSon serializer. //Creates the applications folder - JsonGenerator jg = getJsonGenerator( createOutputFile( "application", application.getValue() ) ); - - //JsonGenerator jg = getJsonGenerator( new File( "/Users/ApigeeCorporation/derp.txt" )); + /* What needs to be done: + * take the file name generator and create one that will only output the collections we need + * this will probably icnlude taking both file names, and making sure that it is not doing + * two passes as todd had it originally. */ + // JsonGenerator jg = getJsonGenerator( createOutputFile( "application", application.getValue() ) ); + String appFileName = prepareOutputFileName( "application", application.getValue() ); + JsonGenerator jg = getJsonGenerator( new File( appFileName ) ); // load the dictionary @@ -228,7 +232,10 @@ public class ExportServiceImpl implements ExportService{ jg.writeObject( nsEntity ); // Create a GENERATOR for the application collections. - JsonGenerator collectionsJg = getJsonGenerator( createOutputFile( "collections", application.getValue() ) ); + //JsonGenerator collectionsJg = getJsonGenerator( createOutputFile( "collections", application.getValue() ) ); + + String collectionsFilename = prepareOutputFileName( "collections","appDummyName" ); + JsonGenerator collectionsJg = getJsonGenerator( new File( collectionsFilename ) ); collectionsJg.writeStartObject(); @@ -276,7 +283,9 @@ public class ExportServiceImpl implements ExportService{ // Close writer and file for this application. jg.writeEndArray(); jg.close(); - copyToS3( filename , config ); + copyToS3( appFileName , config ); + //below line doesn't copy very good data anyways. + //copyToS3( collectionsFilename, config ); } }