Deveel.Data.Store.ObjectStore.CompleteObject C# (CSharp) 메소드

CompleteObject() 개인적인 메소드

private CompleteObject ( LargeObject obj ) : void
obj LargeObject
리턴 void
        private void CompleteObject(LargeObject obj)
        {
            // Get the blob reference id (reference to the fixed record list).
            long refId = obj.Id.Id;

            lock (fixedList) {
                // Update the record in the fixed list.
                IArea block = fixedList.GetRecord(refId);

                // Record the position
                var recordPos = block.Position;
                // Read the information in the fixed record
                int status = block.ReadInt4();
                // Assert that the status is open
                if (status != 0)
                    throw new IOException("Assertion failed: record is not open.");

                int refCount = block.ReadInt4();
                long size = block.ReadInt8();
                long currentSize = block.ReadInt8();
                long pageCount = block.ReadInt8();

                try {
                    store.Lock();

                    block.Position = recordPos;
                    block.WriteInt4(1);				// Status
                    block.WriteInt4(0);				// Reference Count
                    block.WriteInt8(obj.CurrentSize);	// Final Size
                    block.WriteInt8(obj.CurrentSize);
                    block.WriteInt8(pageCount);		// Page Count
                    block.Flush();
                } finally {
                    store.Unlock();
                }
            }

            // Now the object has been finalized so change the state of the object
            obj.MarkComplete();
        }

Usage Example

예제 #1
0
 public void Complete()
 {
     store.CompleteObject(this);
 }