public virtual RecordSet <RelationshipRecord> FindRelationshipChainsThatThisRecordShouldBelongTo(RelationshipRecord relationship) { RecordSet <RelationshipRecord> records = new RecordSet <RelationshipRecord>(); foreach (RelationshipNodeField field in RelationshipNodeField.values()) { long nodeId = field.get(relationship); _nodeStore.getRecord(nodeId, _nodeRecord, RecordLoad.FORCE); records.AddAll(_relationshipChainExplorer.followChainFromNode(nodeId, _nodeRecord.NextRel)); } return(records); }
public virtual void WarmUpCache() { int recordsPerPage = _store.RecordsPerPage; long id = 0; long half = _store.HighId / 2; RECORD record = _store.newRecord(); while (id < half) { _store.getRecord(id, record, FORCE); id += recordsPerPage - 1; } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private static void readStore(org.neo4j.io.fs.FileSystemAbstraction fileSystem, org.neo4j.kernel.impl.store.RecordStore store, long fromId, long toId, java.util.regex.Pattern pattern) throws java.io.IOException private static void ReadStore(FileSystemAbstraction fileSystem, RecordStore store, long fromId, long toId, Pattern pattern) { toId = Math.Min(toId, store.HighId); using (StoreChannel channel = fileSystem.Open(store.StorageFile, OpenMode.READ)) { int recordSize = store.RecordSize; ByteBuffer buf = ByteBuffer.allocate(recordSize); for (long i = fromId; i <= toId; i++) { buf.clear(); long offset = recordSize * i; int count = channel.Read(buf, offset); if (count == -1) { break; } sbyte[] bytes = new sbyte[count]; buf.clear(); buf.get(bytes); string hex = HexString.encodeHexString(bytes); int paddingNeeded = (recordSize * 2 - Math.Max(count * 2, 0)) + 1; string format = "%s %6s 0x%08X %s%" + paddingNeeded + "s%s%n"; string str; string use; try { AbstractBaseRecord record = RecordStore.getRecord(store, i, CHECK); use = record.InUse() ? "+" : "-"; str = record.ToString(); } catch (InvalidRecordException) { str = StringHelper.NewString(bytes, 0, count, "ASCII"); use = "?"; } if (pattern == null || pattern.matcher(str).find()) { _console.printf(format, use, i, offset, hex, " ", str); } } } }
protected internal virtual RecordSet <RelationshipRecord> FollowChainFromNode(long nodeId, long relationshipId) { return(ExpandChain(_recordStore.getRecord(relationshipId, _recordStore.newRecord(), NORMAL), nodeId, NEXT)); }
public RelationshipTypeTokenRecord load(long key, Void additionalData) { return(_store.getRecord(key, _store.newRecord(), NORMAL)); }
public LabelTokenRecord load(long key, Void additionalData) { return(_store.getRecord(key, _store.newRecord(), NORMAL)); }
public RelationshipGroupRecord load(long key, int?type) { return(_store.getRecord(key, _store.newRecord(), NORMAL)); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public R getRecord(long id, R target, org.neo4j.kernel.impl.store.record.RecordLoad mode) throws InvalidRecordException public override R GetRecord(long id, R target, RecordLoad mode) { return(Actual.getRecord(id, target, mode)); }
private static R GetRecord <R>(RecordStore <R> store, long id) where R : Org.Neo4j.Kernel.impl.store.record.AbstractBaseRecord { return(RecordStore.getRecord(store, id, RecordLoad.FORCE)); }