Skip to content

Commit

Permalink
Better exception messages when records are not found.
Browse files Browse the repository at this point in the history
Conflicts:

	kernel/src/main/java/org/neo4j/kernel/impl/nioneo/store/AbstractNameStore.java
  • Loading branch information
thobe committed Jan 29, 2012
1 parent c8f2fac commit 4f55936
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Expand Up @@ -403,7 +403,7 @@ private DynamicRecord getRecord( long blockId, PersistenceWindow window, RecordL
boolean inUse = inUseByte == Record.IN_USE.intValue();
if ( !inUse && load != RecordLoad.FORCE )
{
throw new InvalidRecordException( "Not in use, blockId[" + blockId + "]" );
throw new InvalidRecordException( "DynamicRecord Not in use, blockId[" + blockId + "]" );
}
int dataSize = getBlockSize() - BLOCK_HEADER_SIZE;

Expand Down Expand Up @@ -461,7 +461,7 @@ public DynamicRecord forceGetRecord( long id )
{
return new DynamicRecord( id );
}

try
{
return getRecord( id, window, RecordLoad.FORCE );
Expand All @@ -471,7 +471,7 @@ public DynamicRecord forceGetRecord( long id )
releaseWindow( window );
}
}

@Override
public DynamicRecord forceGetRaw( long id )
{
Expand Down Expand Up @@ -652,10 +652,10 @@ public void logIdUsage( StringLogger logger )
{
NeoStore.logIdUsage( logger, this );
}

@Override
public String toString()
{
return super.toString() + "[blockSize:" + (getRecordSize()-getRecordHeaderSize()) + "]";
return super.toString() + "[blockSize:" + (getRecordSize()-getRecordHeaderSize()) + "]";
}
}
Expand Up @@ -113,7 +113,7 @@ public NodeRecord forceGetRecord( long id )
{
return new NodeRecord( id ); // inUse=false by default
}

try
{
return getRecord( id, window, RecordLoad.FORCE );
Expand All @@ -123,7 +123,7 @@ public NodeRecord forceGetRecord( long id )
releaseWindow( window );
}
}

@Override
public NodeRecord forceGetRaw( long id )
{
Expand Down Expand Up @@ -218,7 +218,7 @@ private NodeRecord getRecord( long id, PersistenceWindow window,
switch ( load )
{
case NORMAL:
throw new InvalidRecordException( "Record[" + id + "] not in use" );
throw new InvalidRecordException( "NodeRecord[" + id + "] not in use" );
case CHECK:
return null;
}
Expand Down
Expand Up @@ -19,9 +19,6 @@
*/
package org.neo4j.kernel.impl.nioneo.store;

import static org.neo4j.kernel.Config.ARRAY_BLOCK_SIZE;
import static org.neo4j.kernel.Config.STRING_BLOCK_SIZE;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
Expand All @@ -37,6 +34,9 @@
import org.neo4j.kernel.IdType;
import org.neo4j.kernel.impl.util.StringLogger;

import static org.neo4j.kernel.Config.ARRAY_BLOCK_SIZE;
import static org.neo4j.kernel.Config.STRING_BLOCK_SIZE;

/**
* Implementation of the property store. This implementation has two dynamic
* stores. One used to store keys and another for string property values.
Expand Down Expand Up @@ -495,7 +495,7 @@ private PropertyRecord getRecord( long id, PersistenceWindow window, RecordLoad
PropertyRecord toReturn = getRecordFromBuffer( id, buffer );
if ( !toReturn.inUse() && load != RecordLoad.FORCE )
{
throw new InvalidRecordException( "Record[" + id + "] not in use" );
throw new InvalidRecordException( "PropertyRecord[" + id + "] not in use" );
}
return toReturn;
}
Expand Down
Expand Up @@ -119,7 +119,7 @@ public RelationshipRecord forceGetRecord( long id )
{
return new RelationshipRecord( id, -1, -1, -1 );
}

try
{
return getRecord( id, window, RecordLoad.FORCE );
Expand Down Expand Up @@ -274,7 +274,7 @@ private RelationshipRecord getRecord( long id, PersistenceWindow window,
switch ( load )
{
case NORMAL:
throw new InvalidRecordException( "Record[" + id + "] not in use" );
throw new InvalidRecordException( "RelationshipRecord[" + id + "] not in use" );
case CHECK:
return null;
}
Expand Down

0 comments on commit 4f55936

Please sign in to comment.