You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/09/29 22:00:41 UTC

[15/15] usergrid git commit: Lowered the entity fetch per query to lessen load on the system.

Lowered the entity fetch per query to lessen load on the system.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/f55f1d41
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/f55f1d41
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/f55f1d41

Branch: refs/heads/export-feature
Commit: f55f1d413e31a1816e26e1953cdf14639431530c
Parents: da720c1
Author: GERey <gr...@apigee.com>
Authored: Mon Sep 28 15:36:28 2015 -0700
Committer: GERey <gr...@apigee.com>
Committed: Mon Sep 28 15:36:28 2015 -0700

----------------------------------------------------------------------
 .../usergrid/management/export/ExportServiceImpl.java   | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/f55f1d41/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
index ffd8abf..6b24839 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
@@ -74,7 +74,7 @@ public class ExportServiceImpl implements ExportService {
     //inject service manager to get connections
 
     //Maximum amount of entities retrieved in a single go.
-    public static final int MAX_ENTITY_FETCH = 1000;
+    public static final int MAX_ENTITY_FETCH = 250;
 
     //Amount of time that has passed before sending another heart beat in millis
     public static final int TIMESTAMP_DELTA = 5000;
@@ -364,6 +364,7 @@ public class ExportServiceImpl implements ExportService {
 
         }
         catch ( Exception e ) {
+            logger.error( e.getMessage(),e );
             export.setErrorMessage( e.getMessage() );
             export.setState( Export.State.FAILED );
             return;
@@ -588,7 +589,7 @@ public class ExportServiceImpl implements ExportService {
 
     protected JsonGenerator getJsonGenerator( OutputStream outputStream ) throws IOException {
         //TODO:shouldn't the below be UTF-16?
-
+        //TODO:do
         JsonGenerator jg = jsonFactory.createGenerator( outputStream,JsonEncoding.UTF16_LE );
         jg.setPrettyPrinter( new MinimalPrettyPrinter( "" ) );
         jg.setCodec( new ObjectMapper() );
@@ -631,6 +632,7 @@ public class ExportServiceImpl implements ExportService {
 
         //Could easily be converted to take in input streams. Just a harder refactor.
         List<File> entitiesToExport = new ArrayList<>(  );
+        //TODO:Add config to change path where this file is written.
         File entityFileToBeExported = new File( "tempEntityExportPart1");
         JsonGenerator jg = getJsonGenerator( entityFileToBeExported );
         entityFileToBeExported.deleteOnExit();
@@ -644,9 +646,9 @@ public class ExportServiceImpl implements ExportService {
 
         for ( String collectionName : metadata.keySet() ) {
 
-            if ( collectionName.equals( "exports" ) ) {
-                continue;
-            }
+//            if ( collectionName.equals( "exports" ) ) {
+//                continue;
+//            }
             //if the collection you are looping through doesn't match the name of the one you want. Don't export it.
             if ( ( config.get( "collectionName" ) == null ) || collectionName.equalsIgnoreCase((String)config.get( "collectionName" ) ) ) {