You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2015/02/03 16:32:49 UTC

[3/3] incubator-usergrid git commit: Merge branch 'two-dot-o-import' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o-import

Merge branch 'two-dot-o-import' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into two-dot-o-import

Conflicts:
	stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
	stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java


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

Branch: refs/heads/two-dot-o-import
Commit: c652c39bc7a87db15dd68349b7709df60cc8566d
Parents: b22c37a 63088a2
Author: Dave Johnson <dm...@apigee.com>
Authored: Tue Feb 3 10:32:32 2015 -0500
Committer: Dave Johnson <dm...@apigee.com>
Committed: Tue Feb 3 10:32:32 2015 -0500

----------------------------------------------------------------------
 .../queue/impl/QueueScopeFactoryImpl.java       |   1 +
 .../queue/impl/SQSQueueManagerImpl.java         |  51 --------
 .../queue/impl/UsergridAwsCredentials.java      |  59 +++++++++
 .../impl/UsergridAwsCredentialsProvider.java    |  59 +++++++++
 .../organizations/OrganizationResource.java     |  26 ++--
 .../applications/ApplicationResource.java       |  48 ++++---
 .../rest/management/ExportResourceIT.java       |  11 +-
 .../rest/management/ImportResourceIT.java       |  14 +-
 .../management/export/ExportServiceImpl.java    |   2 +-
 .../management/export/S3ExportImpl.java         |   5 +-
 .../management/importer/FileImportJob.java      |   4 +-
 .../management/importer/ImportService.java      |  19 +--
 .../management/importer/ImportServiceImpl.java  | 128 +++++++++++++------
 .../management/importer/S3ImportImpl.java       |   6 +-
 .../notifications/NotificationsService.java     |   2 +-
 .../services/queues/ImportQueueListener.java    |  26 ++--
 .../services/queues/ImportQueueManager.java     |  65 ++++++++++
 .../services/queues/ImportQueueMessage.java     |  42 +++++-
 .../usergrid/services/queues/QueueListener.java |   4 +-
 .../resources/usergrid-services-context.xml     |  23 +++-
 .../management/export/ExportServiceIT.java      |  23 ++--
 .../management/importer/ImportServiceIT.java    |  48 +++++--
 .../src/test/resources/log4j.properties         |   1 +
 23 files changed, 466 insertions(+), 201 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c652c39b/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
index 6f2eddd,6f2eddd..0b1fac5
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
@@@ -17,6 -17,6 +17,7 @@@
  package org.apache.usergrid.management.export;
  
  
++import com.amazonaws.SDKGlobalConfiguration;
  import com.google.common.collect.ImmutableSet;
  import com.google.common.util.concurrent.ListenableFuture;
  import com.google.inject.Module;
@@@ -50,8 -50,8 +51,8 @@@ public class S3ExportImpl implements S3
          Map<String, Object> storage_info = (Map<String,Object>)properties.get( "storage_info" );
  
          String bucketName = ( String ) storage_info.get( "bucket_location" );
--        String accessId = ( String ) storage_info.get( "s3_access_id" );
--        String secretKey = ( String ) storage_info.get( "s3_key" );
++        String accessId = ( String ) storage_info.get( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR );
++        String secretKey = ( String ) storage_info.get( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR );
  
          Properties overrides = new Properties();
          overrides.setProperty( "s3" + ".identity", accessId );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c652c39b/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
index cb83ce8,edeed1c..089c8e5
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
@@@ -54,33 -54,19 +54,33 @@@ public class FileImportJob extends Only
  
      @Override
      protected void doJob(JobExecution jobExecution) throws Exception {
 -        logger.info( "execute FileImportJob {}", jobExecution.toString() );
 +        logger.info("execute FileImportJob {}", jobExecution.toString());
  
 -        JobData jobData = jobExecution.getJobData();
 -        if ( jobData == null ) {
 -            logger.error( "jobData cannot be null" );
 -            return;
 -        }
 +        try {
 +            JobData jobData = jobExecution.getJobData();
 +            if (jobData == null) {
 +                logger.error("jobData cannot be null");
 +                return;
 +            }
 +
 +            // heartbeat to indicate job has started
 +            jobExecution.heartbeat();
  
 -        // heartbeat to indicate job has started
 -        jobExecution.heartbeat();
 +            // call the File Parser for the file set in job execution
 +            importService.parseFileToEntities(jobExecution);
-             
+ 
 -        // call the File Parser for the file set in job execution
 -        //importService.parseFileToEntities(jobExecution);
 +        } catch ( Throwable t ) {
 +            logger.debug("Error importing file", t);
 +
 +            // update file import record
 +            UUID fileImportId = (UUID) jobExecution.getJobData().getProperty(FILE_IMPORT_ID);
 +            EntityManager em = emf.getEntityManager(CpNamingUtils.MANAGEMENT_APPLICATION_ID);
 +            FileImport fileImport = em.get(fileImportId, FileImport.class);
 +            fileImport.setState( FileImport.State.FAILED );
 +            em.update( fileImport );
 +
 +            throw t;
 +        }
  
          logger.error("File Import Service completed job");
      }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c652c39b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportService.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/management/importer/ImportService.java
index bc90f49,26fb31f..2275888
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportService.java
@@@ -46,17 -47,17 +47,18 @@@ public interface ImportService 
  
      /**
       * Parses the input file and creates entities
--     *
--     * @param jobExecution
--     * @throws Exception
+      */
+     void parseFileToEntities(ImportQueueMessage importQueueMessage) throws Exception;
+ 
+     /**
++     * Parses the input file and creates entities
 +     */
 +    void parseFileToEntities(JobExecution jobExecution) throws Exception;
 +
 +    /**
       * Get the state for the Job with UUID
       * @param uuid Job UUID
       * @return State of Job
--     * @throws Exception
       */
      String getState(UUID uuid) throws Exception;
  
@@@ -64,21 -65,21 +66,22 @@@
       * Returns error message for the job with UUID
       * @param uuid Job UUID
       * @return error message
--     * @throws Exception
       */
      String getErrorMessage(UUID uuid) throws Exception;
  
      /**
--     * @param jobExecution
       * @return FileImportEntity
--     * @throws Exception
+      */
+     FileImport getFileImportEntity(final ImportQueueMessage importQueueMessage) throws Exception;
+ 
+     /**
++     * @return FileImportEntity
 +     */
 +    FileImport getFileImportEntity(final JobExecution jobExecution) throws Exception;
 +
 +    /**
       * @param jobExecution
       * @return ImportEntity
--     * @throws Exception
       */
      Import getImportEntity(final JobExecution jobExecution) throws Exception;
  

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c652c39b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
index 7339087,b8431fa..1357ccb
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
@@@ -27,6 -28,9 +28,7 @@@ import org.apache.usergrid.persistence.
  import org.apache.usergrid.persistence.entities.FileImport;
  import org.apache.usergrid.persistence.entities.Import;
  import org.apache.usergrid.persistence.entities.JobData;
+ 
 -import org.aspectj.lang.annotation.Before;
  import org.codehaus.jackson.JsonFactory;
  import org.codehaus.jackson.JsonParseException;
  import org.codehaus.jackson.JsonParser;
@@@ -44,7 -48,18 +46,17 @@@ import java.io.File
  import java.io.IOException;
  import java.util.*;
  
+ import javax.annotation.PostConstruct;
+ 
+ 
  import org.apache.usergrid.persistence.index.query.Query.Level;
 -import org.apache.usergrid.persistence.index.utils.UUIDUtils;
+ import org.apache.usergrid.persistence.queue.QueueManager;
+ import org.apache.usergrid.persistence.queue.QueueManagerFactory;
+ import org.apache.usergrid.persistence.queue.QueueScope;
+ import org.apache.usergrid.persistence.queue.QueueScopeFactory;
+ import org.apache.usergrid.services.ServiceManagerFactory;
+ import org.apache.usergrid.services.queues.ImportQueueListener;
+ import org.apache.usergrid.services.queues.ImportQueueMessage;
  
  
  public class ImportServiceImpl implements ImportService {
@@@ -62,16 -77,39 +74,38 @@@
      //dependency injection
      private SchedulerService sch;
  
+     private ServiceManagerFactory smf;
+ 
+     //Dependency injection through spring
+     private QueueManager qm;
+ 
+     private QueueManagerFactory queueManagerFactory;
+ 
 -
      //inject Management Service to access Organization Data
      private ManagementService managementService;
      private JsonFactory jsonFactory = new JsonFactory();
  
++
+     @PostConstruct
+     public void init(){
++
+         //TODO: move this to a before or initialization method.
+ 
+         //TODO: made queueName clearly defined.
+         //smf = getApplicationContext().getBean(ServiceManagerFactory.class);
+ 
+         String name = ImportQueueListener.QUEUE_NAME;
+         QueueScopeFactory queueScopeFactory = CpSetup.getInjector().getInstance(QueueScopeFactory.class);
+         QueueScope queueScope = queueScopeFactory.getScope(CpNamingUtils.MANAGEMENT_APPLICATION_ID, name);
+         queueManagerFactory = CpSetup.getInjector().getInstance(QueueManagerFactory.class);
+         qm = queueManagerFactory.getQueueManager(queueScope);
 -
+     }
+ 
      /**
       * This schedules the main import Job
       *
       * @param config configuration of the job to be scheduled
       * @return it returns the UUID of the scheduled job
--     * @throws Exception
       */
      @Override
      public UUID schedule(Map<String, Object> config) throws Exception {
@@@ -258,27 -302,19 +299,32 @@@
  
      /**
       * Returns the File Import Entity that stores all meta-data for the particular sub File import Job
-      *
-      * @param jobExecution the file import job details
       * @return File Import Entity
--     * @throws Exception
+      */
+     @Override
+     public FileImport getFileImportEntity(final ImportQueueMessage queueMessage) throws Exception {
+ 
+         EntityManager em = emf.getEntityManager(CpNamingUtils.MANAGEMENT_APPLICATION_ID);
+ 
+         return em.get(queueMessage.getFileId(), FileImport.class);
+     }
+ 
+ 
++    /**
++     * Returns the File Import Entity that stores all meta-data for the particular sub File import Job
++     * @return File Import Entity
 +     */
 +    @Override
 +    public FileImport getFileImportEntity(final JobExecution jobExecution) throws Exception {
 +
 +        UUID fileImportId = (UUID) jobExecution.getJobData().getProperty(FILE_IMPORT_ID);
++
 +        EntityManager em = emf.getEntityManager(CpNamingUtils.MANAGEMENT_APPLICATION_ID);
 +
 +        return em.get(fileImportId, FileImport.class);
 +    }
 +
-     /**
-      * This returns the temporary files downloaded form s3
-      */
- //    @Override
- //    public ArrayList<File> getEphemeralFile() {
- //        return files;
- //    }
+ 
      public SchedulerService getSch() {
          return sch;
      }
@@@ -557,21 -591,21 +603,33 @@@
      }
  
  
--    /**
--     * The loops through each temp file and parses it to store the entities from the json back into usergrid
--     *
--     * @throws Exception
--     */
      @Override
-     public void parseFileToEntities(JobExecution jobExecution) throws Exception {
++    // TODO: ImportService should not have to know about ImportQueueMessage
+     public void parseFileToEntities(ImportQueueMessage queueMessage) throws Exception {
  
-         logger.debug("parseFileToEntities() for job {} status {}",
-             jobExecution.getJobName(), jobExecution.getStatus().toString());
 -        logger.debug("parseFileToEntities() for job {} ",
 -            queueMessage.getFileName());
 -
 -        // add properties to the import entity
+         FileImport fileImport = getFileImportEntity(queueMessage);
 -
+         File file = new File(queueMessage.getFileName());
++        UUID targetAppId = queueMessage.getApplicationId();
++
++        parseFileToEntities( fileImport, file, targetAppId );
++    }
 +
-         // add properties to the import entity
-         FileImport fileImport = getFileImportEntity(jobExecution);
 +
++    @Override
++    // TODO: ImportService should not have to know about JobExecution
++    public void parseFileToEntities(JobExecution jobExecution) throws Exception {
++
++        FileImport fileImport = getFileImportEntity(jobExecution);
 +        File file = new File(jobExecution.getJobData().getProperty("File").toString());
++        UUID targetAppId = (UUID) jobExecution.getJobData().getProperty("applicationId");
++
++        parseFileToEntities( fileImport, file, targetAppId );
++    }
++
++
++    public void parseFileToEntities( FileImport fileImport, File file, UUID targetAppId ) throws Exception {
++
++        logger.debug("parseFileToEntities() for file {} ", file.getAbsolutePath());
  
          EntityManager emManagementApp = emf.getEntityManager(CpNamingUtils.MANAGEMENT_APPLICATION_ID);
          emManagementApp.update(fileImport);
@@@ -588,46 -622,44 +646,43 @@@
                  fileImport.setState(FileImport.State.STARTED);
                  emManagementApp.update(fileImport);
  
--                // Get target application ID from the job data (NOT from the filename)
-                 UUID targetAppId = (UUID) jobExecution.getJobData().getProperty("applicationId");
 -                UUID targetAppId = queueMessage.getApplicationId();
--
 -                if ( emManagementApp.get( targetAppId ) == null ) {
 +                if (emManagementApp.get(targetAppId) == null) {
                      throw new IllegalArgumentException("Application does not exist: " + targetAppId.toString());
                  }
 -                EntityManager targetEm = emf.getEntityManager( targetAppId );
 +                EntityManager targetEm = emf.getEntityManager(targetAppId);
                  logger.debug("   importing into app {} file {}", targetAppId.toString(), file.getAbsolutePath());
  
-                 importEntitiesFromFile(file, targetEm, emManagementApp, fileImport, jobExecution);
 -                JsonParser jp = getJsonParserForFile(file);
 -
 -                // in case of resume, retrieve the last updated UUID for this file
 -                String lastUpdatedUUID = fileImport.getLastUpdatedUUID();
 -
 -                // this handles partially completed files by updating entities from the point of failure
 -                if (!lastUpdatedUUID.equals(" ")) {
 -
 -                    // go till the last updated entity
 -                    while (!jp.getText().equals(lastUpdatedUUID)) {
 -                        jp.nextToken();
 -                    }
 -
 -                    // skip the last one and start from the next one
 -                    while (!(jp.getCurrentToken() == JsonToken.END_OBJECT
 -                            && jp.nextToken() == JsonToken.START_OBJECT)) {
 -                        jp.nextToken();
 -                    }
 -                }
++                importEntitiesFromFile(file, targetEm, emManagementApp, fileImport );
  
 -                // get to start of an object i.e next entity.
 -                while (jp.getCurrentToken() != JsonToken.START_OBJECT) {
 -                    jp.nextToken();
 -                }
 +                // TODO: fix the resume on error feature
  
 -                while (jp.nextToken() != JsonToken.END_ARRAY) {
 -                    importEntitiesFromFile(jp, targetEm, emManagementApp, fileImport);
 -                }
 -                jp.close();
 +//                // in case of resume, retrieve the last updated UUID for this file
 +//                String lastUpdatedUUID = fileImport.getLastUpdatedUUID();
 +//
 +//                // this handles partially completed files by updating entities from the point of failure
 +//                if (!lastUpdatedUUID.equals(" ")) {
 +//
 +//                    // go till the last updated entity
 +//                    while (!jp.getText().equals(lastUpdatedUUID)) {
 +//                        jp.nextToken();
 +//                    }
 +//
 +//                    // skip the last one and start from the next one
 +//                    while (!(jp.getCurrentToken() == JsonToken.END_OBJECT
 +//                        && jp.nextToken() == JsonToken.START_OBJECT)) {
 +//                        jp.nextToken();
 +//                    }
 +//                }
 +//
 +//                // get to start of an object i.e next entity.
 +//                while (jp.getCurrentToken() != JsonToken.START_OBJECT) {
 +//                    jp.nextToken();
 +//                }
 +//
 +//                while (jp.nextToken() != JsonToken.END_ARRAY) {
 +//                    importEntitiesFromFile(jp, targetEm, emManagementApp, fileImport, jobExecution);
 +//                }
 +//                jp.close();
  
                  // Updates the state of file import job
                  if (!fileImport.getState().toString().equals("FAILED")) {
@@@ -711,33 -741,26 +766,32 @@@
      }
  
  
 -
      /**
       * Imports the entity's connecting references (collections, connections and dictionaries)
 -     * @param jp  JsonParser pointing to the beginning of the object.
 -     * @param em Entity Manager for the application being imported
 -     * @param rootEm Entity manager for the root applicaition
 -     * @param fileImport the file import entity
 +     *
-      * @param jp           JsonParser pointing to the beginning of the object.
++     * @param file         The file to be imported
 +     * @param em           Entity Manager for the application being imported
 +     * @param rootEm       Entity manager for the root applicaition
-      * @param fileImport   the file import entity
-      * @param jobExecution execution details for the import jbo
++     * @param fileImport   The file import entity
       */
      private void importEntitiesFromFile(
 -        final JsonParser jp,
 +        final File file,
          final EntityManager em,
          final EntityManager rootEm,
-         final FileImport fileImport,
-         final JobExecution jobExecution) throws Exception {
+         final FileImport fileImport) throws Exception {
  
 -        final JsonParserObservable subscribe = new JsonParserObservable(jp, em, rootEm, fileImport);
  
 -        final Observable<WriteEvent> observable = Observable.create(subscribe);
 +        // first we do entities
 +        boolean entitiesOnly = true;
  
 -        // This is the action we want to perform for every UUID we receive
 +        // observable that parses JSON and emits write events
 +        JsonParser jp = getJsonParserForFile(file);
 +        final JsonEntityParserObservable jsonObservableEntities =
 +            new JsonEntityParserObservable(jp, em, rootEm, fileImport, entitiesOnly);
 +        final Observable<WriteEvent> entityEventObservable = Observable.create(jsonObservableEntities);
 +
 +        // function to execute for each write event
+         //TODO: job execution no longer needed due to having queueMessage.
          final Action1<WriteEvent> doWork = new Action1<WriteEvent>() {
              @Override
              public void call(WriteEvent writeEvent) {
@@@ -792,30 -818,6 +846,30 @@@
  
              }
          }, Schedulers.io()).toBlocking().last();
 +        jp.close();
 +
 +        logger.debug("\n\nWrote entities\n");
 +
 +        // now do other stuff: connections and dictionaries
 +        entitiesOnly = false;
 +
 +        // observable that parses JSON and emits write events
 +        jp = getJsonParserForFile(file);
 +        final JsonEntityParserObservable jsonObservableOther =
 +            new JsonEntityParserObservable(jp, em, rootEm, fileImport, entitiesOnly);
 +        final Observable<WriteEvent> otherEventObservable = Observable.create(jsonObservableOther);
 +
 +        otherEventObservable.parallel(new Func1<Observable<WriteEvent>, Observable<WriteEvent>>() {
 +            @Override
 +            public Observable<WriteEvent> call(Observable<WriteEvent> entityWrapperObservable) {
 +                return entityWrapperObservable.doOnNext(doWork);
 +
 +            }
 +        }, Schedulers.io()).toBlocking().last();
-         
++
 +        jp.close();
 +
 +        logger.debug("\n\nWrote others\n");
      }
  
  
@@@ -932,22 -927,14 +986,22 @@@
  
          // adds map to the dictionary
          @Override
-         public void doWrite(EntityManager em, JobExecution jobExecution, FileImport fileImport) {
+         public void doWrite(EntityManager em, FileImport fileImport) {
              EntityManager rootEm = emf.getEntityManager(CpNamingUtils.MANAGEMENT_APPLICATION_ID);
              try {
 +
 +                logger.debug("Adding map to {}:{} dictionary {}",
 +                    new Object[]{ownerEntityRef.getType(), ownerEntityRef.getType(), dictionaryName});
 +
                  em.addMapToDictionary(ownerEntityRef, dictionaryName, dictionary);
 +
              } catch (Exception e) {
 +                logger.error("Error writing dictionary", e);
                  fileImport.setErrorMessage(e.getMessage());
                  try {
 +
                      rootEm.update(fileImport);
 +
                  } catch (Exception ex) {
  
                      // TODO should we abort at this point?

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c652c39b/stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java
----------------------------------------------------------------------
diff --cc stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java
index 53bf144,07e0798..922c16a
--- a/stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/queues/ImportQueueListener.java
@@@ -29,11 -35,11 +35,10 @@@ import com.google.inject.Inject
  import com.google.inject.Singleton;
  
  
--/**
-- * Created by ApigeeCorporation on 1/15/15.
-- *///TODO: make sure this is properly instantiated by guice
++//TODO: make sure this is properly instantiated by guice
  @Singleton
  public class ImportQueueListener extends QueueListener {
++    
      /**
       * Initializes the QueueListener. Need to wire the factories up in guice.
       */

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c652c39b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java
----------------------------------------------------------------------
diff --cc stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java
index 742c33e,f9a0753..b9c3bb9
--- a/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java
+++ b/stack/services/src/test/java/org/apache/usergrid/management/importer/ImportServiceIT.java
@@@ -97,12 -103,12 +103,13 @@@ public class ImportServiceIT 
          applicationId = setup.getMgmtSvc().createApplication( organization.getUuid(), username+"app" ).getId();
      }
  
++
      @Before
      public void before() {
  
          boolean configured =
-                    !StringUtils.isEmpty(System.getProperty("secretKey"))
-                 && !StringUtils.isEmpty(System.getProperty("accessKey"))
+                    !StringUtils.isEmpty(System.getProperty( SDKGlobalConfiguration.SECRET_KEY_ENV_VAR))
 -                && !StringUtils.isEmpty(System.getProperty(SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR))
++                && !StringUtils.isEmpty(System.getProperty( SDKGlobalConfiguration.ACCESS_KEY_ENV_VAR))
                  && !StringUtils.isEmpty(System.getProperty("bucketName"));
  
          if ( !configured ) {
@@@ -416,7 -445,7 +439,7 @@@
          while ( !exportService.getState( exportUUID ).equals( "FINISHED" ) ) {
              ;
          }
--        //TODo: can check if the temp files got created
++        //TODO: can check if the temp files got created
  
          // import
          S3Import s3Import = new S3ImportImpl();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c652c39b/stack/services/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --cc stack/services/src/test/resources/log4j.properties
index 3ef4d3b,3ef4d3b..a63d719
--- a/stack/services/src/test/resources/log4j.properties
+++ b/stack/services/src/test/resources/log4j.properties
@@@ -57,6 -57,6 +57,7 @@@ log4j.logger.org.apache.usergrid.lockin
  #log4j.logger.org.apache.usergrid.corepersistence=DEBUG
  
  #log4j.logger.org.apache.usergrid.persistence.index=DEBUG
++#log4j.logger.org.apache.usergrid.batch=DEBUG
  log4j.logger.org.apache.usergrid.management.export=DEBUG
  log4j.logger.org.apache.usergrid.management.importer=DEBUG