Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Fixes remnant bugs from merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Nine committed Feb 16, 2015
1 parent c75b7a9 commit 4d5e5e6
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
Expand Up @@ -44,7 +44,7 @@
/**
* Guice Module that encapsulates Core Persistence.
*/
public class GuiceModule extends AbstractModule {
public class CoreModule extends AbstractModule {

/**
* TODO this is a circular dependency, and should be refactored
Expand All @@ -55,7 +55,7 @@ public class GuiceModule extends AbstractModule {



public GuiceModule( final ApplicationContext context ) {
public CoreModule( final ApplicationContext context ) {
this.lazyEntityManagerFactoryProvider = new LazyEntityManagerFactoryProvider( context );
}

Expand Down
Expand Up @@ -134,7 +134,7 @@ public Injector getObject() throws Exception {
}

//this is seriously fugly, and needs removed
injector = Guice.createInjector( new GuiceModule( applicationContext ) );
injector = Guice.createInjector( new CoreModule( applicationContext ) );

return injector;
}
Expand Down
Expand Up @@ -59,7 +59,7 @@

import net.jcip.annotations.NotThreadSafe;

import static org.apache.usergrid.corepersistence.GuiceModule.EVENTS_DISABLED;
import static org.apache.usergrid.corepersistence.CoreModule.EVENTS_DISABLED;
import static org.apache.usergrid.corepersistence.util.CpNamingUtils.getCollectionScopeNameFromEntityType;
import static org.apache.usergrid.persistence.Schema.TYPE_APPLICATION;
import static org.junit.Assert.assertEquals;
Expand Down
Expand Up @@ -98,7 +98,7 @@ public class EsEntityIndexBatchImpl implements EntityIndexBatch {
private final AliasedEntityIndex entityIndex;


public EsEntityIndexBatchImpl( final ApplicationScope applicationScope, final Client client,
public EsEntityIndexBatchImpl( final ApplicationScope applicationScope, final Client client,
final IndexFig config, final int autoFlushSize, final FailureMonitor failureMonitor, final AliasedEntityIndex entityIndex ) {

this.applicationScope = applicationScope;
Expand All @@ -118,6 +118,7 @@ public EntityIndexBatch index( final IndexScope indexScope, final Entity entity


IndexValidationUtils.validateIndexScope( indexScope );
ValidationUtils.verifyEntityWrite( entity );

final String context = createContextName( indexScope );
final String entityType = entity.getId().getType();
Expand Down Expand Up @@ -167,15 +168,15 @@ public EntityIndexBatch deindex( final IndexScope indexScope, final Id id, final


if ( log.isDebugEnabled() ) {
log.debug( "De-indexing entity {}:{} in scope\n app {}\n owner {}\n "
log.debug( "De-indexing entity {}:{} in scope\n app {}\n owner {}\n "
+ "name {} context{}, type {},",
new Object[] {
id.getType(),
id.getUuid(),
applicationScope.getApplication(),
id.getType(),
id.getUuid(),
applicationScope.getApplication(),
indexScope.getOwner(),
indexScope.getName(),
context,
indexScope.getName(),
context,
entityType
} );
}
Expand Down Expand Up @@ -257,7 +258,7 @@ private void execute( final BulkRequestBuilder request ) {

for ( BulkItemResponse response : responses ) {
if ( response.isFailed() ) {
throw new RuntimeException( "Unable to index documents. Errors are :"
throw new RuntimeException( "Unable to index documents. Errors are :"
+ response.getFailure().getMessage() );
}
}
Expand Down Expand Up @@ -294,7 +295,7 @@ private static Map entityToMap( final Entity entity, final String context ) {
//add the context for filtering later
entityMap.put( ENTITY_CONTEXT_FIELDNAME, context );

//but the fieldname we have to prefix because we use query equality to seek this later.
//but the fieldname we have to prefix because we use query equality to seek this later.
// TODO see if we can make this more declarative
entityMap.put( ENTITYID_ID_FIELDNAME, IndexingUtils.idString(entity.getId()).toLowerCase());

Expand All @@ -321,7 +322,7 @@ private static Map entityToMap( EntityObject entity ) {

if ( f instanceof ListField ) {
List list = ( List ) field.getValue();
entityMap.put( field.getName().toLowerCase(),
entityMap.put( field.getName().toLowerCase(),
new ArrayList( processCollectionForMap( list ) ) );

if ( !list.isEmpty() ) {
Expand All @@ -333,12 +334,12 @@ private static Map entityToMap( EntityObject entity ) {
}
else if ( f instanceof ArrayField ) {
List list = ( List ) field.getValue();
entityMap.put( field.getName().toLowerCase(),
entityMap.put( field.getName().toLowerCase(),
new ArrayList( processCollectionForMap( list ) ) );
}
else if ( f instanceof SetField ) {
Set set = ( Set ) field.getValue();
entityMap.put( field.getName().toLowerCase(),
entityMap.put( field.getName().toLowerCase(),
new ArrayList( processCollectionForMap( set ) ) );
}
else if ( f instanceof EntityObjectField ) {
Expand All @@ -362,8 +363,8 @@ else if ( f instanceof LocationField ) {
locMap.put( "lon", locField.getValue().getLongitude() );
entityMap.put( GEO_PREFIX + field.getName().toLowerCase(), locMap );
}
else if ( f instanceof DoubleField
|| f instanceof FloatField
else if ( f instanceof DoubleField
|| f instanceof FloatField
|| f instanceof IntegerField
|| f instanceof LongField ) {

Expand Down
1 change: 1 addition & 0 deletions stack/pom.xml
Expand Up @@ -126,6 +126,7 @@
<metrics.version>3.0.0</metrics.version>
<rx.version>0.19.6</rx.version>
<surefire.plugin.version>2.18.1</surefire.plugin.version>
<powermock.version>1.6.1</powermock.version>
</properties>

<licenses>
Expand Down
Expand Up @@ -54,6 +54,7 @@
import org.apache.usergrid.persistence.SimpleEntityRef;
import org.apache.usergrid.persistence.entities.JobData;
import org.apache.usergrid.persistence.index.impl.ElasticSearchResource;
import org.apache.usergrid.setup.ConcurrentProcessSingleton;

import com.amazonaws.SDKGlobalConfiguration;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -102,9 +103,10 @@ public void setup() throws Exception {
logger.info("in setup");

// start the scheduler after we're all set up
JobSchedulerService jobScheduler = ConcurrentSasdfasdf.getBean( JobSchedulerService.class );
JobSchedulerService jobScheduler = ConcurrentProcessSingleton.getInstance().getSpringResource().getBean( JobSchedulerService.class );
if ( jobScheduler.state() != Service.State.RUNNING ) {
jobScheduler.startAndWait();
jobScheduler.startAsync();
jobScheduler.awaitRunning();
}

adminUser = newOrgAppAdminRule.getAdminInfo();
Expand Down Expand Up @@ -184,9 +186,8 @@ public void testConnectionsOnCollectionExport() throws Exception {
entity[i] = em.create( "users", userProperties );
}
//creates connections
em.createConnection(
em.get( new SimpleEntityRef( "user", entity[0].getUuid()) ), "Vibrations",
em.get( new SimpleEntityRef( "user", entity[1].getUuid()) ) );
em.createConnection( em.get( new SimpleEntityRef( "user", entity[0].getUuid() ) ), "Vibrations",
em.get( new SimpleEntityRef( "user", entity[1].getUuid() ) ) );
em.createConnection(
em.get( new SimpleEntityRef( "user", entity[1].getUuid()) ), "Vibrations",
em.get( new SimpleEntityRef( "user", entity[0].getUuid()) ) );
Expand Down Expand Up @@ -240,7 +241,7 @@ public void testConnectionsOnApplicationEndpoint() throws Exception {
ExportService exportService = setup.getExportService();

String appName = newOrgAppAdminRule.getApplicationInfo().getName();
HashMap<String, Object> payload = payloadBuilder(appName);
HashMap<String, Object> payload = payloadBuilder( appName );

payload.put( "organizationId", organization.getUuid() );
payload.put( "applicationId", applicationId );
Expand All @@ -262,9 +263,8 @@ public void testConnectionsOnApplicationEndpoint() throws Exception {
}
em.refreshIndex();
//creates connections
em.createConnection(
em.get( new SimpleEntityRef( "user", entity[0].getUuid())), "Vibrations",
em.get( new SimpleEntityRef( "user", entity[1].getUuid())) );
em.createConnection( em.get( new SimpleEntityRef( "user", entity[0].getUuid() ) ), "Vibrations",
em.get( new SimpleEntityRef( "user", entity[1].getUuid() ) ) );
em.createConnection(
em.get( new SimpleEntityRef( "user", entity[1].getUuid())), "Vibrations",
em.get( new SimpleEntityRef( "user", entity[0].getUuid())) );
Expand Down Expand Up @@ -685,7 +685,7 @@ public void testExportOneOrganization() throws Exception {
org.json.simple.JSONArray a = ( org.json.simple.JSONArray )
parser.parse( new FileReader( exportedFile ) );

assertEquals(23, a.size());
assertEquals( 23, a.size() );
}


Expand Down Expand Up @@ -1009,16 +1009,14 @@ public void testIntegration100EntitiesOnOneOrg() throws Exception {
BlobStore blobStore = null;

try {
final Iterable<? extends Module> MODULES = ImmutableSet.of(
new JavaUrlHttpCommandExecutorServiceModule(),
new Log4JLoggingModule(),
new NettyPayloadModule() );
final Iterable<? extends Module> MODULES = ImmutableSet.of( new JavaUrlHttpCommandExecutorServiceModule(),
new Log4JLoggingModule(), new NettyPayloadModule() );

BlobStoreContext context = ContextBuilder.newBuilder( "s3" )
.credentials(accessId, secretKey )
.modules(MODULES )
.overrides(overrides )
.buildView(BlobStoreContext.class );
.credentials( accessId, secretKey )
.modules( MODULES )
.overrides( overrides )
.buildView( BlobStoreContext.class );

String expectedFileName = ((ExportServiceImpl)exportService)
.prepareOutputFileName(organization.getName(), "applications");
Expand Down

0 comments on commit 4d5e5e6

Please sign in to comment.