public override void Read(IntRecord record, PageCursor cursor, RecordLoad mode, int recordSize)
 {
     for (int i = 0; i < outerInstance.intsPerRecord; i++)
     {
         record.Value = cursor.Int;
     }
     record.InUse = true;
     MaybeSetCursorError(cursor, record.Id);
 }
示例#2
0
        public override void Read(DynamicRecord record, PageCursor cursor, RecordLoad mode, int recordSize)
        {
            /*
             * First 4b
             * [x   ,    ][    ,    ][    ,    ][    ,    ] 0: start record, 1: linked record
             * [   x,    ][    ,    ][    ,    ][    ,    ] inUse
             * [    ,xxxx][    ,    ][    ,    ][    ,    ] high next block bits
             * [    ,    ][xxxx,xxxx][xxxx,xxxx][xxxx,xxxx] nr of bytes in the data field in this record
             *
             */
            long firstInteger  = cursor.Int & 0xFFFFFFFFL;
            bool isStartRecord = (firstInteger & 0x80000000) == 0;
            bool inUse         = (firstInteger & 0x10000000) != 0;

            if (mode.shouldLoad(inUse))
            {
                int dataSize  = recordSize - RecordHeaderSize;
                int nrOfBytes = ( int )(firstInteger & 0xFFFFFF);
                if (nrOfBytes > recordSize)
                {
                    // We must have performed an inconsistent read,
                    // because this many bytes cannot possibly fit in a record!
                    cursor.CursorException = PayloadTooBigErrorMessage(record, recordSize, nrOfBytes);
                    return;
                }

                /*
                 * Pointer to next block 4b (low bits of the pointer)
                 */
                long nextBlock    = cursor.Int & 0xFFFFFFFFL;
                long nextModifier = (firstInteger & 0xF000000L) << 8;

                long longNextBlock = BaseRecordFormat.longFromIntAndMod(nextBlock, nextModifier);
                record.Initialize(inUse, isStartRecord, longNextBlock, -1, nrOfBytes);
                if (longNextBlock != Record.NO_NEXT_BLOCK.intValue() && nrOfBytes < dataSize || nrOfBytes > dataSize)
                {
                    cursor.CursorException = IllegalBlockSizeMessage(record, dataSize);
                    return;
                }

                ReadData(record, cursor);
            }
            else
            {
                record.InUse = inUse;
            }
        }
示例#3
0
        public override void Read(MetaDataRecord record, PageCursor cursor, RecordLoad mode, int recordSize)
        {
            int id = record.IntId;

            Position[] values = Position.values();
            if (id >= values.Length)
            {
                record.Initialize(false, FIELD_NOT_PRESENT);
                return;
            }

            Position position = values[id];
            int      offset   = position.id() * recordSize;

            cursor.Offset = offset;
            bool inUse = cursor.Byte == Record.IN_USE.byteValue();
            long value = inUse ? cursor.Long : FIELD_NOT_PRESENT;

            record.Initialize(inUse, value);
        }
示例#4
0
        public override void Read(DynamicRecord record, PageCursor cursor, RecordLoad mode, int recordSize)
        {
            sbyte headerByte = cursor.Byte;
            bool  inUse      = IsInUse(headerByte);

            if (mode.shouldLoad(inUse))
            {
                int length = cursor.Short | cursor.Byte << 16;
                if (length > recordSize | length < 0)
                {
                    cursor.CursorException = PayloadLengthErrorMessage(record, recordSize, length);
                    return;
                }
                long next          = cursor.Long;
                bool isStartRecord = (headerByte & START_RECORD_BIT) != 0;
                record.Initialize(inUse, isStartRecord, next, -1, length);
                readData(record, cursor);
            }
            else
            {
                record.InUse = inUse;
            }
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void read(RECORD record, org.neo4j.io.pagecache.PageCursor cursor, org.neo4j.kernel.impl.store.record.RecordLoad mode, int recordSize) throws java.io.IOException
            public override void Read(RECORD record, PageCursor cursor, RecordLoad mode, int recordSize)
            {
                Actual.read(record, cursor, mode, recordSize);
            }
示例#6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public java.util.List<R> getRecords(long firstId, org.neo4j.kernel.impl.store.record.RecordLoad mode) throws InvalidRecordException
        public override IList <R> GetRecords(long firstId, RecordLoad mode)
        {
            return(Actual.getRecords(firstId, mode));
        }
示例#7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void nextRecordByCursor(R target, org.neo4j.kernel.impl.store.record.RecordLoad mode, org.neo4j.io.pagecache.PageCursor cursor) throws InvalidRecordException
        public override void NextRecordByCursor(R target, RecordLoad mode, PageCursor cursor)
        {
            Actual.nextRecordByCursor(target, mode, cursor);
        }
示例#8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void getRecordByCursor(long id, R target, org.neo4j.kernel.impl.store.record.RecordLoad mode, org.neo4j.io.pagecache.PageCursor cursor) throws InvalidRecordException
        public override void GetRecordByCursor(long id, R target, RecordLoad mode, PageCursor cursor)
        {
            Actual.getRecordByCursor(id, target, mode, cursor);
        }
示例#9
0
//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));
        }