public void setLastTransactionCommitTimestamp( long timestamp ) { // Preventing race with transactionCommitted() and assure record is consistent with highestCommittedTransaction synchronized ( transactionCommittedLock ) { setRecord( Position.LAST_TRANSACTION_COMMIT_TIMESTAMP, timestamp ); TransactionId transactionId = highestCommittedTransaction.get(); highestCommittedTransaction.set( transactionId.transactionId(), transactionId.checksum(), timestamp ); } }
public PropertyValueRecordSizeCalculator( PropertyStore propertyStore ) { this( propertyStore.getRecordSize(), propertyStore.getStringStore().getRecordSize(), propertyStore.getStringStore().getRecordDataSize(), propertyStore.getArrayStore().getRecordSize(), propertyStore.getArrayStore().getRecordDataSize() ); }
private static boolean encodeWithCharSet( int keyId, String string, PropertyBlock target, int payloadSize, int stringLength ) { int maxBytes = PropertyType.getPayloadSize(); if ( stringLength <= maxBytes - 5 ) { return encodeLatin1( keyId, string, target ) || encodeUTF8( keyId, string, target, payloadSize ); } return false; }
void updateCorrespondingIdGenerators( NeoStores neoStores ) { neoStores.getNodeStore().setHighestPossibleIdInUse( nodeId ); neoStores.getRelationshipStore().setHighestPossibleIdInUse( relId ); neoStores.getRelationshipGroupStore().setHighestPossibleIdInUse( relGroupId ); } }
private DynamicArrayStore createDynamicArrayStore() { neoStores = storeFactory.openAllNeoStores( true ); return neoStores.getPropertyStore().getArrayStore(); }
RelationshipCounts( StoreAccess storeAccess, MutableObjectLongMap<CountsKey> counts, Predicate<RelationshipRecord> countUpdateCondition, OwningRecordCheck<RelationshipRecord,RelationshipConsistencyReport> inner ) { this.nodeStore = storeAccess.getRawNeoStores().getNodeStore(); this.counts = counts; this.countUpdateCondition = countUpdateCondition; this.inner = inner; }
/** * Open {@link NeoStores} with all possible stores. If some store does not exist it will <b>not</b> be created. * @return container with all opened stores */ public NeoStores openAllNeoStores() { return openNeoStores( false, StoreType.values() ); }
@Override public long getGraphPropertyReference() { return neoStores.getMetaDataStore().getGraphNextProp(); }
Scan( RecordStore<R> store, boolean forward, final Predicate<? super R>... filters ) { this.filters = filters; this.ids = new StoreIdIterator( store, forward ); this.store = store; this.cursor = store.openPageCursorForReading( 0 ); this.record = store.newRecord(); }
@SuppressWarnings( "unchecked" ) public <RECORD extends AbstractBaseRecord> RecordStore<RECORD> getRecordStore( StoreType type ) { assert type.isRecordStore(); return (RecordStore<RECORD>) getStore( type ); }
private long dynamicStringRecordsInUse() { return propertyStore.getStringStore().getHighId(); } }
public void logIdUsage( Logger msgLog ) { visitStore( store -> { store.logIdUsage( msgLog ); return false; } ); }
@Override public String toString() { return super.toString() + "[blocksPerRecord:" + PropertyType.getPayloadSizeLongs() + "]"; }
public static PropertyType getPropertyTypeOrThrow( long propBlock ) { PropertyType type = getPropertyTypeOrNull( propBlock ); if ( type == null ) { throw new InvalidRecordException( "Unknown property type for type " + typeIdentifier( propBlock ) ); } return type; }
private <RECEIVER extends PropertyReceiver> void loadProperties( long nextProp, RECEIVER receiver ) { Collection<PropertyRecord> chain = pStore.getPropertyRecordChain( nextProp ); receivePropertyChain( receiver, chain ); }
@Override protected void checkAndLoadStorage( boolean createIfNotExists ) { super.checkAndLoadStorage( createIfNotExists ); initHighId(); }
@Override int encTranslate( byte b ) { // Punctuation is in the same places as European if ( b < 0x20 ) { return encPunctuation( b ); // Punctuation } // But the rest is transposed by 0x40 return EUROPEAN.encTranslate( b ) - 0x40; }
@Override public void updateRecord( PropertyRecord record ) { updatePropertyBlocks( record ); super.updateRecord( record ); }
@Override public DynamicRecord nextRecord() { return StandardDynamicRecordAllocator.allocateRecord( nextId() ); }
/** * Open {@link NeoStores} with all possible stores with a possibility to create store if it not exist. * @param createStoreIfNotExists - should store be created if it's not exist * @return container with all opened stores */ public NeoStores openAllNeoStores( boolean createStoreIfNotExists ) { return openNeoStores( createStoreIfNotExists, StoreType.values() ); }