-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
TransactionRecordState.java
612 lines (557 loc) · 25 KB
/
TransactionRecordState.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
/*
* Copyright (c) 2002-2016 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.impl.transaction.state;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import org.neo4j.kernel.api.KernelTransaction;
import org.neo4j.kernel.api.exceptions.TransactionFailureException;
import org.neo4j.kernel.api.properties.DefinedProperty;
import org.neo4j.kernel.api.properties.Property;
import org.neo4j.kernel.impl.core.RelationshipTypeToken;
import org.neo4j.kernel.impl.store.MetaDataStore;
import org.neo4j.kernel.impl.store.NeoStores;
import org.neo4j.kernel.impl.store.NodeStore;
import org.neo4j.kernel.impl.store.PropertyStore;
import org.neo4j.kernel.impl.store.RecordStore;
import org.neo4j.kernel.impl.store.RelationshipStore;
import org.neo4j.kernel.impl.store.SchemaStore;
import org.neo4j.kernel.impl.store.record.AbstractBaseRecord;
import org.neo4j.kernel.impl.store.record.DynamicRecord;
import org.neo4j.kernel.impl.store.record.IndexRule;
import org.neo4j.kernel.impl.store.record.LabelTokenRecord;
import org.neo4j.kernel.impl.store.record.NeoStoreRecord;
import org.neo4j.kernel.impl.store.record.NodeRecord;
import org.neo4j.kernel.impl.store.record.PrimitiveRecord;
import org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord;
import org.neo4j.kernel.impl.store.record.PropertyRecord;
import org.neo4j.kernel.impl.store.record.Record;
import org.neo4j.kernel.impl.store.record.RelationshipGroupRecord;
import org.neo4j.kernel.impl.store.record.RelationshipRecord;
import org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord;
import org.neo4j.kernel.impl.store.record.SchemaRecord;
import org.neo4j.kernel.impl.transaction.command.Command;
import org.neo4j.kernel.impl.transaction.command.Command.Mode;
import org.neo4j.kernel.impl.transaction.state.RecordAccess.RecordProxy;
import org.neo4j.kernel.impl.util.statistics.IntCounter;
import org.neo4j.storageengine.api.StorageCommand;
import org.neo4j.storageengine.api.StorageProperty;
import org.neo4j.storageengine.api.Token;
import org.neo4j.storageengine.api.lock.ResourceLocker;
import org.neo4j.storageengine.api.schema.SchemaRule;
import static org.neo4j.kernel.impl.store.NodeLabelsField.parseLabelsField;
/**
* Transaction containing {@link org.neo4j.kernel.impl.transaction.command.Command commands} reflecting the operations
* performed in the transaction.
*
* This class currently has a symbiotic relationship with {@link KernelTransaction}, with which it always has a 1-1
* relationship.
*
* The idea here is that KernelTransaction will eventually take on the responsibilities of WriteTransaction, such as
* keeping track of transaction state, serialization and deserialization to and from logical log, and applying things
* to store. It would most likely do this by keeping a component derived from the current WriteTransaction
* implementation as a sub-component, responsible for handling logical log commands.
*
* The class XAResourceManager plays in here as well, in that it shares responsibilities with WriteTransaction to
* write data to the logical log. As we continue to refactor this subsystem, XAResourceManager should ideally not know
* about the logical log, but defer entirely to the Kernel to handle this. Doing that will give the kernel full
* discretion to start experimenting with higher-performing logical log implementations, without being hindered by
* having to contend with the JTA compliance layers. In short, it would encapsulate the logical log/storage logic better
* and thus make it easier to change.
*/
public class TransactionRecordState implements RecordState
{
private static final Command[] EMPTY_COMMANDS = new Command[0];
private final NeoStores neoStores;
private final IntegrityValidator integrityValidator;
private final NodeStore nodeStore;
private final RelationshipStore relationshipStore;
private final PropertyStore propertyStore;
private final RecordStore<RelationshipGroupRecord> relationshipGroupStore;
private final MetaDataStore metaDataStore;
private final SchemaStore schemaStore;
private final RecordAccessSet recordChangeSet;
private final long lastCommittedTxWhenTransactionStarted;
private final ResourceLocker locks;
private final RelationshipCreator relationshipCreator;
private final RelationshipDeleter relationshipDeleter;
private final PropertyCreator propertyCreator;
private final PropertyDeleter propertyDeleter;
private RecordChanges<Long,NeoStoreRecord, Void> neoStoreRecord;
private boolean prepared;
public TransactionRecordState( NeoStores neoStores, IntegrityValidator integrityValidator,
RecordChangeSet recordChangeSet, long lastCommittedTxWhenTransactionStarted,
ResourceLocker locks,
RelationshipCreator relationshipCreator,
RelationshipDeleter relationshipDeleter,
PropertyCreator propertyCreator,
PropertyDeleter propertyDeleter )
{
this.neoStores = neoStores;
this.nodeStore = neoStores.getNodeStore();
this.relationshipStore = neoStores.getRelationshipStore();
this.propertyStore = neoStores.getPropertyStore();
this.relationshipGroupStore = neoStores.getRelationshipGroupStore();
this.metaDataStore = neoStores.getMetaDataStore();
this.schemaStore = neoStores.getSchemaStore();
this.integrityValidator = integrityValidator;
this.recordChangeSet = recordChangeSet;
this.lastCommittedTxWhenTransactionStarted = lastCommittedTxWhenTransactionStarted;
this.locks = locks;
this.relationshipCreator = relationshipCreator;
this.relationshipDeleter = relationshipDeleter;
this.propertyCreator = propertyCreator;
this.propertyDeleter = propertyDeleter;
}
@Override
public boolean hasChanges()
{
return recordChangeSet.hasChanges() ||
(neoStoreRecord != null && neoStoreRecord.changeSize() > 0);
}
@Override
public void extractCommands( Collection<StorageCommand> commands ) throws TransactionFailureException
{
assert !prepared : "Transaction has already been prepared";
integrityValidator.validateTransactionStartKnowledge( lastCommittedTxWhenTransactionStarted );
int noOfCommands = recordChangeSet.changeSize() +
(neoStoreRecord != null ? neoStoreRecord.changeSize() : 0);
for ( RecordProxy<Integer, LabelTokenRecord, Void> record : recordChangeSet.getLabelTokenChanges().changes() )
{
commands.add( new Command.LabelTokenCommand( record.getBefore(), record.forReadingLinkage() ) );
}
for ( RecordProxy<Integer, RelationshipTypeTokenRecord, Void> record :
recordChangeSet.getRelationshipTypeTokenChanges().changes() )
{
commands.add( new Command.RelationshipTypeTokenCommand( record.getBefore(), record.forReadingLinkage() ) );
}
for ( RecordProxy<Integer, PropertyKeyTokenRecord, Void> record :
recordChangeSet.getPropertyKeyTokenChanges().changes() )
{
commands.add( new Command.PropertyKeyTokenCommand( record.getBefore(), record.forReadingLinkage() ) );
}
// Collect nodes, relationships, properties
Command[] nodeCommands = EMPTY_COMMANDS;
if ( recordChangeSet.getNodeRecords().changeSize() > 0 )
{
nodeCommands = new Command[recordChangeSet.getNodeRecords().changeSize()];
int i = 0;
for ( RecordProxy<Long, NodeRecord, Void> change : recordChangeSet.getNodeRecords().changes() )
{
NodeRecord record = prepared( change, nodeStore );
integrityValidator.validateNodeRecord( record );
nodeCommands[i++] = new Command.NodeCommand( change.getBefore(), record );
}
Arrays.sort( nodeCommands, COMMAND_SORTER );
}
Command[] relCommands = EMPTY_COMMANDS;
if ( recordChangeSet.getRelRecords().changeSize() > 0 )
{
relCommands = new Command[recordChangeSet.getRelRecords().changeSize()];
int i = 0;
for ( RecordProxy<Long, RelationshipRecord, Void> change : recordChangeSet.getRelRecords().changes() )
{
relCommands[i++] = new Command.RelationshipCommand( change.getBefore(),
prepared( change, relationshipStore ) );
}
Arrays.sort( relCommands, COMMAND_SORTER );
}
Command[] propCommands = EMPTY_COMMANDS;
if ( recordChangeSet.getPropertyRecords().changeSize() > 0 )
{
propCommands = new Command[recordChangeSet.getPropertyRecords().changeSize()];
int i = 0;
for ( RecordProxy<Long, PropertyRecord, PrimitiveRecord> change :
recordChangeSet.getPropertyRecords().changes() )
{
propCommands[i++] = new Command.PropertyCommand( change.getBefore(),
prepared( change, propertyStore ) );
}
Arrays.sort( propCommands, COMMAND_SORTER );
}
Command[] relGroupCommands = EMPTY_COMMANDS;
if ( recordChangeSet.getRelGroupRecords().changeSize() > 0 )
{
relGroupCommands = new Command[recordChangeSet.getRelGroupRecords().changeSize()];
int i = 0;
for ( RecordProxy<Long, RelationshipGroupRecord, Integer> change :
recordChangeSet.getRelGroupRecords().changes() )
{
relGroupCommands[i++] = new Command.RelationshipGroupCommand( change.getBefore(),
prepared( change, relationshipGroupStore ) );
}
Arrays.sort( relGroupCommands, COMMAND_SORTER );
}
addFiltered( commands, Mode.CREATE, propCommands, relCommands, relGroupCommands, nodeCommands );
addFiltered( commands, Mode.UPDATE, propCommands, relCommands, relGroupCommands, nodeCommands );
addFiltered( commands, Mode.DELETE, propCommands, relCommands, relGroupCommands, nodeCommands );
if ( neoStoreRecord != null )
{
for ( RecordProxy<Long,NeoStoreRecord, Void> change : neoStoreRecord.changes() )
{
commands.add( new Command.NeoStoreCommand( change.getBefore(), change.forReadingData() ) );
}
}
for ( RecordProxy<Long, SchemaRecord, SchemaRule> change : recordChangeSet.getSchemaRuleChanges().changes() )
{
integrityValidator.validateSchemaRule( change.getAdditionalData() );
commands.add( new Command.SchemaRuleCommand(
change.getBefore(), change.forChangingData(), change.getAdditionalData() ) );
}
assert commands.size() == noOfCommands : "Expected " + noOfCommands + " final commands, got "
+ commands.size() + " instead";
prepared = true;
}
private <RECORD extends AbstractBaseRecord> RECORD prepared(
RecordProxy<?,RECORD,?> proxy, RecordStore<RECORD> store )
{
RECORD after = proxy.forReadingLinkage();
store.prepareForCommit( after );
return after;
}
public void relCreate( long id, int typeId, long startNodeId, long endNodeId )
{
relationshipCreator.relationshipCreate( id, typeId, startNodeId, endNodeId, recordChangeSet, locks );
}
public void relDelete( long relId )
{
relationshipDeleter.relDelete( relId, recordChangeSet, locks );
}
@SafeVarargs
private final void addFiltered( Collection<StorageCommand> target, Mode mode,
Command[]... commands )
{
for ( Command[] c : commands )
{
for ( Command command : c )
{
if ( command.getMode() == mode )
{
target.add( command );
}
}
}
}
/**
* Deletes a node by its id, returning its properties which are now removed.
*
* @param nodeId The id of the node to delete.
*/
public void nodeDelete( long nodeId )
{
NodeRecord nodeRecord = recordChangeSet.getNodeRecords().getOrLoad( nodeId, null ).forChangingData();
if ( !nodeRecord.inUse() )
{
throw new IllegalStateException( "Unable to delete Node[" + nodeId +
"] since it has already been deleted." );
}
nodeRecord.setInUse( false );
nodeRecord.setLabelField( Record.NO_LABELS_FIELD.intValue(),
markNotInUse( nodeRecord.getDynamicLabelRecords() ) );
getAndDeletePropertyChain( nodeRecord );
}
private Collection<DynamicRecord> markNotInUse( Collection<DynamicRecord> dynamicLabelRecords )
{
for ( DynamicRecord record : dynamicLabelRecords )
{
record.setInUse( false );
}
return dynamicLabelRecords;
}
private void getAndDeletePropertyChain( NodeRecord nodeRecord )
{
propertyDeleter.deletePropertyChain( nodeRecord, recordChangeSet.getPropertyRecords() );
}
/**
* Removes the given property identified by its index from the relationship
* with the given id.
*
* @param relId The id of the relationship that is to have the property
* removed.
* @param propertyKey The index key of the property.
*/
public void relRemoveProperty( long relId, int propertyKey )
{
RecordProxy<Long, RelationshipRecord, Void> rel = recordChangeSet.getRelRecords().getOrLoad( relId, null );
propertyDeleter.removeProperty( rel, propertyKey, recordChangeSet.getPropertyRecords() );
}
/**
* Removes the given property identified by indexKeyId of the node with the
* given id.
*
* @param nodeId The id of the node that is to have the property removed.
* @param propertyKey The index key of the property.
*/
public void nodeRemoveProperty( long nodeId, int propertyKey )
{
RecordProxy<Long, NodeRecord, Void> node = recordChangeSet.getNodeRecords().getOrLoad( nodeId, null );
propertyDeleter.removeProperty( node, propertyKey, recordChangeSet.getPropertyRecords() );
}
/**
* Changes an existing property's value of the given relationship, with the
* given index to the passed value
*
* @param relId The id of the relationship which holds the property to
* change.
* @param propertyKey The index of the key of the property to change.
* @param value The new value of the property.
* @return The changed property, as a PropertyData object.
*/
public DefinedProperty relChangeProperty( long relId, int propertyKey, Object value )
{
RecordProxy<Long, RelationshipRecord, Void> rel = recordChangeSet.getRelRecords().getOrLoad( relId, null );
propertyCreator.primitiveChangeProperty( rel, propertyKey, value, recordChangeSet.getPropertyRecords() );
return Property.property( propertyKey, value );
}
/**
* Changes an existing property of the given node, with the given index to
* the passed value
*
* @param nodeId The id of the node which holds the property to change.
* @param propertyKey The index of the key of the property to change.
* @param value The new value of the property.
* @return The changed property, as a PropertyData object.
*/
public DefinedProperty nodeChangeProperty( long nodeId, int propertyKey, Object value )
{
RecordProxy<Long, NodeRecord, Void> node = recordChangeSet.getNodeRecords().getOrLoad( nodeId, null );
propertyCreator.primitiveChangeProperty( node, propertyKey, value, recordChangeSet.getPropertyRecords() );
return Property.property( propertyKey, value );
}
/**
* Adds a property to the given relationship, with the given index and
* value.
*
* @param relId The id of the relationship to which to add the property.
* @param propertyKey The index of the key of the property to add.
* @param value The value of the property.
* @return The added property, as a PropertyData object.
*/
public DefinedProperty relAddProperty( long relId, int propertyKey, Object value )
{
RecordProxy<Long, RelationshipRecord, Void> rel = recordChangeSet.getRelRecords().getOrLoad( relId, null );
propertyCreator.primitiveAddProperty( rel, propertyKey, value, recordChangeSet.getPropertyRecords() );
return Property.property( propertyKey, value );
}
/**
* Adds a property to the given node, with the given index and value.
*
* @param nodeId The id of the node to which to add the property.
* @param propertyKey The index of the key of the property to add.
* @param value The value of the property.
* @return The added property, as a PropertyData object.
*/
public DefinedProperty nodeAddProperty( long nodeId, int propertyKey, Object value )
{
RecordProxy<Long, NodeRecord, Void> node = recordChangeSet.getNodeRecords().getOrLoad( nodeId, null );
propertyCreator.primitiveAddProperty( node, propertyKey, value, recordChangeSet.getPropertyRecords() );
return Property.property( propertyKey, value );
}
/**
* Creates a node for the given id
*
* @param nodeId The id of the node to create.
*/
public void nodeCreate( long nodeId )
{
NodeRecord nodeRecord = recordChangeSet.getNodeRecords().create( nodeId, null ).forChangingData();
nodeRecord.setInUse( true );
nodeRecord.setCreated();
}
/**
* Creates a property index entry out of the given id and string.
*
* @param key The key of the property index, as a string.
* @param id The property index record id.
*/
public void createPropertyKeyToken( String key, int id )
{
TokenCreator<PropertyKeyTokenRecord, Token> creator =
new TokenCreator<>( neoStores.getPropertyKeyTokenStore() );
creator.createToken( key, id, recordChangeSet.getPropertyKeyTokenChanges() );
}
/**
* Creates a property index entry out of the given id and string.
*
* @param name The key of the property index, as a string.
* @param id The property index record id.
*/
public void createLabelToken( String name, int id )
{
TokenCreator<LabelTokenRecord, Token> creator =
new TokenCreator<>( neoStores.getLabelTokenStore() );
creator.createToken( name, id, recordChangeSet.getLabelTokenChanges() );
}
/**
* Creates a new RelationshipType record with the given id that has the
* given name.
*
* @param name The name of the relationship type.
* @param id The id of the new relationship type record.
*/
public void createRelationshipTypeToken( String name, int id )
{
TokenCreator<RelationshipTypeTokenRecord, RelationshipTypeToken> creator =
new TokenCreator<>( neoStores.getRelationshipTypeTokenStore() );
creator.createToken( name, id, recordChangeSet.getRelationshipTypeTokenChanges() );
}
private static class CommandSorter implements Comparator<Command>
{
@Override
public int compare( Command o1, Command o2 )
{
long id1 = o1.getKey();
long id2 = o2.getKey();
long diff = id1 - id2;
if ( diff > Integer.MAX_VALUE )
{
return Integer.MAX_VALUE;
}
else if ( diff < Integer.MIN_VALUE )
{
return Integer.MIN_VALUE;
}
else
{
return (int) diff;
}
}
@Override
public boolean equals( Object o )
{
return o instanceof CommandSorter;
}
@Override
public int hashCode()
{
return 3217;
}
}
private static final CommandSorter COMMAND_SORTER = new CommandSorter();
private RecordProxy<Long,NeoStoreRecord, Void> getOrLoadNeoStoreRecord()
{
// TODO Move this neo store record thingie into RecordAccessSet
if ( neoStoreRecord == null )
{
neoStoreRecord = new RecordChanges<>( new RecordChanges.Loader<Long,NeoStoreRecord, Void>()
{
@Override
public NeoStoreRecord newUnused( Long key, Void additionalData )
{
throw new UnsupportedOperationException();
}
@Override
public NeoStoreRecord load( Long key, Void additionalData )
{
return metaDataStore.graphPropertyRecord();
}
@Override
public void ensureHeavy( NeoStoreRecord record )
{
}
@Override
public NeoStoreRecord clone( NeoStoreRecord neoStoreRecord )
{
return neoStoreRecord.clone();
}
}, new IntCounter() );
}
return neoStoreRecord.getOrLoad( 0L, null );
}
/**
* Adds a property to the graph, with the given index and value.
*
* @param propertyKey The index of the key of the property to add.
* @param value The value of the property.
* @return The added property, as a PropertyData object.
*/
public DefinedProperty graphAddProperty( int propertyKey, Object value )
{
propertyCreator.primitiveAddProperty( getOrLoadNeoStoreRecord(), propertyKey, value,
recordChangeSet.getPropertyRecords() );
return Property.property( propertyKey, value );
}
/**
* Changes an existing property of the graph, with the given index to
* the passed value
*
* @param propertyKey The index of the key of the property to change.
* @param value The new value of the property.
* @return The changed property, as a PropertyData object.
*/
public DefinedProperty graphChangeProperty( int propertyKey, Object value )
{
propertyCreator.primitiveChangeProperty( getOrLoadNeoStoreRecord(), propertyKey, value,
recordChangeSet.getPropertyRecords() );
return Property.property( propertyKey, value );
}
/**
* Removes the given property identified by indexKeyId of the graph with the
* given id.
*
* @param propertyKey The index key of the property.
*/
public void graphRemoveProperty( int propertyKey )
{
RecordProxy<Long,NeoStoreRecord, Void> recordChange = getOrLoadNeoStoreRecord();
propertyDeleter.removeProperty( recordChange, propertyKey, recordChangeSet.getPropertyRecords() );
}
public void createSchemaRule( SchemaRule schemaRule )
{
for( DynamicRecord change : recordChangeSet.getSchemaRuleChanges()
.create( schemaRule.getId(), schemaRule ).forChangingData() )
{
change.setInUse( true );
change.setCreated();
}
}
public void dropSchemaRule( SchemaRule rule )
{
RecordProxy<Long, SchemaRecord, SchemaRule> change =
recordChangeSet.getSchemaRuleChanges().getOrLoad( rule.getId(), rule );
SchemaRecord records = change.forChangingData();
for ( DynamicRecord record : records )
{
record.setInUse( false );
}
}
public void addLabelToNode( int labelId, long nodeId )
{
NodeRecord nodeRecord = recordChangeSet.getNodeRecords().getOrLoad( nodeId, null ).forChangingData();
parseLabelsField( nodeRecord ).add( labelId, nodeStore, nodeStore.getDynamicLabelStore() );
}
public void removeLabelFromNode( int labelId, long nodeId )
{
NodeRecord nodeRecord = recordChangeSet.getNodeRecords().getOrLoad( nodeId, null ).forChangingData();
parseLabelsField( nodeRecord ).remove( labelId, nodeStore );
}
public void setConstraintIndexOwner( IndexRule indexRule, long constraintId )
{
RecordProxy<Long, SchemaRecord, SchemaRule> change =
recordChangeSet.getSchemaRuleChanges().getOrLoad( indexRule.getId(), indexRule );
SchemaRecord records = change.forChangingData();
indexRule = indexRule.withOwningConstraint( constraintId );
records.setDynamicRecords( schemaStore.allocateFrom( indexRule ) );
}
public interface PropertyReceiver<P extends StorageProperty>
{
void receive( P property, long propertyRecordId );
}
}