Skip to content

Commit

Permalink
Removed minor old IndexDescriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
fickludd authored and chrisvest committed Feb 14, 2017
1 parent d15a94c commit 8fbaa3b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
Expand Up @@ -35,6 +35,8 @@
import org.neo4j.kernel.api.schema.IndexDescriptor;
import org.neo4j.kernel.api.schema.IndexDescriptorFactory;
import org.neo4j.kernel.api.index.IndexUpdater;
import org.neo4j.kernel.api.schema_new.index.IndexBoundary;
import org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor;
import org.neo4j.kernel.impl.store.MultipleUnderlyingStorageExceptions;
import org.neo4j.kernel.impl.store.UnderlyingStorageException;

Expand Down Expand Up @@ -93,7 +95,7 @@ IndexUpdater getUpdater( IndexDescriptor descriptor )
@Override
public void close() throws UnderlyingStorageException
{
Set<Pair<IndexDescriptor, UnderlyingStorageException>> exceptions = null;
Set<Pair<NewIndexDescriptor, UnderlyingStorageException>> exceptions = null;

for ( Map.Entry<IndexDescriptor, IndexUpdater> updaterEntry : updaterMap.entrySet() )
{
Expand All @@ -108,7 +110,8 @@ public void close() throws UnderlyingStorageException
{
exceptions = new HashSet<>();
}
exceptions.add( Pair.of( updaterEntry.getKey(), new UnderlyingStorageException( e ) ) );
exceptions.add( Pair.of( IndexBoundary.map( updaterEntry.getKey() ),
new UnderlyingStorageException( e ) ) );
}
}

Expand Down
Expand Up @@ -23,31 +23,31 @@
import java.util.Set;

import org.neo4j.helpers.collection.Pair;
import org.neo4j.kernel.api.schema.IndexDescriptor;
import org.neo4j.kernel.api.schema_new.index.NewIndexDescriptor;

import static java.lang.String.format;

public class MultipleUnderlyingStorageExceptions extends UnderlyingStorageException
{
public final Set<Pair<IndexDescriptor, UnderlyingStorageException>> exceptions;
public final Set<Pair<NewIndexDescriptor, UnderlyingStorageException>> exceptions;

public MultipleUnderlyingStorageExceptions( Set<Pair<IndexDescriptor, UnderlyingStorageException>> exceptions )
public MultipleUnderlyingStorageExceptions( Set<Pair<NewIndexDescriptor, UnderlyingStorageException>> exceptions )
{
super( buildMessage( exceptions ) );
this.exceptions = Collections.unmodifiableSet( exceptions );

for ( Pair<IndexDescriptor, UnderlyingStorageException> exception : exceptions )
for ( Pair<NewIndexDescriptor, UnderlyingStorageException> exception : exceptions )
{
this.addSuppressed( exception.other() );
}
}

private static String buildMessage( Set<Pair<IndexDescriptor, UnderlyingStorageException>> exceptions )
private static String buildMessage( Set<Pair<NewIndexDescriptor, UnderlyingStorageException>> exceptions )
{
StringBuilder builder = new StringBuilder( );
builder.append("Errors when closing (flushing) index updaters:");

for ( Pair<IndexDescriptor, UnderlyingStorageException> pair : exceptions )
for ( Pair<NewIndexDescriptor, UnderlyingStorageException> pair : exceptions )
{
builder.append( format( " (%s) %s", pair.first().toString(), pair.other().getMessage() ) );
}
Expand Down
Expand Up @@ -23,10 +23,6 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.neo4j.kernel.api.schema.NodeMultiPropertyDescriptor;
import org.neo4j.kernel.api.schema.NodePropertyDescriptor;
import org.neo4j.kernel.api.schema.IndexDescriptor;
import org.neo4j.kernel.api.schema.IndexDescriptorFactory;
import org.neo4j.kernel.impl.store.counts.keys.CountsKey;
import org.neo4j.kernel.impl.store.counts.keys.CountsKeyType;
import org.neo4j.kernel.impl.transaction.log.ReadableClosableChannel;
Expand All @@ -50,7 +46,6 @@ public static CountsSnapshot deserialize( ReadableClosableChannel channel ) thro
for ( int i = 0; i < size; i++ )
{
CountsKeyType type = value( channel.get() );
IndexDescriptor descriptor;
switch ( type )
{
case ENTITY_NODE:
Expand Down
Expand Up @@ -21,7 +21,6 @@

import java.io.IOException;

import org.neo4j.kernel.api.schema.IndexDescriptor;
import org.neo4j.kernel.impl.api.CountsAccessor;
import org.neo4j.kernel.impl.store.UnderlyingStorageException;
import org.neo4j.kernel.impl.store.counts.keys.CountsKey;
Expand Down Expand Up @@ -95,7 +94,7 @@ public void incrementRelationshipCount( int startLabelId, int typeId, int endLab
* u - number of updates
* s - size of index
* </pre>
* For key format, see {@link KeyFormat#visitIndexStatistics(IndexDescriptor, long, long)}
* For key format, see {@link KeyFormat#visitIndexStatistics(long, long, long)}
*/
@Override
public void replaceIndexUpdateAndSize( long indexId, long updates, long size )
Expand All @@ -118,7 +117,7 @@ public void replaceIndexUpdateAndSize( long indexId, long updates, long size )
* u - number of unique values
* s - size of index
* </pre>
* For key format, see {@link KeyFormat#visitIndexSample(IndexDescriptor, long, long)}
* For key format, see {@link KeyFormat#visitIndexSample(long, long, long)}
*/
@Override
public void replaceIndexSample( long indexId, long unique, long size )
Expand All @@ -134,7 +133,7 @@ public void replaceIndexSample( long indexId, long unique, long size )
}

/**
* For key format, see {@link KeyFormat#visitIndexStatistics(IndexDescriptor, long, long)}
* For key format, see {@link KeyFormat#visitIndexStatistics(long, long, long)}
* For value format, see {@link CountsUpdater#replaceIndexUpdateAndSize(long, long, long)}
*/
@Override
Expand Down

0 comments on commit 8fbaa3b

Please sign in to comment.