Removed explanation text. Added export endpoint + uuid so test should work correctly but doesnât. Removed commented out code in exportserviceimpl.
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/a58ecebb Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/a58ecebb Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/a58ecebb Branch: refs/pull/70/merge Commit: a58ecebbd3020053817ce1e0cf41b071fa5d70cc Parents: 59966c2 Author: grey <[email protected]> Authored: Wed Feb 19 16:32:26 2014 -0800 Committer: grey <[email protected]> Committed: Wed Feb 19 16:32:26 2014 -0800 ---------------------------------------------------------------------- .../usergrid/persistence/entities/Export.java | 19 +-------- .../rest/management/ManagementResourceIT.java | 2 +- .../management/export/ExportServiceImpl.java | 43 +------------------- 3 files changed, 4 insertions(+), 60 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a58ecebb/stack/core/src/main/java/org/usergrid/persistence/entities/Export.java ---------------------------------------------------------------------- diff --git a/stack/core/src/main/java/org/usergrid/persistence/entities/Export.java b/stack/core/src/main/java/org/usergrid/persistence/entities/Export.java index fdb41ac..f467430 100644 --- a/stack/core/src/main/java/org/usergrid/persistence/entities/Export.java +++ b/stack/core/src/main/java/org/usergrid/persistence/entities/Export.java @@ -8,25 +8,8 @@ import org.usergrid.persistence.annotations.EntityProperty; /** + *Contains state information for an Entity Job * - * - */ - -/** - * - *the sch system doesn't make any assumes about the job or how it works. - * and so if I need additional information to be persistant. - * - * The way to save data between queue and storing it. - * - * in my case, create a export entity. before I schedule the job and it'll have the pending state in it and - * all the information I need to run. Then I'll pass the ID of the export info I saved in a collection and i'll put that in the jbo - * data. - * - * persist the state in mechanisum that they can all access. - * - * I could make it a class and I can make it an entity. That way I can get it in and out. - * doesn't get exposed to the user. */ @XmlRootElement public class Export extends TypedEntity { http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a58ecebb/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java ---------------------------------------------------------------------- diff --git a/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java b/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java index 27b9b56..04b7bdc 100644 --- a/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java +++ b/stack/rest/src/test/java/org/usergrid/rest/management/ManagementResourceIT.java @@ -662,7 +662,7 @@ public class ManagementResourceIT extends AbstractRestIT { try { - node = resource().path( "test-organization/default-app/").queryParam( "access_token", + node = resource().path( "test-organization/test-app/export"+uuid).queryParam( "access_token", superAdminToken() ).accept( MediaType.APPLICATION_JSON ) .type( MediaType.APPLICATION_JSON_TYPE ).get( JsonNode.class ); // node = resource().path( "/management/exportStats/"+uuid ).accept( MediaType.APPLICATION_JSON ).type( MediaType.APPLICATION_JSON_TYPE ) http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a58ecebb/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 949d7c8..445fe10 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 @@ -303,70 +303,31 @@ public class ExportServiceImpl implements ExportService { Map<String, Object> metadata = em.getApplicationCollectionMetadata(); long starting_time = System.currentTimeMillis(); - //jg.writeStartObject(); - - // Loop through the collections. This is the only way to loop // through the entities in the application (former namespace). //could support queries, just need to implement that in the rest endpoint. for ( String collectionName : metadata.keySet() ) { - //jg.writeFieldName( "EntityInfo" ); - - - Query query = new Query(); query.setLimit( MAX_ENTITY_FETCH ); query.setResultsLevel( Results.Level.ALL_PROPERTIES ); - //paging iterator. Clean this code up using it. Results entities = em.searchCollection( em.getApplicationRef(), collectionName, query ); PagingResultsIterator itr = new PagingResultsIterator( entities ); -//untested + for( Object e: itr){ starting_time = checkTimeDelta( starting_time, jobExecution ); Entity entity = ( Entity ) e; - //for ( Entity entity : entities ) { + jg.writeStartObject(); jg.writeFieldName( "Metadata" ); jg.writeObject( entity ); saveCollectionMembers( jg, em, application.getValue(), entity ); jg.writeEndObject(); - //} - - } - - -// working -// while ( entities.size() > 0 ) { -// jobExecution.heartbeat(); -// for ( Entity entity : entities ) { -// jg.writeStartObject(); -// jg.writeFieldName( "Metadata" ); -// jg.writeObject( entity ); -// saveCollectionMembers( jg, em, application.getValue(), entity ); -// jg.writeEndObject(); -// } -// -// //we're done -// if ( entities.getCursor() == null ) { -// break; -// } -// -// -// query.setCursor( entities.getCursor() ); -// -// entities = em.searchCollection( em.getApplicationRef(), collectionName, query ); -// -// } - } // Close writer and file for this application. - - // logger.warn(); - //jg.writeEndObject(); jg.writeEndArray(); jg.close(); baos.flush();
