private bool Read(PageCursor cursor, int offset, GSP into) { cursor.Offset = offset; into.Generation = GenerationSafePointer.ReadGeneration(cursor); into.Pointer = GenerationSafePointer.ReadPointer(cursor); return(GenerationSafePointer.VerifyChecksum(cursor, into.Generation, into.Pointer)); }
private static long ReadSlot(PageCursor cursor) { long generation = GenerationSafePointer.ReadGeneration(cursor); long pointer = GenerationSafePointer.ReadPointer(cursor); short checksum = GenerationSafePointer.ReadChecksum(cursor); assertEquals(GenerationSafePointer.ChecksumOf(generation, pointer), checksum); return(pointer); }
internal virtual void Write(PageCursor cursor, long unstableGeneration, long pageId, int pos) { if (pageId == NoPageId) { throw new System.ArgumentException("Tried to write pageId " + pageId + " which means null"); } AssertPos(pos); GenerationSafePointer.AssertGenerationOnWrite(unstableGeneration); cursor.Offset = EntryOffset(pos); cursor.PutInt(( int )unstableGeneration); put6BLong(cursor, pageId); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void checkSiblingShouldThrowOnReadIllegalPointer() internal virtual void CheckSiblingShouldThrowOnReadIllegalPointer() { // GIVEN long generation = IdSpace.STATE_PAGE_A; long pointer = this._secondGeneration; // Can not use GenerationSafePointer.write because it will fail on pointer assertion. _cursor.putInt(( int )pointer); put6BLong(_cursor, generation); _cursor.putShort(GenerationSafePointer.ChecksumOf(generation, pointer)); _cursor.rewind(); // WHEN long result = read(_cursor, _firstGeneration, pointer, NO_GENERATION_TARGET); assertThrows(typeof(TreeInconsistencyException), () => PointerChecking.checkPointer(result, true)); }
public static long ReadGeneration(Org.Neo4j.Io.pagecache.PageCursor cursor, bool slotA) { cursor.Offset = slotA ? SLOT_A_OFFSET : SLOT_B_OFFSET; return(GenerationSafePointer.ReadGeneration(cursor)); }
private static short ChecksumOf(GSP gsp) { return(GenerationSafePointer.ChecksumOf(gsp.Generation, gsp.Pointer)); }
private void Write(PageCursor cursor, int offset, GSP gsp) { cursor.Offset = offset; GenerationSafePointer.Write(cursor, gsp.Generation, gsp.Pointer); }
private static void OverwriteGSPP(PageCursor cursor, int gsppOffset, long generation, long pointer) { cursor.Offset = gsppOffset; GenerationSafePointer.Write(cursor, generation, pointer); GenerationSafePointer.Clean(cursor); }
internal static void SetGeneration(PageCursor cursor, long generation) { GenerationSafePointer.AssertGenerationOnWrite(generation); cursor.PutInt(BytePosGeneration, ( int )generation); }