コード例 #1
0
 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));
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
 }
コード例 #4
0
//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));
        }
コード例 #5
0
 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));
 }
コード例 #6
0
 private static short ChecksumOf(GSP gsp)
 {
     return(GenerationSafePointer.ChecksumOf(gsp.Generation, gsp.Pointer));
 }
コード例 #7
0
 private void Write(PageCursor cursor, int offset, GSP gsp)
 {
     cursor.Offset = offset;
     GenerationSafePointer.Write(cursor, gsp.Generation, gsp.Pointer);
 }
コード例 #8
0
ファイル: GBPTreeCorruption.cs プロジェクト: Neo4Net/Neo4Net
 private static void OverwriteGSPP(PageCursor cursor, int gsppOffset, long generation, long pointer)
 {
     cursor.Offset = gsppOffset;
     GenerationSafePointer.Write(cursor, generation, pointer);
     GenerationSafePointer.Clean(cursor);
 }
コード例 #9
0
 internal static void SetGeneration(PageCursor cursor, long generation)
 {
     GenerationSafePointer.AssertGenerationOnWrite(generation);
     cursor.PutInt(BytePosGeneration, ( int )generation);
 }