Unnamed: 0
int64 0
6.7k
| func
stringlengths 12
89.6k
| target
bool 2
classes | project
stringlengths 45
151
|
|---|---|---|---|
6,300
|
public interface PropertyAccessor
{
Property getProperty( long nodeId, int propertyKeyId ) throws EntityNotFoundException, PropertyNotFoundException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_api_index_PropertyAccessor.java
|
6,301
|
public enum TestValue
{
BOOLEAN_TRUE( true ),
BOOLEAN_FALSE( false ),
STRING_TRUE( "true" ),
STRING_FALSE( "false" ),
STRING_UPPER_A( "A" ),
STRING_LOWER_A( "a" ),
CHAR_UPPER_A( 'B' ),
CHAR_LOWER_A( 'b' ),
INT_42( 42 ),
LONG_42( (long) 43 ),
LARGE_LONG_1( 4611686018427387905l ),
LARGE_LONG_2( 4611686018427387907l ),
BYTE_42( (byte) 44 ),
DOUBLE_42( (double) 41 ),
DOUBLE_42andAHalf( 42.5d ),
SHORT_42( (short) 45 ),
FLOAT_42( (float) 46 ),
FLOAT_42andAHalf( 41.5f ),
ARRAY_OF_INTS( new int[]{1, 2, 3} ),
ARRAY_OF_LONGS( new long[]{4, 5, 6} ),
ARRAY_OF_LARGE_LONGS_1( new long[] { 4611686018427387905l } ),
ARRAY_OF_LARGE_LONGS_2( new long[] { 4611686018427387906l } ),
ARRAY_OF_LARGE_LONGS_3( new Long[] { 4611686018425387907l } ),
ARRAY_OF_LARGE_LONGS_4( new Long[] { 4611686018425387908l } ),
ARRAY_OF_BOOL_LIKE_STRING( new String[]{"true", "false", "true"} ),
ARRAY_OF_BOOLS( new boolean[]{true, false, true} ),
ARRAY_OF_DOUBLES( new double[]{7, 8, 9} ),
ARRAY_OF_STRING( new String[]{"a", "b", "c"} ),
EMPTY_ARRAY_OF_STRING( new String[0] ),
ONE( new String[]{"", "||"} ),
OTHER( new String[]{"||", ""} ),
ANOTHER_ARRAY_OF_STRING( new String[]{"1|2|3"} ),
ARRAY_OF_CHAR( new char[]{'d', 'e', 'f'} );
private final Object value;
private TestValue( Object value )
{
this.value = value;
}
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_api_index_SchemaConstraintProviderApprovalTest.java
|
6,302
|
public enum TestValue
{
BOOLEAN_TRUE( true ),
BOOLEAN_FALSE( false ),
STRING_TRUE( "true" ),
STRING_FALSE( "false" ),
STRING_UPPER_A( "A" ),
STRING_LOWER_A( "a" ),
CHAR_UPPER_A( 'A' ),
CHAR_LOWER_A( 'a' ),
INT_42( 42 ),
LONG_42( (long) 42 ),
LARGE_LONG_1( 4611686018427387905l ),
LARGE_LONG_2( 4611686018427387907l ),
BYTE_42( (byte) 42 ),
DOUBLE_42( (double) 42 ),
DOUBLE_42andAHalf( 42.5d ),
SHORT_42( (short) 42 ),
FLOAT_42( (float) 42 ),
FLOAT_42andAHalf( 42.5f ),
ARRAY_OF_INTS( new int[]{1, 2, 3} ),
ARRAY_OF_LONGS( new long[]{1, 2, 3} ),
ARRAY_OF_LARGE_LONGS_1( new long[] { 4611686018427387905l } ),
ARRAY_OF_LARGE_LONGS_2( new long[] { 4611686018427387906l } ),
ARRAY_OF_LARGE_LONGS_3( new Long[] { 4611686018425387907l } ),
ARRAY_OF_LARGE_LONGS_4( new Long[] { 4611686018425387908l } ),
ARRAY_OF_BOOL_LIKE_STRING( new String[]{"true", "false", "true"} ),
ARRAY_OF_BOOLS( new boolean[]{true, false, true} ),
ARRAY_OF_DOUBLES( new double[]{1, 2, 3} ),
ARRAY_OF_STRING( new String[]{"1", "2", "3"} ),
EMPTY_ARRAY_OF_INTS( new int[0] ),
EMPTY_ARRAY_OF_LONGS( new long[0] ),
EMPTY_ARRAY_OF_BOOLS( new boolean[0] ),
EMPTY_ARRAY_OF_DOUBLES( new double[0] ),
EMPTY_ARRAY_OF_STRING( new String[0] ),
ONE( new String[]{"", "||"} ),
OTHER( new String[]{"||", ""} ),
ANOTHER_ARRAY_OF_STRING( new String[]{"1|2|3"} ),
ARRAY_OF_CHAR( new char[]{'1', '2', '3'} );
private final Object value;
private TestValue( Object value )
{
this.value = value;
}
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_api_index_SchemaIndexProviderApprovalTest.java
|
6,303
|
public static interface NoDeps {
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_api_index_UniqueConstraintCompatibility.java
|
6,304
|
public interface LabelScanReader
{
PrimitiveLongIterator nodesWithLabel( int labelId );
Iterator<Long> labelsForNode( long nodeId );
void close();
LabelScanReader EMPTY = new LabelScanReader()
{
@Override
public PrimitiveLongIterator nodesWithLabel( int labelId )
{
return emptyPrimitiveLongIterator();
}
@Override
public Iterator<Long> labelsForNode( long nodeId )
{
return emptyIterator();
}
@Override
public void close()
{ // Nothing to close
}
};
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_api_labelscan_LabelScanReader.java
|
6,305
|
public interface LabelScanStore extends Lifecycle
{
/**
* From the point a {@link LabelScanReader} is created till it's {@link LabelScanReader#close() closed} the contents it
* returns cannot change, i.e. it honors repeatable reads.
*
* @return a {@link LabelScanReader} capable of retrieving nodes for labels.
*/
LabelScanReader newReader();
/**
* Acquire a writer for updating the store.
*/
LabelScanWriter newWriter();
/**
* Recover updates the store with a stream of updates of label->node mappings. Done during the recovery
* phase of the database startup. Updates here may contain duplicates with what's already in the store
* so extra care needs to be taken to ensure correctness after these updates.
*
* @param updates the updates to store.
* @throws IOException if there was a problem updating the store.
*/
void recover( Iterator<NodeLabelUpdate> updates ) throws IOException;
/**
* Forces all changes to disk. Called at certain points from within Neo4j for example when
* rotating the logical log. After completion of this call there cannot be any essential state that
* hasn't been forced to disk.
*
* @throws UnderlyingStorageException if there was a problem forcing the state to persistent storage.
*/
void force() throws UnderlyingStorageException;
AllEntriesLabelScanReader newAllEntriesReader();
ResourceIterator<File> snapshotStoreFiles() throws IOException;
/**
* Initializes the store. After this has been called recovery updates can be processed.
*/
@Override
void init() throws IOException;
/**
* Starts the store. After this has been called updates can be processed.
*/
@Override
void start() throws IOException;
@Override
void stop() throws IOException;
/**
* Shuts down the store and all resources acquired by it.
*/
@Override
void shutdown() throws IOException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_api_labelscan_LabelScanStore.java
|
6,306
|
private enum Type
{
INT
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (int[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof int[] && Arrays.equals( (int[]) array1, (int[]) array2 );
}
@Override
Object clone( Object array )
{
return ((int[])array).clone();
}
},
LONG
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (long[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof long[] && Arrays.equals( (long[]) array1, (long[]) array2 );
}
@Override
Object clone( Object array )
{
return ((long[])array).clone();
}
},
BOOLEAN
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (boolean[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof boolean[] && Arrays.equals( (boolean[]) array1, (boolean[]) array2 );
}
@Override
Object clone( Object array )
{
return ((boolean[])array).clone();
}
},
BYTE
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (byte[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof byte[] && Arrays.equals( (byte[]) array1, (byte[]) array2 );
}
@Override
Object clone( Object array )
{
return ((byte[])array).clone();
}
},
DOUBLE
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (double[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof double[] && Arrays.equals( (double[]) array1, (double[]) array2 );
}
@Override
Object clone( Object array )
{
return ((double[])array).clone();
}
},
STRING
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (String[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof String[] && Arrays.equals( (String[]) array1, (String[]) array2 );
}
@Override
Object clone( Object array )
{
return ((String[])array).clone();
}
},
SHORT
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (short[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof short[] && Arrays.equals( (short[]) array1, (short[]) array2 );
}
@Override
Object clone( Object array )
{
return ((short[])array).clone();
}
},
CHAR
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (char[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof char[] && Arrays.equals( (char[]) array1, (char[]) array2 );
}
@Override
Object clone( Object array )
{
return ((char[])array).clone();
}
},
FLOAT
{
@Override
int hashCode( Object array )
{
return Arrays.hashCode( (float[]) array );
}
@Override
boolean equals( Object array1, Object array2 )
{
return array2 instanceof float[] && Arrays.equals( (float[]) array1, (float[]) array2 );
}
@Override
Object clone( Object array )
{
return ((float[])array).clone();
}
};
abstract int hashCode( Object array );
abstract boolean equals( Object array1, Object array2 );
abstract Object clone( Object array );
public static Type from( Object array )
{
if ( !array.getClass().isArray() )
{
throw new IllegalArgumentException( array + " is not an array, it's a " + array.getClass() );
}
if ( array instanceof int[] )
{
return INT;
}
if ( array instanceof long[] )
{
return LONG;
}
if ( array instanceof boolean[] )
{
return BOOLEAN;
}
if ( array instanceof byte[] )
{
return BYTE;
}
if ( array instanceof double[] )
{
return DOUBLE;
}
if ( array instanceof String[] )
{
return STRING;
}
if ( array instanceof short[] )
{
return SHORT;
}
if ( array instanceof char[] )
{
return CHAR;
}
if ( array instanceof float[] )
{
return FLOAT;
}
throw new IllegalArgumentException( "Unrecognized array type " + array.getClass().getComponentType() );
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_api_properties_LazyArrayProperty.java
|
6,307
|
public interface Migration
{
boolean appliesTo(Map<String, String> rawConfiguration);
Map<String, String> apply(Map<String, String> rawConfiguration);
String getDeprecationMessage();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_configuration_BaseConfigurationMigrator.java
|
6,308
|
public interface ConfigParam
{
/**
* Add the configuration parameter(s) of this object to the specified map.
*
* @param config the map to add the parameter(s) of this object to.
*/
void configure( Map<String, String> config );
/**
* Utility for converting {@link ConfigParam} objects to a Map of configuration parameter.s
*
* @author Tobias Lindaaker <tobias.lindaaker@neotechnology.com>
*/
final class Conversion
{
/**
* Create a new configuration map from a set of {@link ConfigParam} objects.
*
* @param params the parameters to add to the map.
* @return a map containing the specified configuration parameters.
*/
public static Map<String, String> create( ConfigParam... params )
{
return update( new HashMap<String, String>(), params );
}
/**
* Updates a configuration map with the specified configuration parameters.
*
* @param config the map to update.
* @param params the configuration parameters to update the map with.
* @return the same configuration map as passed in.
*/
public static Map<String, String> update( Map<String, String> config, ConfigParam... params )
{
if ( params != null ) for ( ConfigParam param : params )
if ( param != null ) param.configure( config );
return config;
}
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_configuration_ConfigParam.java
|
6,309
|
public interface ConfigurationChangeListener
{
void notifyConfigurationChanges( Iterable<ConfigurationChange> change );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_configuration_ConfigurationChangeListener.java
|
6,310
|
public interface ConfigurationMigrator
{
Map<String, String> apply(Map<String, String> rawConfiguration, StringLogger log);
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_configuration_ConfigurationMigrator.java
|
6,311
|
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.TYPE)
public @interface ConfigurationPrefix
{
String value();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_configuration_ConfigurationPrefix.java
|
6,312
|
public interface HasSettings
{
/**
* Get a class that defines settings using static fields.
* See {@link org.neo4j.graphdb.factory.GraphDatabaseSettings}
* for an example.
*
* @return a class or null if no settings are needed
*/
Class getSettingsClass();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_configuration_HasSettings.java
|
6,313
|
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.FIELD )
public @interface Migrator {
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_configuration_Migrator.java
|
6,314
|
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.FIELD )
public @interface Title
{
String value();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_configuration_Title.java
|
6,315
|
public interface KernelExtensionListener
{
class Adapter implements KernelExtensionListener
{
@Override
public void startedKernelExtension( Object extension )
{
}
@Override
public void stoppingKernelExtension( Object extension )
{
}
}
void startedKernelExtension( Object extension );
void stoppingKernelExtension( Object extension );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_extension_KernelExtensionListener.java
|
6,316
|
public interface UnsatisfiedDependencyStrategy
{
void handle( KernelExtensionFactory kernelExtensionFactory, UnsatisfiedDepencyException e );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_extension_UnsatisfiedDependencyStrategy.java
|
6,317
|
public interface GuardInternal
{
void check();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_guard_Guard.java
|
6,318
|
public enum BranchedDataPolicy
{
keep_all
{
@Override
public void handle( File storeDir ) throws IOException
{
moveAwayDb( storeDir, newBranchedDataDir( storeDir ) );
}
},
keep_last
{
@Override
public void handle( File storeDir ) throws IOException
{
File branchedDataDir = newBranchedDataDir( storeDir );
moveAwayDb( storeDir, branchedDataDir );
for ( File file : getBranchedDataRootDirectory( storeDir ).listFiles() )
{
if ( isBranchedDataDirectory( file ) && !file.equals( branchedDataDir ) )
{
FileUtils.deleteRecursively( file );
}
}
}
},
keep_none
{
@Override
public void handle( File storeDir ) throws IOException
{
for ( File file : relevantDbFiles( storeDir ) )
{
FileUtils.deleteRecursively( file );
}
}
};
// Branched directories will end up in <dbStoreDir>/branched/<timestamp>/
static String BRANCH_SUBDIRECTORY = "branched";
public abstract void handle( File storeDir ) throws IOException;
protected void moveAwayDb( File storeDir, File branchedDataDir ) throws IOException
{
for ( File file : relevantDbFiles( storeDir ) )
{
FileUtils.moveFileToDirectory( file, branchedDataDir );
}
}
File newBranchedDataDir( File storeDir )
{
File result = getBranchedDataDirectory( storeDir, System.currentTimeMillis() );
result.mkdirs();
return result;
}
File[] relevantDbFiles( File storeDir )
{
if ( !storeDir.exists() )
{
return new File[0];
}
return storeDir.listFiles( new FileFilter()
{
@Override
public boolean accept( File file )
{
return !file.getName().startsWith( "metrics" ) && !file.getName().equals( StringLogger.DEFAULT_NAME ) && !isBranchedDataRootDirectory( file );
}
} );
}
public static boolean isBranchedDataRootDirectory( File directory )
{
return directory.isDirectory() && directory.getName().equals( BRANCH_SUBDIRECTORY );
}
public static boolean isBranchedDataDirectory( File directory )
{
return directory.isDirectory() && directory.getParentFile().getName().equals( BRANCH_SUBDIRECTORY ) &&
isAllDigits( directory.getName() );
}
private static boolean isAllDigits( String string )
{
for ( char c : string.toCharArray() )
{
if ( !Character.isDigit( c ) )
{
return false;
}
}
return true;
}
public static File getBranchedDataRootDirectory( File storeDir )
{
return new File( storeDir, BRANCH_SUBDIRECTORY );
}
public static File getBranchedDataDirectory( File storeDir, long timestamp )
{
return new File( getBranchedDataRootDirectory( storeDir ), "" + timestamp );
}
public static File[] listBranchedDataDirectories( File storeDir )
{
return getBranchedDataRootDirectory( storeDir ).listFiles( new FileFilter()
{
@Override
public boolean accept( File directory )
{
return isBranchedDataDirectory( directory );
}
} );
}
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_BranchedDataPolicy.java
|
6,319
|
private interface Value
{
int get();
}
| false
|
enterprise_ha_src_test_java_org_neo4j_kernel_ha_DelegateInvocationHandlerTest.java
|
6,320
|
public enum HaRequestType20 implements RequestType<Master>
{
// ====
ALLOCATE_IDS( new TargetCaller<Master, IdAllocation>()
{
@Override
public Response<IdAllocation> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
IdType idType = IdType.values()[input.readByte()];
return master.allocateIds( context, idType );
}
}, new ObjectSerializer<IdAllocation>()
{
@Override
public void write( IdAllocation idAllocation, ChannelBuffer result ) throws IOException
{
IdRange idRange = idAllocation.getIdRange();
result.writeInt( idRange.getDefragIds().length );
for ( long id : idRange.getDefragIds() )
{
result.writeLong( id );
}
result.writeLong( idRange.getRangeStart() );
result.writeInt( idRange.getRangeLength() );
result.writeLong( idAllocation.getHighestIdInUse() );
result.writeLong( idAllocation.getDefragCount() );
}
}
),
// ====
CREATE_RELATIONSHIP_TYPE( new TargetCaller<Master, Integer>()
{
@Override
public Response<Integer> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.createRelationshipType( context, readString( input ) );
}
}, INTEGER_SERIALIZER ),
// ====
ACQUIRE_NODE_WRITE_LOCK( new AquireLockCall()
{
@Override
public Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireNodeWriteLock( context, ids );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_NODE_READ_LOCK( new AquireLockCall()
{
@Override
public Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireNodeReadLock( context, ids );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_RELATIONSHIP_WRITE_LOCK( new AquireLockCall()
{
@Override
public Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireRelationshipWriteLock( context, ids );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_RELATIONSHIP_READ_LOCK( new AquireLockCall()
{
@Override
public Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireRelationshipReadLock( context, ids );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
COMMIT( new TargetCaller<Master, Long>()
{
@Override
public Response<Long> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
String resource = readString( input );
final ReadableByteChannel reader = new BlockLogReader( input );
return master.commitSingleResourceTransaction( context, resource, TxExtractor.create( reader ) );
}
}, LONG_SERIALIZER ),
// ====
PULL_UPDATES( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.pullUpdates( context );
}
}, VOID_SERIALIZER ),
// ====
FINISH( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.finishTransaction( context, readBoolean( input ) );
}
}, VOID_SERIALIZER ),
// ====
HANDSHAKE( new TargetCaller<Master, HandshakeResult>()
{
@Override
public Response<HandshakeResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.handshake( input.readLong(), null );
}
}, new ObjectSerializer<HandshakeResult>()
{
@Override
public void write( HandshakeResult responseObject, ChannelBuffer result ) throws IOException
{
result.writeInt( responseObject.txAuthor() );
result.writeLong( responseObject.txChecksum() );
}
} ),
// ====
COPY_STORE( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
final ChannelBuffer target )
{
return master.copyStore( context, new ToNetworkStoreWriter( target, new Monitors() ) );
}
}, VOID_SERIALIZER ),
// ====
COPY_TRANSACTIONS( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
final ChannelBuffer target )
{
return master.copyTransactions( context, readString( input ), input.readLong(), input.readLong() );
}
}, VOID_SERIALIZER ),
// ====
INITIALIZE_TX( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.initializeTx( context );
}
}, VOID_SERIALIZER ),
// ====
ACQUIRE_GRAPH_WRITE_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireGraphWriteLock( context );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_GRAPH_READ_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireGraphReadLock( context );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_INDEX_READ_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireIndexReadLock( context, readString( input ), readString( input ) );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_INDEX_WRITE_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireIndexWriteLock( context, readString( input ), readString( input ) );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
PUSH_TRANSACTION( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.pushTransaction( context, readString( input ), input.readLong() );
}
}, VOID_SERIALIZER ),
// ====
CREATE_PROPERTY_KEY( new TargetCaller<Master, Integer>()
{
@Override
public Response<Integer> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.createPropertyKey( context, readString( input ) );
}
}, INTEGER_SERIALIZER ),
// ====
CREATE_LABEL( new TargetCaller<Master, Integer>()
{
@Override
public Response<Integer> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.createLabel( context, readString( input ) );
}
}, INTEGER_SERIALIZER ),
// ====
ACQUIRE_SCHEMA_READ_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireSchemaReadLock( context );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_SCHEMA_WRITE_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireSchemaWriteLock( context );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
}, ACQUIRE_INDEX_ENTRY_WRITE_LOCK( new TargetCaller<Master,LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireIndexEntryWriteLock( context, input.readLong(), input.readLong(), readString( input ) );
}
}, LOCK_SERIALIZER );
@SuppressWarnings( "rawtypes" )
final TargetCaller caller;
@SuppressWarnings( "rawtypes" )
final ObjectSerializer serializer;
private <T> HaRequestType20( TargetCaller caller, ObjectSerializer<T> serializer )
{
this.caller = caller;
this.serializer = serializer;
}
@Override
public ObjectSerializer getObjectSerializer()
{
return serializer;
}
@Override
public TargetCaller getTargetCaller()
{
return caller;
}
@Override
public byte id()
{
return (byte) ordinal();
}
public boolean isLock()
{
return false;
}
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_HaRequestType20.java
|
6,321
|
public enum HaRequestType201 implements RequestType<Master>
{
// ====
ALLOCATE_IDS( new TargetCaller<Master, IdAllocation>()
{
@Override
public Response<IdAllocation> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
IdType idType = IdType.values()[input.readByte()];
return master.allocateIds( context, idType );
}
}, new ObjectSerializer<IdAllocation>()
{
@Override
public void write( IdAllocation idAllocation, ChannelBuffer result ) throws IOException
{
IdRange idRange = idAllocation.getIdRange();
result.writeInt( idRange.getDefragIds().length );
for ( long id : idRange.getDefragIds() )
{
result.writeLong( id );
}
result.writeLong( idRange.getRangeStart() );
result.writeInt( idRange.getRangeLength() );
result.writeLong( idAllocation.getHighestIdInUse() );
result.writeLong( idAllocation.getDefragCount() );
}
}
),
// ====
CREATE_RELATIONSHIP_TYPE( new TargetCaller<Master, Integer>()
{
@Override
public Response<Integer> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.createRelationshipType( context, readString( input ) );
}
}, INTEGER_SERIALIZER ),
// ====
ACQUIRE_NODE_WRITE_LOCK( new AquireLockCall()
{
@Override
public Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireNodeWriteLock( context, ids );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_NODE_READ_LOCK( new AquireLockCall()
{
@Override
public Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireNodeReadLock( context, ids );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_RELATIONSHIP_WRITE_LOCK( new AquireLockCall()
{
@Override
public Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireRelationshipWriteLock( context, ids );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_RELATIONSHIP_READ_LOCK( new AquireLockCall()
{
@Override
public Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireRelationshipReadLock( context, ids );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
COMMIT( new TargetCaller<Master, Long>()
{
@Override
public Response<Long> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
String resource = readString( input );
final ReadableByteChannel reader = new BlockLogReader( input );
return master.commitSingleResourceTransaction( context, resource, TxExtractor.create( reader ) );
}
}, LONG_SERIALIZER ),
// ====
PULL_UPDATES( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.pullUpdates( context );
}
}, VOID_SERIALIZER ),
// ====
FINISH( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.finishTransaction( context, readBoolean( input ) );
}
}, VOID_SERIALIZER ),
// ====
HANDSHAKE( new TargetCaller<Master, HandshakeResult>()
{
@Override
public Response<HandshakeResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.handshake( input.readLong(), null );
}
}, new ObjectSerializer<HandshakeResult>()
{
@Override
public void write( HandshakeResult responseObject, ChannelBuffer result ) throws IOException
{
result.writeInt( responseObject.txAuthor() );
result.writeLong( responseObject.txChecksum() );
result.writeLong( responseObject.epoch() );
}
}
),
// ====
COPY_STORE( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
final ChannelBuffer target )
{
return master.copyStore( context, new ToNetworkStoreWriter( target, new Monitors() ) );
}
}, VOID_SERIALIZER ),
// ====
COPY_TRANSACTIONS( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
final ChannelBuffer target )
{
return master.copyTransactions( context, readString( input ), input.readLong(), input.readLong() );
}
}, VOID_SERIALIZER ),
// ====
INITIALIZE_TX( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.initializeTx( context );
}
}, VOID_SERIALIZER ),
// ====
ACQUIRE_GRAPH_WRITE_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireGraphWriteLock( context );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_GRAPH_READ_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireGraphReadLock( context );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_INDEX_READ_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireIndexReadLock( context, readString( input ), readString( input ) );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_INDEX_WRITE_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireIndexWriteLock( context, readString( input ), readString( input ) );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
PUSH_TRANSACTION( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.pushTransaction( context, readString( input ), input.readLong() );
}
}, VOID_SERIALIZER ),
// ====
CREATE_PROPERTY_KEY( new TargetCaller<Master, Integer>()
{
@Override
public Response<Integer> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.createPropertyKey( context, readString( input ) );
}
}, INTEGER_SERIALIZER ),
// ====
CREATE_LABEL( new TargetCaller<Master, Integer>()
{
@Override
public Response<Integer> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.createLabel( context, readString( input ) );
}
}, INTEGER_SERIALIZER ),
// ====
ACQUIRE_SCHEMA_READ_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireSchemaReadLock( context );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_SCHEMA_WRITE_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireSchemaWriteLock( context );
}
}, LOCK_SERIALIZER )
{
@Override
public boolean isLock()
{
return true;
}
}, ACQUIRE_INDEX_ENTRY_WRITE_LOCK( new TargetCaller<Master,LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireIndexEntryWriteLock( context, input.readLong(), input.readLong(), readString( input ) );
}
}, LOCK_SERIALIZER );
@SuppressWarnings( "rawtypes" )
final TargetCaller caller;
@SuppressWarnings( "rawtypes" )
final ObjectSerializer serializer;
private <T> HaRequestType201( TargetCaller caller, ObjectSerializer<T> serializer )
{
this.caller = caller;
this.serializer = serializer;
}
@Override
public ObjectSerializer getObjectSerializer()
{
return serializer;
}
@Override
public TargetCaller getTargetCaller()
{
return caller;
}
@Override
public byte id()
{
return (byte) ordinal();
}
public boolean isLock()
{
return false;
}
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_HaRequestType201.java
|
6,322
|
public static enum TxPushStrategy
{
@Description("Round robin")
round_robin,
@Description("Fixed")
fixed
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_HaSettings.java
|
6,323
|
public interface HighAvailabilityMemberInfoProvider
{
HighAvailabilityMemberState getHighAvailabilityMemberState();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_HighAvailabilityMemberInfoProvider.java
|
6,324
|
public interface HighAvailability
{
void addHighAvailabilityMemberListener( HighAvailabilityMemberListener listener );
void removeHighAvailabilityMemberListener( HighAvailabilityMemberListener listener );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_cluster_HighAvailability.java
|
6,325
|
public interface HighAvailabilityMemberContext
{
InstanceId getMyId();
InstanceId getElectedMasterId();
void setElectedMasterId( InstanceId electedMasterId );
URI getAvailableHaMaster();
void setAvailableHaMasterId( URI availableHaMasterId );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_cluster_HighAvailabilityMemberContext.java
|
6,326
|
public interface HighAvailabilityMemberListener
{
void masterIsElected( HighAvailabilityMemberChangeEvent event );
void masterIsAvailable( HighAvailabilityMemberChangeEvent event );
void slaveIsAvailable( HighAvailabilityMemberChangeEvent event );
void instanceStops( HighAvailabilityMemberChangeEvent event );
public static class Adapter implements HighAvailabilityMemberListener
{
@Override
public void masterIsElected( HighAvailabilityMemberChangeEvent event )
{
}
@Override
public void masterIsAvailable( HighAvailabilityMemberChangeEvent event )
{
}
@Override
public void slaveIsAvailable( HighAvailabilityMemberChangeEvent event )
{
}
@Override
public void instanceStops( HighAvailabilityMemberChangeEvent event )
{
}
}
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_cluster_HighAvailabilityMemberListener.java
|
6,327
|
public enum HighAvailabilityMemberState
{
/**
* This state is the initial state, and is also the state used when leaving the cluster.
* <p/>
* Here we are waiting for events that transitions this member either to becoming a master or slave.
*/
PENDING
{
@Override
public HighAvailabilityMemberState masterIsElected( HighAvailabilityMemberContext context,
InstanceId masterId )
{
assert context.getAvailableHaMaster() == null;
if ( masterId.equals( context.getMyId() ) )
{
return TO_MASTER;
}
return PENDING;
}
@Override
public HighAvailabilityMemberState masterIsAvailable( HighAvailabilityMemberContext context,
InstanceId masterId, URI masterHaURI )
{
// assert context.getAvailableMaster() == null;
if ( masterId.equals( context.getMyId() ) )
{
throw new RuntimeException( "Received a MasterIsAvailable event for my InstanceId while in" +
" PENDING state" );
}
return TO_SLAVE;
}
@Override
public HighAvailabilityMemberState slaveIsAvailable( HighAvailabilityMemberContext context,
InstanceId slaveId,
URI slaveUri )
{
if ( slaveId.equals( context.getMyId() ) )
{
throw new RuntimeException( "Cannot go from pending to slave" );
}
return this;
}
@Override
public boolean isEligibleForElection()
{
return true;
}
@Override
public boolean isAccessAllowed()
{
return false;
}
},
/**
* Member now knows that a master is available, and is transitioning itself to become a slave to that master.
* It is performing the transition process here, and so is not yet available as a slave.
*/
TO_SLAVE
{
@Override
public HighAvailabilityMemberState masterIsElected( HighAvailabilityMemberContext context,
InstanceId masterId )
{
if ( masterId.equals( context.getElectedMasterId() ) )
{
// A member joined and we all got the same event
return this;
}
if ( masterId.equals( context.getMyId() ) )
{
return TO_MASTER;
}
// This may mean the master changed from the time we transitioned here
return PENDING;
}
@Override
public HighAvailabilityMemberState masterIsAvailable( HighAvailabilityMemberContext context,
InstanceId masterId,
URI masterHaURI )
{
if ( masterId.equals( context.getMyId() ) )
{
throw new RuntimeException( "i (" + context.getMyId() + ") am trying to become a slave but " +
"someone said i am available as master" );
}
if ( masterId.equals( context.getElectedMasterId() ) )
{
// A member joined and we all got the same event
return this;
}
throw new RuntimeException( "my (" + context.getMyId() + ") current master is " + context
.getAvailableHaMaster() + " (elected as " + context.getElectedMasterId() + " but i got a " +
"masterIsAvailable event for " + masterHaURI );
}
@Override
public HighAvailabilityMemberState slaveIsAvailable( HighAvailabilityMemberContext context,
InstanceId slaveId,
URI slaveUri )
{
if ( slaveId.equals( context.getMyId() ) )
{
return SLAVE;
}
return this;
}
@Override
public boolean isEligibleForElection()
{
return false;
}
@Override
public boolean isAccessAllowed()
{
return false;
}
},
/**
* The cluster member knows that it has been elected as master, and starts the transitioning process.
*/
TO_MASTER
{
@Override
public HighAvailabilityMemberState masterIsElected( HighAvailabilityMemberContext context,
InstanceId masterId )
{
assert context.getAvailableHaMaster() == null;
if ( masterId.equals( context.getMyId() ) )
{
return this;
}
return PENDING; // everything still goes
}
@Override
public HighAvailabilityMemberState masterIsAvailable( HighAvailabilityMemberContext context,
InstanceId masterId,
URI masterHaURI )
{
if ( masterId.equals( context.getMyId() ) )
{
return MASTER;
}
throw new RuntimeException( "Received a MasterIsAvailable event for instance " + masterId
+ " while in TO_MASTER state");
}
@Override
public HighAvailabilityMemberState slaveIsAvailable( HighAvailabilityMemberContext context,
InstanceId slaveId,
URI slaveUri )
{
if ( slaveId.equals( context.getMyId() ) )
{
throw new RuntimeException( "Cannot be transitioning to master and slave at the same time" );
}
return this;
}
@Override
public boolean isEligibleForElection()
{
return true;
}
@Override
public boolean isAccessAllowed()
{
return false;
}
},
/**
* Cluster member is available as master for other cluster members to use.
*/
MASTER
{
@Override
public HighAvailabilityMemberState masterIsElected( HighAvailabilityMemberContext context,
InstanceId masterId )
{
if ( masterId.equals( context.getMyId() ) )
{
return this;
}
// This means we (probably) were disconnected and got back in the cluster
// and we find out that we are not the master anymore.
return PENDING;
}
@Override
public HighAvailabilityMemberState masterIsAvailable( HighAvailabilityMemberContext context,
InstanceId masterId,
URI masterHaURI )
{
if ( masterId.equals( context.getMyId() ) )
{
return this;
}
throw new RuntimeException( "I, " + context.getMyId() + " got a masterIsAvailable for " +
masterHaURI + " (id is " + masterId + " ) while in MASTER state. Probably missed a " +
"MasterIsElected event." );
}
@Override
public HighAvailabilityMemberState slaveIsAvailable( HighAvailabilityMemberContext context,
InstanceId slaveId,
URI slaveUri )
{
if ( slaveId.equals( context.getMyId() ) )
{
throw new RuntimeException( "Cannot be master and transition to slave at the same time" );
}
return this;
}
@Override
public boolean isEligibleForElection()
{
return true;
}
@Override
public boolean isAccessAllowed()
{
return true;
}
},
/**
* Cluster member is ready as a slave
*/
SLAVE
{
@Override
public HighAvailabilityMemberState masterIsElected( HighAvailabilityMemberContext context,
InstanceId masterId )
{
if ( masterId.equals( context.getMyId() ) )
{
return TO_MASTER;
}
if ( masterId.equals( context.getElectedMasterId() ) )
{
return this;
}
else
{
return PENDING;
}
}
@Override
public HighAvailabilityMemberState masterIsAvailable( HighAvailabilityMemberContext context,
InstanceId masterId,
URI masterHaURI )
{
if ( masterId.equals( context.getMyId() ) )
{
throw new RuntimeException( "Cannot transition to MASTER directly from SLAVE state" );
}
else if ( masterId.equals( context.getElectedMasterId() ) )
{
// this is just someone else that joined the cluster
return this;
}
throw new RuntimeException( "Received a MasterIsAvailable event for " + masterId +
" which is different from the current master (" + context.getElectedMasterId() +
") while in the SLAVE state (probably missed a MasterIsElected event)" );
}
@Override
public HighAvailabilityMemberState slaveIsAvailable( HighAvailabilityMemberContext context, InstanceId slaveId, URI slaveUri )
{
return this;
}
@Override
public boolean isEligibleForElection()
{
return true;
}
@Override
public boolean isAccessAllowed()
{
return true;
}
};
public abstract HighAvailabilityMemberState masterIsElected( HighAvailabilityMemberContext context, InstanceId masterId );
public abstract HighAvailabilityMemberState masterIsAvailable( HighAvailabilityMemberContext context, InstanceId masterId,
URI masterHaURI );
public abstract HighAvailabilityMemberState slaveIsAvailable( HighAvailabilityMemberContext context, InstanceId slaveId, URI slaveUri );
public abstract boolean isEligibleForElection();
public abstract boolean isAccessAllowed();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_cluster_HighAvailabilityMemberState.java
|
6,328
|
public enum HaRequestType18 implements RequestType<Master>
{
// ====
ALLOCATE_IDS( new TargetCaller<Master, IdAllocation>()
{
@Override
public Response<IdAllocation> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
IdType idType = IdType.values()[input.readByte()];
return master.allocateIds( context, idType );
}
}, new ObjectSerializer<IdAllocation>()
{
@Override
public void write( IdAllocation idAllocation, ChannelBuffer result ) throws IOException
{
IdRange idRange = idAllocation.getIdRange();
result.writeInt( idRange.getDefragIds().length );
for ( long id : idRange.getDefragIds() )
{
result.writeLong( id );
}
result.writeLong( idRange.getRangeStart() );
result.writeInt( idRange.getRangeLength() );
result.writeLong( idAllocation.getHighestIdInUse() );
result.writeLong( idAllocation.getDefragCount() );
}
}, false ),
// ====
CREATE_RELATIONSHIP_TYPE( new TargetCaller<Master, Integer>()
{
@Override
public Response<Integer> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.createRelationshipType( context, readString( input ) );
}
}, INTEGER_SERIALIZER, true ),
// ====
ACQUIRE_NODE_WRITE_LOCK( new AquireLockCall()
{
@Override
protected Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireNodeWriteLock( context, ids );
}
}, LOCK_SERIALIZER, true )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_NODE_READ_LOCK( new AquireLockCall()
{
@Override
protected Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireNodeReadLock( context, ids );
}
}, LOCK_SERIALIZER, true )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_RELATIONSHIP_WRITE_LOCK( new AquireLockCall()
{
@Override
protected Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireRelationshipWriteLock( context, ids );
}
}, LOCK_SERIALIZER, true )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_RELATIONSHIP_READ_LOCK( new AquireLockCall()
{
@Override
protected Response<LockResult> lock( Master master, RequestContext context, long... ids )
{
return master.acquireRelationshipReadLock( context, ids );
}
}, LOCK_SERIALIZER, true )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
COMMIT( new TargetCaller<Master, Long>()
{
@Override
public Response<Long> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
String resource = readString( input );
final ReadableByteChannel reader = new BlockLogReader( input );
return master.commitSingleResourceTransaction( context, resource, TxExtractor.create( reader ) );
}
}, LONG_SERIALIZER, true ),
// ====
PULL_UPDATES( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.pullUpdates( context );
}
}, VOID_SERIALIZER, true ),
// ====
FINISH( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.finishTransaction( context, readBoolean( input ) );
}
}, VOID_SERIALIZER, true ),
// ====
HANDSHAKE( new TargetCaller<Master, HandshakeResult>()
{
@Override
public Response<HandshakeResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.handshake( input.readLong(), null );
}
}, new ObjectSerializer<HandshakeResult>()
{
@Override
public void write( HandshakeResult responseObject, ChannelBuffer result ) throws IOException
{
result.writeInt( responseObject.txAuthor() );
result.writeLong( responseObject.txChecksum() );
}
}, false ),
// ====
COPY_STORE( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
final ChannelBuffer target )
{
return master.copyStore( context, new ToNetworkStoreWriter( target, new Monitors() ) );
}
}, VOID_SERIALIZER, true ),
// ====
COPY_TRANSACTIONS( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
final ChannelBuffer target )
{
return master.copyTransactions( context, readString( input ), input.readLong(), input.readLong() );
}
}, VOID_SERIALIZER, true ),
// ====
INITIALIZE_TX( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.initializeTx( context );
}
}, VOID_SERIALIZER, true ),
// ====
ACQUIRE_GRAPH_WRITE_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireGraphWriteLock( context );
}
}, LOCK_SERIALIZER, true )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_GRAPH_READ_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireGraphReadLock( context );
}
}, LOCK_SERIALIZER, true )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_INDEX_READ_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireIndexReadLock( context, readString( input ), readString( input ) );
}
}, LOCK_SERIALIZER, true )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
ACQUIRE_INDEX_WRITE_LOCK( new TargetCaller<Master, LockResult>()
{
@Override
public Response<LockResult> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.acquireIndexWriteLock( context, readString( input ), readString( input ) );
}
}, LOCK_SERIALIZER, true )
{
@Override
public boolean isLock()
{
return true;
}
},
// ====
PUSH_TRANSACTION( new TargetCaller<Master, Void>()
{
@Override
public Response<Void> call( Master master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.pushTransaction( context, readString( input ), input.readLong() );
}
}, VOID_SERIALIZER, true );
@SuppressWarnings( "rawtypes" )
final TargetCaller caller;
@SuppressWarnings( "rawtypes" )
final ObjectSerializer serializer;
private final boolean includesSlaveContext;
private <T> HaRequestType18( TargetCaller caller, ObjectSerializer<T> serializer, boolean includesSlaveContext )
{
this.caller = caller;
this.serializer = serializer;
this.includesSlaveContext = includesSlaveContext;
}
@Override
public ObjectSerializer getObjectSerializer()
{
return serializer;
}
@Override
public TargetCaller getTargetCaller()
{
return caller;
}
@Override
public byte id()
{
return (byte) ordinal();
}
public boolean includesSlaveContext()
{
return this.includesSlaveContext;
}
public boolean isLock()
{
return false;
}
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_HaRequestType18.java
|
6,329
|
public interface Master
{
Response<IdAllocation> allocateIds( RequestContext context, IdType idType );
Response<Integer> createRelationshipType( RequestContext context, String name );
Response<Integer> createPropertyKey( RequestContext context, String name );
Response<Integer> createLabel( RequestContext context, String name );
/**
* Called when the first write operation of lock is performed for a transaction.
*/
Response<Void> initializeTx( RequestContext context );
Response<LockResult> acquireNodeWriteLock( RequestContext context, long... nodes );
Response<LockResult> acquireNodeReadLock( RequestContext context, long... nodes );
Response<LockResult> acquireGraphWriteLock( RequestContext context );
Response<LockResult> acquireGraphReadLock( RequestContext context );
Response<LockResult> acquireRelationshipWriteLock( RequestContext context, long... relationships );
Response<LockResult> acquireRelationshipReadLock( RequestContext context, long... relationships );
Response<Long> commitSingleResourceTransaction( RequestContext context,
String resource, TxExtractor txGetter );
Response<Void> finishTransaction( RequestContext context, boolean success );
/**
* Gets the master id for a given txId, also a checksum for that tx.
*
* @param txId the transaction id to get the data for.
* @param myStoreId clients store id.
* @return the master id for a given txId, also a checksum for that tx.
*/
Response<HandshakeResult> handshake( long txId, StoreId myStoreId );
Response<LockResult> acquireIndexWriteLock( RequestContext context, String index, String key );
Response<LockResult> acquireIndexReadLock( RequestContext context, String index, String key );
Response<Void> pushTransaction( RequestContext context, String resourceName, long tx );
Response<Void> pullUpdates( RequestContext context );
Response<Void> copyStore( RequestContext context, StoreWriter writer );
Response<Void> copyTransactions( RequestContext context, String dsName,
long startTxId, long endTxId );
Response<LockResult> acquireSchemaReadLock( RequestContext context );
Response<LockResult> acquireSchemaWriteLock( RequestContext context );
Response<LockResult> acquireIndexEntryWriteLock( RequestContext context,
long labelId, long propertyKeyId, String propertyValue );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_Master.java
|
6,330
|
public static interface LockGrabber
{
void grab( LockManager lockManager, TransactionState state, Object entity );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_MasterImpl.java
|
6,331
|
public interface Monitor
{
void initializeTx( RequestContext context );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_MasterImpl.java
|
6,332
|
public interface SPI
{
boolean isAccessible();
void acquireLock( LockGrabber grabber, Object... entities );
Transaction beginTx() throws SystemException, NotSupportedException;
void finishTransaction( boolean success );
void suspendTransaction() throws SystemException;
void resumeTransaction( Transaction transaction );
GraphProperties graphProperties();
IdAllocation allocateIds( IdType idType );
StoreId storeId();
long applyPreparedTransaction( String resource, ReadableByteChannel extract ) throws IOException;
Integer createRelationshipType( String name );
Pair<Integer, Long> getMasterIdForCommittedTx( long txId ) throws IOException;
RequestContext rotateLogsAndStreamStoreFiles( StoreWriter writer );
Response<Void> copyTransactions( String dsName, long startTxId, long endTxId );
<T> Response<T> packResponse( RequestContext context, T response, Predicate<Long> filter );
void pushTransaction( String resourceName, int eventIdentifier, long tx, int machineId );
int getOrCreateLabel( String name );
int getOrCreateProperty( String name );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_MasterImpl.java
|
6,333
|
public interface Slave
{
Response<Void> pullUpdates( String resource, long upToAndIncludingTxId );
int getServerId();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_Slave.java
|
6,334
|
public static enum SlaveRequestType implements RequestType<Slave>
{
PULL_UPDATES( new TargetCaller<Slave, Void>()
{
@Override
public Response<Void> call( Slave master, RequestContext context, ChannelBuffer input,
ChannelBuffer target )
{
return master.pullUpdates( readString( input ), input.readLong() );
}
}, VOID_SERIALIZER );
private final TargetCaller caller;
private final ObjectSerializer serializer;
private SlaveRequestType( TargetCaller caller, ObjectSerializer serializer )
{
this.caller = caller;
this.serializer = serializer;
}
@Override
public TargetCaller getTargetCaller()
{
return caller;
}
@Override
public ObjectSerializer getObjectSerializer()
{
return serializer;
}
@Override
public byte id()
{
return (byte) ordinal();
}
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_SlaveClient.java
|
6,335
|
public interface SlaveFactory
{
Slave newSlave( ClusterMember clusterMember );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_SlaveFactory.java
|
6,336
|
public interface SlavePriority
{
Iterable<Slave> prioritize( Iterable<Slave> slaves );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_SlavePriority.java
|
6,337
|
public interface Slaves
{
Iterable<Slave> getSlaves();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_master_Slaves.java
|
6,338
|
public interface MasterClient extends Master
{
static final ObjectSerializer<LockResult> LOCK_SERIALIZER = new ObjectSerializer<LockResult>()
{
public void write( LockResult responseObject, ChannelBuffer result ) throws IOException
{
result.writeByte( responseObject.getStatus().ordinal() );
if ( responseObject.getStatus().hasMessage() )
{
writeString( result, responseObject.getDeadlockMessage() );
}
}
};
static final Deserializer<LockResult> LOCK_RESULT_DESERIALIZER = new Deserializer<LockResult>()
{
public LockResult read( ChannelBuffer buffer, ByteBuffer temporaryBuffer ) throws IOException
{
LockStatus status = LockStatus.values()[buffer.readByte()];
return status.hasMessage() ? new LockResult( readString( buffer ) ) : new LockResult( status );
}
};
public Response<Integer> createRelationshipType( RequestContext context, final String name );
public Response<Void> initializeTx( RequestContext context );
public Response<LockResult> acquireNodeReadLock( RequestContext context, long... nodes );
public Response<LockResult> acquireRelationshipWriteLock( RequestContext context, long... relationships );
public Response<LockResult> acquireRelationshipReadLock( RequestContext context, long... relationships );
public Response<LockResult> acquireGraphWriteLock( RequestContext context );
public Response<LockResult> acquireGraphReadLock( RequestContext context );
public Response<LockResult> acquireIndexReadLock( RequestContext context, String index, String key );
public Response<LockResult> acquireIndexWriteLock( RequestContext context, String index, String key );
public Response<Long> commitSingleResourceTransaction( RequestContext context, final String resource,
final TxExtractor txGetter );
public Response<Void> finishTransaction( RequestContext context, final boolean success );
public void rollbackOngoingTransactions( RequestContext context );
public Response<Void> pullUpdates( RequestContext context );
public Response<Void> copyStore( RequestContext context, final StoreWriter writer );
public Response<Void> copyTransactions( RequestContext context, final String ds, final long startTxId,
final long endTxId );
public void addMismatchingVersionHandler( MismatchingVersionHandler toAdd );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_slave_MasterClient.java
|
6,339
|
public interface MasterClientFactory
{
public MasterClient instantiate( String hostNameOrIp, int port, Monitors monitors, StoreId storeId, LifeSupport life );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_com_slave_MasterClientFactory.java
|
6,340
|
private enum IdGeneratorState
{
PENDING, SLAVE, MASTER;
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_id_HaIdGeneratorFactory.java
|
6,341
|
public enum LockStatus
{
OK_LOCKED,
NOT_LOCKED,
DEAD_LOCKED
{
@Override
public boolean hasMessage()
{
return true;
}
};
public boolean hasMessage()
{
return false;
}
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_lock_LockStatus.java
|
6,342
|
public static interface Configuration
{
long getAvailabilityTimeout();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_lock_SlaveLockManager.java
|
6,343
|
public interface CompatibilityModeListener
{
public void leftCompatibilityMode();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_switchover_CompatibilityModeListener.java
|
6,344
|
public interface CompatibilityMonitor
{
public void addCompatibilityModeListener( CompatibilityModeListener listener );
public void removeCompatibilityModeListener( CompatibilityModeListener listener );
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_switchover_CompatibilityMonitor.java
|
6,345
|
public interface Switchover
{
public void doSwitchover();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_switchover_Switchover.java
|
6,346
|
public interface Configuration
{
int getTxPushFactor();
int getServerId();
SlavePriority getReplicationStrategy();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_transaction_MasterTxIdGenerator.java
|
6,347
|
@Deprecated
public interface TransactionSupport
{
void makeSureTxHasBeenInitialized();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_transaction_TransactionSupport.java
|
6,348
|
public interface RequestContextFactoryResolver
{
RequestContextFactory get();
}
| false
|
enterprise_ha_src_main_java_org_neo4j_kernel_ha_transaction_TxHookModeSwitcher.java
|
6,349
|
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.TYPE )
@Inherited
public @interface RequiresPersistentGraphDatabase
{
boolean value() default true;
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_AbstractNeo4jTestCase.java
|
6,350
|
public enum MyRelTypes implements RelationshipType
{
TEST, TEST_TRAVERSAL, TEST2
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_MyRelTypes.java
|
6,351
|
private enum Environment
{
JAVAC( "com.sun.tools.javac.processing.JavacProcessingEnvironment" )
{
@Override
CompilationManipulator create( AnnotationProcessor proc, ProcessingEnvironment env )
{
return new JavacManipulator( proc, env );
}
};
private final Class<?> environment;
private Environment( String environment )
{
this.environment = loadClass( environment );
}
CompilationManipulator load( AnnotationProcessor proc, ProcessingEnvironment env )
{
try
{
if ( environment != null && environment.isInstance( env ) && canLoad( env ) )
{
return create( proc, env );
}
}
catch ( Exception e )
{
return null;
}
catch ( LinkageError e )
{
return null;
}
return null;
}
boolean canLoad( @SuppressWarnings( "unused" ) ProcessingEnvironment env )
{
return true;
}
abstract CompilationManipulator create( AnnotationProcessor proc, ProcessingEnvironment env );
private static Class<?> loadClass( String className )
{
try
{
return Class.forName( className );
}
catch ( Throwable e )
{
return null;
}
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_annotations_CompilationManipulator.java
|
6,352
|
@Retention( RetentionPolicy.RUNTIME )
@Target( { ElementType.TYPE, ElementType.FIELD, ElementType.METHOD } )
public @interface Documented
{
static String DEFAULT_VALUE = "";
String value() default DEFAULT_VALUE;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_annotations_Documented.java
|
6,353
|
public interface IndexReaderFactory
{
IndexReader newReader( long indexId ) throws IndexNotFoundKernelException;
IndexReader newUnCachedReader( long indexId ) throws IndexNotFoundKernelException;
void close();
class Caching implements IndexReaderFactory
{
private Map<Long,IndexReader> indexReaders = null;
private final IndexingService indexingService;
public Caching( IndexingService indexingService )
{
this.indexingService = indexingService;
}
@Override
public IndexReader newReader( long indexId ) throws IndexNotFoundKernelException
{
if( indexReaders == null )
{
indexReaders = new HashMap<>();
}
IndexReader reader = indexReaders.get( indexId );
if ( reader == null )
{
reader = newUnCachedReader( indexId );
indexReaders.put( indexId, reader );
}
return reader;
}
public IndexReader newUnCachedReader( long indexId ) throws IndexNotFoundKernelException
{
IndexProxy index = indexingService.getProxyForRule( indexId );
return index.newReader();
}
@Override
public void close()
{
if ( indexReaders != null )
{
for ( IndexReader indexReader : indexReaders.values() )
{
indexReader.close();
}
}
}
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_IndexReaderFactory.java
|
6,354
|
private enum TransactionType
{
ANY,
DATA
{
@Override
TransactionType upgradeToSchemaTransaction() throws InvalidTransactionTypeKernelException
{
throw new InvalidTransactionTypeKernelException(
"Cannot perform schema updates in a transaction that has performed data updates." );
}
},
SCHEMA
{
@Override
TransactionType upgradeToDataTransaction() throws InvalidTransactionTypeKernelException
{
throw new InvalidTransactionTypeKernelException(
"Cannot perform data updates in a transaction that has performed schema updates." );
}
};
TransactionType upgradeToDataTransaction() throws InvalidTransactionTypeKernelException
{
return DATA;
}
TransactionType upgradeToSchemaTransaction() throws InvalidTransactionTypeKernelException
{
return SCHEMA;
}
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_KernelTransactionImplementation.java
|
6,355
|
public interface LockHolder
{
void acquireNodeReadLock( long nodeId );
void acquireNodeWriteLock( long nodeId );
void acquireRelationshipReadLock( long relationshipId );
void acquireRelationshipWriteLock( long relationshipId );
void acquireGraphWriteLock();
void acquireSchemaReadLock();
void acquireSchemaWriteLock();
/**
* @param propertyValue is a string for serialization purposes (HA). There can be clashes, but these are rare
* enough, transient, and does not affect correctness.
*/
void acquireIndexEntryWriteLock( int labelId, int propertyKeyId, String propertyValue );
/**
* @param propertyValue is a string for serialization purposes (HA). There can be clashes, but these are rare
* enough, transient, and does not affect correctness.
*/
ReleasableLock getReleasableIndexEntryReadLock( int labelId, int propertyKeyId, String propertyValue );
/**
* @param propertyValue is a string for serialization purposes (HA). There can be clashes, but these are rare
* enough, transient, and does not affect correctness.
*/
ReleasableLock getReleasableIndexEntryWriteLock( int labelId, int propertyKeyId, String propertyValue );
void releaseLocks() throws ReleaseLocksFailedKernelException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_LockHolder.java
|
6,356
|
public interface ReleasableLock extends AutoCloseable
{
/**
* Immediately release this lock
*/
void release();
/**
* Register this lock for delayed release with the current transaction
*/
void registerWithTransaction();
/**
* If neither {@link #release()} nor {@link #registerWithTransaction()} has been called prior to calling this
* method, it will behave the same as {@link #registerWithTransaction()}, otherwise it is a no-op.
*/
@Override
void close();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_ReleasableLock.java
|
6,357
|
public interface SchemaState {
<K, V> V get( K key );
<K, V> V getOrCreate( K key, Function<K, V> creator );
void clear();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_SchemaState.java
|
6,358
|
public interface SchemaWriteGuard
{
void assertSchemaWritesAllowed() throws InvalidTransactionTypeKernelException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_SchemaWriteGuard.java
|
6,359
|
public interface UpdateableSchemaState extends SchemaState
{
void replace(Map<Object, Object> updates);
<K, V> void apply(Map<K, V> updates);
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_UpdateableSchemaState.java
|
6,360
|
private static enum State
{
INIT, STARTING, STARTED, CLOSED
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_ContractCheckingIndexProxy.java
|
6,361
|
private interface ThrowingRunnable
{
void run() throws IOException;
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_api_index_ContractCheckingIndexProxyTest.java
|
6,362
|
public interface FailedIndexProxyFactory
{
IndexProxy create( Throwable failure );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_FailedIndexProxyFactory.java
|
6,363
|
public interface IndexProxy
{
void start() throws IOException;
IndexUpdater newUpdater( IndexUpdateMode mode );
/**
* Initiates dropping this index context. The returned {@link Future} can be used to await
* its completion.
* Must close the context as well.
*/
Future<Void> drop() throws IOException;
/**
* Initiates a closing of this index context. The returned {@link Future} can be used to await
* its completion.
*/
Future<Void> close() throws IOException;
IndexDescriptor getDescriptor();
SchemaIndexProvider.Descriptor getProviderDescriptor();
InternalIndexState getState();
/**
* @return failure message. Expect a call to it if {@link #getState()} returns {@link InternalIndexState#FAILED}.
*/
IndexPopulationFailure getPopulationFailure() throws IllegalStateException;
void force() throws IOException;
/**
* @throws IndexNotFoundKernelException if the index isn't online yet.
*/
IndexReader newReader() throws IndexNotFoundKernelException;
/**
* @return {@code true} if the call waited, {@code false} if the condition was already reached.
*/
boolean awaitStoreScanCompleted() throws IndexPopulationFailedKernelException, InterruptedException;
void activate() throws IndexActivationFailedKernelException;
void validate() throws ConstraintVerificationFailedKernelException, IndexPopulationFailedKernelException;
ResourceIterator<File> snapshotFiles() throws IOException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_IndexProxy.java
|
6,364
|
public interface IndexProxyFactory
{
IndexProxy create();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_IndexProxyFactory.java
|
6,365
|
public interface IndexStoreView extends PropertyAccessor
{
/**
* Retrieve all nodes in the database with a given label and property, as pairs of node id and property value.
*
* @return a {@link StoreScan} to start and to stop the scan.
*/
<FAILURE extends Exception> StoreScan<FAILURE> visitNodesWithPropertyAndLabel(
IndexDescriptor descriptor, Visitor<NodePropertyUpdate, FAILURE> visitor );
/**
* Retrieve all nodes in the database which has got one or more of the given labels AND
* one or more of the given property key ids.
*
* @return a {@link StoreScan} to start and to stop the scan.
*/
<FAILURE extends Exception> StoreScan<FAILURE> visitNodes( int[] labelIds, int[] propertyKeyIds,
Visitor<NodePropertyUpdate, FAILURE> propertyUpdateVisitor,
Visitor<NodeLabelUpdate, FAILURE> labelUpdateVisitor );
Iterable<NodePropertyUpdate> nodeAsUpdates( long nodeId );
@Override
Property getProperty( long nodeId, int propertyKeyId ) throws EntityNotFoundException, PropertyNotFoundException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_IndexStoreView.java
|
6,366
|
public enum IndexUpdateMode
{
ONLINE,
RECOVERY
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_IndexUpdateMode.java
|
6,367
|
public interface IndexUpdates extends Iterable<NodePropertyUpdate>
{
Set<Long> changedNodeIds();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_IndexUpdates.java
|
6,368
|
public interface Monitor
{
void applyingRecoveredData( Collection<Long> nodeIds );
void appliedRecoveredData( Iterable<NodePropertyUpdate> updates );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_IndexingService.java
|
6,369
|
enum State
{
NOT_STARTED,
STARTING,
RUNNING,
STOPPED
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_IndexingService.java
|
6,370
|
public interface SchemaIndexProviderMap extends Function<SchemaIndexProvider.Descriptor, SchemaIndexProvider>
{
@Override
SchemaIndexProvider apply( SchemaIndexProvider.Descriptor descriptor ) throws IndexProviderNotFoundException;
SchemaIndexProvider getDefaultProvider();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_SchemaIndexProviderMap.java
|
6,371
|
public interface SingleInstanceSchemaIndexProviderFactoryDependencies
{
Config config();
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_api_index_SchemaIndexTestHelper.java
|
6,372
|
public interface StoreScan<FAILURE extends Exception>
{
void run() throws FAILURE;
void stop();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_StoreScan.java
|
6,373
|
public enum UpdateMode
{
ADDED
{
@Override
public boolean forLabel( long[] before, long[] after, long label )
{
return binarySearch( after, label ) >= 0;
}
},
CHANGED
{
@Override
public boolean forLabel( long[] before, long[] after, long label )
{
return ADDED.forLabel( before, after, label ) && REMOVED.forLabel( before, after, label );
}
},
REMOVED
{
@Override
public boolean forLabel( long[] before, long[] after, long label )
{
return binarySearch( before, label ) >= 0;
}
};
public abstract boolean forLabel( long[] before, long[] after, long label );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_index_UpdateMode.java
|
6,374
|
protected interface IndexEntryIterator
{
void visitEntry( Object key, Set<Long> nodeId ) throws Exception;
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_api_index_inmemory_InMemoryIndexImplementation.java
|
6,375
|
public interface Dependencies
{
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_api_index_inmemory_InMemoryIndexProviderFactory.java
|
6,376
|
public interface Process
{
void waitForSchemaTransactionCommitted() throws InterruptedException;
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_api_integrationtest_SchemaRecoveryIT.java
|
6,377
|
public interface EntityOperations extends EntityReadOperations, EntityWriteOperations
{
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_EntityOperations.java
|
6,378
|
public interface EntityReadOperations
{
// Currently, of course, most relevant operations here are still in the old core API implementation.
/**
* @param labelId the label id of the label that returned nodes are guaranteed to have
* @return ids of all nodes that have the given label
*/
PrimitiveLongIterator nodesGetForLabel( KernelStatement state, int labelId );
/**
* Returns an iterable with the matched nodes.
*
* @throws IndexNotFoundKernelException if no such index found.
*/
PrimitiveLongIterator nodesGetFromIndexLookup( KernelStatement state, IndexDescriptor index, Object value )
throws IndexNotFoundKernelException;
/**
* Returns an iterable with the matched node.
*
* @throws IndexNotFoundKernelException if no such index found.
* @throws IndexBrokenKernelException if we found an index that was corrupt or otherwise in a failed state.
*/
long nodeGetUniqueFromIndexLookup( KernelStatement state, IndexDescriptor index, Object value )
throws IndexNotFoundKernelException, IndexBrokenKernelException;
/**
* Checks if a node is labeled with a certain label or not. Returns
* {@code true} if the node is labeled with the label, otherwise {@code false.}
* Label ids are retrieved from {@link KeyWriteOperations#labelGetOrCreateForName(org.neo4j.kernel.api.Statement,
* String)} or
* {@link KeyReadOperations#labelGetForName(org.neo4j.kernel.api.Statement, String)}.
*/
boolean nodeHasLabel( KernelStatement state, long nodeId, int labelId ) throws EntityNotFoundException;
/**
* Returns all labels set on node with id {@code nodeId}.
* If the node has no labels an empty iterator will be returned.
*/
PrimitiveIntIterator nodeGetLabels( KernelStatement state, long nodeId ) throws EntityNotFoundException;
Property nodeGetProperty( KernelStatement state, long nodeId, int propertyKeyId ) throws EntityNotFoundException;
Property relationshipGetProperty( KernelStatement state, long relationshipId, int propertyKeyId )
throws EntityNotFoundException;
Property graphGetProperty( KernelStatement state, int propertyKeyId );
// TODO: decide if this should be replaced by nodeGetAllProperties()
/**
* Return all property keys associated with a node.
*/
PrimitiveLongIterator nodeGetPropertyKeys( KernelStatement state, long nodeId ) throws EntityNotFoundException;
Iterator<DefinedProperty> nodeGetAllProperties( KernelStatement state, long nodeId ) throws EntityNotFoundException;
// TODO: decide if this should be replaced by relationshipGetAllProperties()
/**
* Return all property keys associated with a relationship.
*/
PrimitiveLongIterator relationshipGetPropertyKeys( KernelStatement state, long relationshipId ) throws
EntityNotFoundException;
Iterator<DefinedProperty> relationshipGetAllProperties( KernelStatement state,
long relationshipId ) throws EntityNotFoundException;
// TODO: decide if this should be replaced by relationshipGetAllProperties()
/**
* Return all property keys associated with a relationship.
*/
PrimitiveLongIterator graphGetPropertyKeys( KernelStatement state );
Iterator<DefinedProperty> graphGetAllProperties( KernelStatement state );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_EntityReadOperations.java
|
6,379
|
public interface EntityWriteOperations
{
// Currently, of course, most relevant operations here are still in the old core API implementation.
void nodeDelete( KernelStatement state, long nodeId );
void relationshipDelete( KernelStatement state, long relationshipId );
/**
* Labels a node with the label corresponding to the given label id.
* If the node already had that label nothing will happen. Label ids
* are retrieved from {@link KeyWriteOperations#labelGetOrCreateForName(org.neo4j.kernel.api.Statement, String)} or {@link
* KeyReadOperations#labelGetForName(org.neo4j.kernel.api.Statement, String)}.
*/
boolean nodeAddLabel( KernelStatement state, long nodeId, int labelId )
throws EntityNotFoundException, ConstraintValidationKernelException;
/**
* Removes a label with the corresponding id from a node.
* If the node doesn't have that label nothing will happen. Label ids
* are retrieved from {@link KeyWriteOperations#labelGetOrCreateForName(org.neo4j.kernel.api.Statement, String)} or {@link
* KeyReadOperations#labelGetForName(org.neo4j.kernel.api.Statement, String)}.
*/
boolean nodeRemoveLabel( KernelStatement state, long nodeId, int labelId ) throws EntityNotFoundException;
Property nodeSetProperty( KernelStatement state, long nodeId, DefinedProperty property )
throws EntityNotFoundException, ConstraintValidationKernelException;
Property relationshipSetProperty( KernelStatement state, long relationshipId, DefinedProperty property )
throws EntityNotFoundException;
Property graphSetProperty( KernelStatement state, DefinedProperty property );
/**
* Remove a node's property given the node's id and the property key id and return the value to which
* it was set or null if it was not set on the node
*/
Property nodeRemoveProperty( KernelStatement state, long nodeId, int propertyKeyId )
throws EntityNotFoundException;
Property relationshipRemoveProperty( KernelStatement state, long relationshipId, int propertyKeyId )
throws EntityNotFoundException;
Property graphRemoveProperty( KernelStatement state, int propertyKeyId );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_EntityWriteOperations.java
|
6,380
|
public interface KeyOperations extends KeyReadOperations, KeyWriteOperations
{
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_KeyOperations.java
|
6,381
|
public interface KeyReadOperations
{
int NO_SUCH_LABEL = StatementConstants.NO_SUCH_LABEL;
int NO_SUCH_PROPERTY_KEY = StatementConstants.NO_SUCH_PROPERTY_KEY;
/** Returns a label id for a label name. If the label doesn't exist, {@link #NO_SUCH_LABEL} will be returned. */
int labelGetForName( Statement state, String labelName );
/** Returns the label name for the given label id. */
String labelGetName( Statement state, int labelId ) throws LabelNotFoundKernelException;
/**
* Returns a property key id for the given property key. If the property key doesn't exist,
* {@link #NO_SUCH_PROPERTY_KEY} will be returned.
*/
int propertyKeyGetForName( Statement state, String propertyKeyName );
/** Returns the name of a property given its property key id */
String propertyKeyGetName( Statement state, int propertyKeyId ) throws PropertyKeyIdNotFoundKernelException;
/** Returns the property keys currently stored in the database */
Iterator<Token> propertyKeyGetAllTokens( Statement state );
/** Returns the labels currently stored in the database **/
Iterator<Token> labelsGetAllTokens( Statement state ); // TODO: Token is a store level concern, should not make it this far up the stack
int relationshipTypeGetForName( Statement state, String relationshipTypeName );
String relationshipTypeGetName( Statement state, int relationshipTypeId )
throws RelationshipTypeIdNotFoundKernelException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_KeyReadOperations.java
|
6,382
|
public interface KeyWriteOperations
{
/**
* Returns a label id for a label name. If the label doesn't exist prior to
* this call it gets created.
*/
int labelGetOrCreateForName( Statement state, String labelName )
throws IllegalTokenNameException, TooManyLabelsException;
/**
* Returns a property key id for a property key. If the key doesn't exist prior to
* this call it gets created.
*/
int propertyKeyGetOrCreateForName( Statement state, String propertyKeyName ) throws IllegalTokenNameException;
int relationshipTypeGetOrCreateForName( Statement state, String relationshipTypeName )
throws IllegalTokenNameException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_KeyWriteOperations.java
|
6,383
|
public interface LegacyKernelOperations
{
long nodeCreate( Statement state );
long relationshipCreate( Statement state, long relationshipTypeId, long startNodeId, long endNodeId )
throws RelationshipTypeIdNotFoundKernelException, EntityNotFoundException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_LegacyKernelOperations.java
|
6,384
|
public interface ReadOperations extends KeyReadOperations, EntityReadOperations, SchemaReadOperations
{
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_ReadOperations.java
|
6,385
|
public interface SchemaOperations extends SchemaReadOperations, SchemaWriteOperations, SchemaStateOperations
{
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_SchemaOperations.java
|
6,386
|
public interface SchemaReadOperations
{
/**
* Returns the descriptor for the given labelId and propertyKey.
* @throws SchemaRuleNotFoundException
*/
IndexDescriptor indexesGetForLabelAndPropertyKey( KernelStatement state, int labelId, int propertyKey )
throws SchemaRuleNotFoundException;
/**
* Get all indexes for a label.
*/
Iterator<IndexDescriptor> indexesGetForLabel( KernelStatement state, int labelId );
/**
* Returns all indexes.
*/
Iterator<IndexDescriptor> indexesGetAll( KernelStatement state );
/**
* Get all constraint indexes for a label.
*/
Iterator<IndexDescriptor> uniqueIndexesGetForLabel( KernelStatement state, int labelId );
/**
* Returns all constraint indexes.
*/
Iterator<IndexDescriptor> uniqueIndexesGetAll( KernelStatement state );
/**
* Retrieve the state of an index.
*/
InternalIndexState indexGetState( KernelStatement state, IndexDescriptor descriptor ) throws IndexNotFoundKernelException;
/**
* Returns the failure description of a failed index.
*/
String indexGetFailure( Statement state, IndexDescriptor descriptor ) throws IndexNotFoundKernelException;
/**
* Get all constraints applicable to label and propertyKey. There are only {@link UniquenessConstraint}
* for the time being.
*/
Iterator<UniquenessConstraint> constraintsGetForLabelAndPropertyKey( KernelStatement state, int labelId, int propertyKeyId );
/**
* Get all constraints applicable to label. There are only {@link UniquenessConstraint}
* for the time being.
*/
Iterator<UniquenessConstraint> constraintsGetForLabel( KernelStatement state, int labelId );
/**
* Get all constraints. There are only {@link UniquenessConstraint}
* for the time being.
*/
Iterator<UniquenessConstraint> constraintsGetAll( KernelStatement state );
/**
* Get the owning constraint for a constraint index. Returns null if the index does not have an owning constraint.
*/
Long indexGetOwningUniquenessConstraintId( KernelStatement state, IndexDescriptor index ) throws SchemaRuleNotFoundException;
/**
* Get the index id (the id or the schema rule record) for a committed index
* - throws exception for indexes that aren't committed.
*/
long indexGetCommittedId( KernelStatement state, IndexDescriptor index, SchemaStorage.IndexRuleKind constraint ) throws SchemaRuleNotFoundException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_SchemaReadOperations.java
|
6,387
|
public interface SchemaStateOperations
{
/**
* The schema state is flushed when ever the schema is updated. If you build objects
* the rely on the current state of the schema, use this to make sure you don't use
* outdated schema information.
*
* Additionally, schema state entries are evicted using an LRU policy. The size
* of the LRU cache is determined by GraphDatabaseSettings.query_cache_size
*
* NOTE: This currently is solely used by Cypher and might or might not be turned into
* a more generic facility in teh future
*/
<K, V> V schemaStateGetOrCreate( KernelStatement state, K key, Function<K, V> creator );
/**
* Check if some key is in the schema state.
*/
<K> boolean schemaStateContains( KernelStatement state, K key );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_SchemaStateOperations.java
|
6,388
|
public interface SchemaWriteOperations
{
/**
* Creates an index, indexing properties with the given {@code propertyKeyId} for nodes with the given
* {@code labelId}.
*/
IndexDescriptor indexCreate( KernelStatement state, int labelId, int propertyKeyId )
throws AddIndexFailureException, AlreadyIndexedException, AlreadyConstrainedException;
/** Drops a {@link IndexDescriptor} from the database */
void indexDrop( KernelStatement state, IndexDescriptor descriptor ) throws DropIndexFailureException;
/**
* This should not be used, it is exposed to allow an external job to clean up constraint indexes.
* That external job should become an internal job, at which point this operation should go away.
*/
void uniqueIndexDrop( KernelStatement state, IndexDescriptor descriptor ) throws DropIndexFailureException;
UniquenessConstraint uniquenessConstraintCreate( KernelStatement state, int labelId, int propertyKeyId )
throws AlreadyConstrainedException, CreateConstraintFailureException, AlreadyIndexedException;
void constraintDrop( KernelStatement state, UniquenessConstraint constraint ) throws DropConstraintFailureException;
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_SchemaWriteOperations.java
|
6,389
|
public interface WriteOperations extends KeyWriteOperations, EntityWriteOperations, SchemaWriteOperations
{
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_operations_WriteOperations.java
|
6,390
|
public interface NoDependencies
{ // No dependencies
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_api_scan_InMemoryLabelScanStoreExtension.java
|
6,391
|
public interface FullStoreChangeStream extends Iterable<NodeLabelUpdate>
{
PrimitiveLongIterator labelIds();
long highestNodeId();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_scan_LabelScanStoreProvider.java
|
6,392
|
public interface OldTxStateBridge
{
/**
* A diff set of nodes that have had the given property key and value added or removed/changed.
*/
DiffSets<Long> getNodesWithChangedProperty( int propertyKey, Object value );
void deleteNode( long nodeId );
boolean nodeIsAddedInThisTx( long nodeId );
boolean hasChanges();
void deleteRelationship( long relationshipId );
boolean relationshipIsAddedInThisTx( long relationshipId );
void nodeSetProperty( long nodeId, DefinedProperty property );
void relationshipSetProperty( long relationshipId, DefinedProperty property );
void graphSetProperty( DefinedProperty property );
void nodeRemoveProperty( long nodeId, DefinedProperty removedProperty );
void relationshipRemoveProperty( long relationshipId, DefinedProperty removedProperty );
void graphRemoveProperty( DefinedProperty removedProperty );
Map<Long, Object> getNodesWithChangedProperty( int propertyKeyId );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_state_OldTxStateBridge.java
|
6,393
|
private interface ExceptionExpectingFunction<E extends Exception>
{
void call() throws E;
}
| false
|
community_kernel_src_test_java_org_neo4j_kernel_impl_api_state_SchemaTransactionStateTest.java
|
6,394
|
public interface TxState
{
public enum UpdateTriState
{
ADDED
{
@Override
public boolean isTouched()
{
return true;
}
@Override
public boolean isAdded()
{
return true;
}
},
REMOVED
{
@Override
public boolean isTouched()
{
return true;
}
@Override
public boolean isAdded()
{
return false;
}
},
UNTOUCHED
{
@Override
public boolean isTouched()
{
return false;
}
@Override
public boolean isAdded()
{
throw new UnsupportedOperationException( "Cannot convert an UNTOUCHED UpdateTriState to a boolean" );
}
};
public abstract boolean isTouched();
public abstract boolean isAdded();
}
public interface Holder
{
TxState txState();
boolean hasTxState();
boolean hasTxStateWithChanges();
}
/**
* Ability to generate the leaking id types (node ids and relationship ids).
*/
public interface IdGeneration
{
long newNodeId();
long newRelationshipId();
}
public interface Visitor
{
void visitNodeLabelChanges( long id, Set<Integer> added, Set<Integer> removed );
void visitAddedIndex( IndexDescriptor element, boolean isConstraintIndex );
void visitRemovedIndex( IndexDescriptor element, boolean isConstraintIndex );
void visitAddedConstraint( UniquenessConstraint element );
void visitRemovedConstraint( UniquenessConstraint element );
}
public abstract boolean hasChanges();
public abstract void accept( Visitor visitor );
// ENTITY RELATED
public abstract Iterable<NodeState> nodeStates();
public abstract DiffSets<Long> labelStateNodeDiffSets( int labelId );
public abstract DiffSets<Integer> nodeStateLabelDiffSets( long nodeId );
public abstract DiffSets<DefinedProperty> nodePropertyDiffSets( long nodeId );
public abstract DiffSets<DefinedProperty> relationshipPropertyDiffSets( long relationshipId );
public abstract DiffSets<DefinedProperty> graphPropertyDiffSets();
/** Returns all nodes that, in this tx, have had labelId added. */
public abstract Set<Long> nodesWithLabelAdded( int labelId );
/** Returns all nodes that, in this tx, have had labelId removed. */
public abstract DiffSets<Long> nodesWithLabelChanged( int labelId );
// Temporary: Should become DiffSets<Long> of all node changes, not just deletions
public abstract DiffSets<Long> nodesDeletedInTx();
public abstract boolean nodeIsAddedInThisTx( long nodeId );
public abstract boolean nodeIsDeletedInThisTx( long nodeId );
public abstract DiffSets<Long> nodesWithChangedProperty( int propertyKeyId, Object value );
public abstract Map<Long, Object> nodesWithChangedProperty( int propertyKeyId );
public abstract boolean relationshipIsAddedInThisTx( long relationshipId );
public abstract boolean relationshipIsDeletedInThisTx( long relationshipId );
public abstract UpdateTriState labelState( long nodeId, int labelId );
public abstract void relationshipDoDelete( long relationshipId );
public abstract void nodeDoDelete( long nodeId );
public abstract void nodeDoReplaceProperty( long nodeId, Property replacedProperty, DefinedProperty newProperty );
public abstract void relationshipDoReplaceProperty( long relationshipId,
Property replacedProperty, DefinedProperty newProperty );
public abstract void graphDoReplaceProperty( Property replacedProperty, DefinedProperty newProperty );
public abstract void nodeDoRemoveProperty( long nodeId, Property removedProperty );
public abstract void relationshipDoRemoveProperty( long relationshipId, Property removedProperty );
public abstract void graphDoRemoveProperty( Property removedProperty );
public abstract void nodeDoAddLabel( int labelId, long nodeId );
public abstract void nodeDoRemoveLabel( int labelId, long nodeId );
// SCHEMA RELATED
public abstract DiffSets<IndexDescriptor> indexDiffSetsByLabel( int labelId );
public abstract DiffSets<IndexDescriptor> constraintIndexDiffSetsByLabel( int labelId );
public abstract DiffSets<IndexDescriptor> indexChanges();
public abstract DiffSets<IndexDescriptor> constraintIndexChanges();
public abstract Iterable<IndexDescriptor> constraintIndexesCreatedInTx();
public abstract DiffSets<UniquenessConstraint> constraintsChanges();
public abstract DiffSets<UniquenessConstraint> constraintsChangesForLabel( int labelId );
public abstract DiffSets<UniquenessConstraint> constraintsChangesForLabelAndProperty( int labelId,
int propertyKey );
public abstract void indexRuleDoAdd( IndexDescriptor descriptor );
public abstract void constraintIndexRuleDoAdd( IndexDescriptor descriptor );
public abstract void indexDoDrop( IndexDescriptor descriptor );
public abstract void constraintIndexDoDrop( IndexDescriptor descriptor );
public abstract void constraintDoAdd( UniquenessConstraint constraint, long indexId );
public abstract void constraintDoDrop( UniquenessConstraint constraint );
public abstract boolean constraintDoUnRemove( UniquenessConstraint constraint );
boolean constraintIndexDoUnRemove( IndexDescriptor index );
Long indexCreatedForConstraint( UniquenessConstraint constraint );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_state_TxState.java
|
6,395
|
public interface Holder
{
TxState txState();
boolean hasTxState();
boolean hasTxStateWithChanges();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_state_TxState.java
|
6,396
|
public interface IdGeneration
{
long newNodeId();
long newRelationshipId();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_state_TxState.java
|
6,397
|
public enum UpdateTriState
{
ADDED
{
@Override
public boolean isTouched()
{
return true;
}
@Override
public boolean isAdded()
{
return true;
}
},
REMOVED
{
@Override
public boolean isTouched()
{
return true;
}
@Override
public boolean isAdded()
{
return false;
}
},
UNTOUCHED
{
@Override
public boolean isTouched()
{
return false;
}
@Override
public boolean isAdded()
{
throw new UnsupportedOperationException( "Cannot convert an UNTOUCHED UpdateTriState to a boolean" );
}
};
public abstract boolean isTouched();
public abstract boolean isAdded();
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_state_TxState.java
|
6,398
|
public interface Visitor
{
void visitNodeLabelChanges( long id, Set<Integer> added, Set<Integer> removed );
void visitAddedIndex( IndexDescriptor element, boolean isConstraintIndex );
void visitRemovedIndex( IndexDescriptor element, boolean isConstraintIndex );
void visitAddedConstraint( UniquenessConstraint element );
void visitRemovedConstraint( UniquenessConstraint element );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_state_TxState.java
|
6,399
|
private interface StateCreator<STATE>
{
STATE newState( long id );
}
| false
|
community_kernel_src_main_java_org_neo4j_kernel_impl_api_state_TxStateImpl.java
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.