Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
ragadeeshu committed May 21, 2018
1 parent aa7ef22 commit 58c04f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Expand Up @@ -63,7 +63,7 @@ IndexProxy createPopulatingIndexProxy( final StoreIndexDescriptor descriptor, fi

final String indexUserDescription = indexUserDescription( descriptor );
IndexPopulator populator = populatorFromProvider( descriptor, samplingConfig );
CapableIndexDescriptor capableIndexDescriptor = indexMetaFromProvider( descriptor );
CapableIndexDescriptor capableIndexDescriptor = descriptor.withCapabilities( providerMap );

FailedIndexProxyFactory failureDelegateFactory = new FailedPopulatingIndexProxyFactory( capableIndexDescriptor,
populator,
Expand Down Expand Up @@ -96,7 +96,7 @@ IndexProxy createPopulatingIndexProxy( final StoreIndexDescriptor descriptor, fi

IndexProxy createRecoveringIndexProxy( StoreIndexDescriptor descriptor )
{
CapableIndexDescriptor capableIndexDescriptor = indexMetaFromProvider( descriptor );
CapableIndexDescriptor capableIndexDescriptor = descriptor.withCapabilities( providerMap );
IndexProxy proxy = new RecoveringIndexProxy( capableIndexDescriptor );
return new ContractCheckingIndexProxy( proxy, true );
}
Expand All @@ -106,7 +106,7 @@ IndexProxy createOnlineIndexProxy( StoreIndexDescriptor descriptor )
try
{
IndexAccessor onlineAccessor = onlineAccessorFromProvider( descriptor, samplingConfig );
CapableIndexDescriptor capableIndexDescriptor = indexMetaFromProvider( descriptor );
CapableIndexDescriptor capableIndexDescriptor = descriptor.withCapabilities( providerMap );
IndexProxy proxy;
proxy = new OnlineIndexProxy( capableIndexDescriptor, onlineAccessor, storeView, false );
proxy = new ContractCheckingIndexProxy( proxy, true );
Expand All @@ -124,7 +124,7 @@ IndexProxy createOnlineIndexProxy( StoreIndexDescriptor descriptor )
IndexProxy createFailedIndexProxy( StoreIndexDescriptor descriptor, IndexPopulationFailure populationFailure )
{
IndexPopulator indexPopulator = populatorFromProvider( descriptor, samplingConfig );
CapableIndexDescriptor capableIndexDescriptor = indexMetaFromProvider( descriptor );
CapableIndexDescriptor capableIndexDescriptor = descriptor.withCapabilities( providerMap );
String indexUserDescription = indexUserDescription( descriptor );
IndexProxy proxy;
proxy = new FailedIndexProxy( capableIndexDescriptor,
Expand Down Expand Up @@ -154,9 +154,4 @@ private IndexAccessor onlineAccessorFromProvider( StoreIndexDescriptor descripto
IndexProvider indexProvider = providerMap.lookup( descriptor.providerDescriptor() );
return indexProvider.getOnlineAccessor( descriptor, samplingConfig );
}

private CapableIndexDescriptor indexMetaFromProvider( StoreIndexDescriptor indexDescriptor )
{
return indexDescriptor.withCapabilities( providerMap );
}
}
Expand Up @@ -259,9 +259,7 @@ private IndexReference getOrCreateUniquenessConstraintIndex( SchemaRead schemaRe
public IndexDescriptor createConstraintIndex( final SchemaDescriptor schema, Optional<String> provider )
{
try ( Session session = kernelSupplier.get().beginSession( AUTH_DISABLED );
Transaction transaction = session.beginTransaction( Transaction.Type.implicit );
//TODO remove statement?
Statement ignore = ((KernelTransaction)transaction).acquireStatement() )
Transaction transaction = session.beginTransaction( Transaction.Type.implicit ) )
{
IndexDescriptor index = ((KernelTransaction) transaction).indexUniqueCreate( schema, provider );
transaction.success();
Expand Down

0 comments on commit 58c04f3

Please sign in to comment.