static long indexEntryResourceId_2_2_0( long labelId, IndexQuery.ExactPredicate[] predicates ) { return indexEntryResourceId_2_2_0( labelId, predicates, 0 ); }
/** * This is the schema index entry hashing method used since 2.2.0 and onwards. * <p> * Use the {@link ResourceTypes#useStrongHashing} feature toggle to use a stronger hash function, which will become * the default in a future release. <strong>Note</strong> that changing this hash function is effectively a * clustering protocol change in HA setups. Causal cluster setups are unaffected because followers do not take any * locks on the cluster leader. */ public static long indexEntryResourceId( long labelId, IndexQuery.ExactPredicate... predicates ) { if ( !useStrongHashing ) { // Default return indexEntryResourceId_2_2_0( labelId, predicates ); } else { // Opt-in return indexEntryResourceId_4_x( labelId, predicates ); } }
private static long indexEntryResourceId_2_2_0( long labelId, IndexQuery.ExactPredicate[] predicates, int i ) { int propertyKeyId = predicates[i].propertyKeyId(); Value value = predicates[i].value(); // Note: // It is important that single-property indexes only hash with this particular call; no additional hashing! long hash = indexEntryResourceId_2_2_0( labelId, propertyKeyId, stringOf( value ) ); i++; if ( i < predicates.length ) { hash = hash( hash + indexEntryResourceId_2_2_0( labelId, predicates, i ) ); } return hash; }
static long indexEntryResourceId_2_2_0( long labelId, IndexQuery.ExactPredicate[] predicates ) { return indexEntryResourceId_2_2_0( labelId, predicates, 0 ); }
/** * This is the schema index entry hashing method used since 2.2.0 and onwards. * <p> * Use the {@link ResourceTypes#useStrongHashing} feature toggle to use a stronger hash function, which will become * the default in a future release. <strong>Note</strong> that changing this hash function is effectively a * clustering protocol change in HA setups. Causal cluster setups are unaffected because followers do not take any * locks on the cluster leader. */ public static long indexEntryResourceId( long labelId, IndexQuery.ExactPredicate... predicates ) { if ( !useStrongHashing ) { // Default return indexEntryResourceId_2_2_0( labelId, predicates ); } else { // Opt-in return indexEntryResourceId_4_x( labelId, predicates ); } }
private static long indexEntryResourceId_2_2_0( long labelId, IndexQuery.ExactPredicate[] predicates, int i ) { int propertyKeyId = predicates[i].propertyKeyId(); Value value = predicates[i].value(); // Note: // It is important that single-property indexes only hash with this particular call; no additional hashing! long hash = indexEntryResourceId_2_2_0( labelId, propertyKeyId, stringOf( value ) ); i++; if ( i < predicates.length ) { hash = hash( hash + indexEntryResourceId_2_2_0( labelId, predicates, i ) ); } return hash; }