Exemplo n.º 1
0
 /// <summary>
 /// How do we best rebalance left and right leaf?
 /// Can we move keys from underflowing left to right so that none of them underflow? </summary>
 /// <returns> 0, do nothing. -1, merge. 1-inf, move this number of keys from left to right. </returns>
 internal abstract int CanRebalanceLeaves(PageCursor leftCursor, int leftKeyCount, PageCursor rightCursor, int rightKeyCount);
Exemplo n.º 2
0
 internal override bool ReadValue(PageCursor cursor, int size, GenericKey into)
 {
     return(Read(cursor, into));
 }
Exemplo n.º 3
0
 internal static bool Read(PageCursor cursor, GenericKey into)
 {
     into.WriteLocalDateTime(cursor.Long, cursor.Int);
     return(true);
 }
Exemplo n.º 4
0
 internal abstract void AssertAdditionalHeader(PageCursor cursor, TreeNode <KEY, VALUE> node, int pageSize);
Exemplo n.º 5
0
 internal override void PutValue(PageCursor cursor, GenericKey state)
 {
     cursor.PutByte(( sbyte )state.Long1);
     PutArray(cursor, state, NumberArrayElementWriter(state));
 }
Exemplo n.º 6
0
 private static void OverwriteGSPP(PageCursor cursor, int gsppOffset, long generation, long pointer)
 {
     cursor.Offset = gsppOffset;
     GenerationSafePointer.Write(cursor, generation, pointer);
     GenerationSafePointer.Clean(cursor);
 }
Exemplo n.º 7
0
 private long LeftSibling(PageCursor cursor, long stableGeneration, long unstableGeneration)
 {
     return(pointer(TreeNode.LeftSibling(cursor, stableGeneration, unstableGeneration)));
 }
Exemplo n.º 8
0
        // Useful for debugging
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unused") abstract void printNode(org.neo4j.io.pagecache.PageCursor cursor, boolean includeValue, boolean includeAllocSpace, long stableGeneration, long unstableGeneration);
        internal abstract void PrintNode(PageCursor cursor, bool includeValue, bool includeAllocSpace, long stableGeneration, long unstableGeneration);
Exemplo n.º 9
0
 /// <returns> <seealso cref="string"/> describing inconsistency of empty string "" if no inconsistencies. </returns>
 internal abstract string CheckMetaConsistency(PageCursor cursor, int keyCount, Type type, GBPTreeConsistencyCheckVisitor <KEY> visitor);
Exemplo n.º 10
0
 /// <summary>
 /// Move all rightmost keys and values in left leaf from given position to right leaf.
 ///
 /// Right leaf will be defragmented.
 ///
 /// Update keyCount in left and right.
 /// </summary>
 internal abstract void MoveKeyValuesFromLeftToRight(PageCursor leftCursor, int leftKeyCount, PageCursor rightCursor, int rightKeyCount, int fromPosInLeftNode);
Exemplo n.º 11
0
 /// <summary>
 /// Copy all keys and values in left leaf and insert to the left in right leaf.
 ///
 /// Right leaf will be defragmented.
 ///
 /// Update keyCount in right
 /// </summary>
 internal abstract void CopyKeyValuesFromLeftToRight(PageCursor leftCursor, int leftKeyCount, PageCursor rightCursor, int rightKeyCount);
Exemplo n.º 12
0
 /// <summary>
 /// Performs the entry moving part of split in internal.
 ///
 /// Keys and children from left is divided between left and right and the new key and child is inserted where it belongs.
 ///
 /// Key count is updated.
 /// </summary>
 internal abstract void DoSplitInternal(PageCursor leftCursor, int leftKeyCount, PageCursor rightCursor, int insertPos, KEY newKey, long newRightChild, long stableGeneration, long unstableGeneration, KEY newSplitter, double ratioToKeepInLeftOnSplit);
Exemplo n.º 13
0
 /// <summary>
 /// Calculate where split should be done and move entries between leaves participating in split.
 ///
 /// Keys and values from left are divide between left and right and the new key and value is inserted where it belongs.
 ///
 /// Key count is updated.
 /// </summary>
 internal abstract void DoSplitLeaf(PageCursor leftCursor, int leftKeyCount, PageCursor rightCursor, int insertPos, KEY newKey, VALUE newValue, KEY newSplitter, double ratioToKeepInLeftOnSplit);
Exemplo n.º 14
0
 internal abstract bool CanMergeLeaves(PageCursor leftCursor, int leftKeyCount, PageCursor rightCursor, int rightKeyCount);
Exemplo n.º 15
0
 public abstract void WriteValue(PageCursor cursor, VALUE value);
Exemplo n.º 16
0
 internal static sbyte NodeType(PageCursor cursor)
 {
     return(cursor.GetByte(BYTE_POS_NODE_TYPE));
 }
Exemplo n.º 17
0
 public abstract void WriteKey(PageCursor cursor, KEY key);
Exemplo n.º 18
0
 internal virtual void InitializeLeaf(PageCursor cursor, long stableGeneration, long unstableGeneration)
 {
     WriteBaseHeader(cursor, LEAF_FLAG, stableGeneration, unstableGeneration);
     WriteAdditionalHeader(cursor);
 }
Exemplo n.º 19
0
 private void Initialize()
 {
     _currentPageId = UNBOUND_PAGE_ID;
     _current       = null;
 }
Exemplo n.º 20
0
 /// <summary>
 /// Copy the specified number of bytes from the given offset of this page, to the given offset of the target page.
 /// <para>
 /// If the length reaches beyond the end of either cursor, then only as many bytes as are available in this cursor,
 /// or can fit in the target cursor, are actually copied.
 /// </para>
 /// <para>
 /// <strong>Note</strong> that {@code copyTo} is only guaranteed to work when both target and source cursor are from
 /// the <em>same</em> page cache implementation. Using wrappers, delegates or mixing cursor implementations may
 /// produce unspecified errors.
 ///
 /// </para>
 /// </summary>
 /// <param name="sourceOffset"> The offset into this page to copy from. </param>
 /// <param name="targetCursor"> The cursor the data will be copied to. </param>
 /// <param name="targetOffset"> The offset into the target cursor to copy to. </param>
 /// <param name="lengthInBytes"> The number of bytes to copy. </param>
 /// <returns> The number of bytes actually copied. </returns>
 public abstract int CopyTo(int sourceOffset, PageCursor targetCursor, int targetOffset, int lengthInBytes);
Exemplo n.º 21
0
 private long Successor(PageCursor cursor, long stableGeneration, long unstableGeneration)
 {
     return(pointer(TreeNode.Successor(cursor, stableGeneration, unstableGeneration)));
 }
Exemplo n.º 22
0
 public abstract void ReadMetaData(PageCursor cursor);
Exemplo n.º 23
0
 internal override bool ReadValue(PageCursor cursor, int size, GenericKey into)
 {
     readCrs(cursor, into);
     return(ReadArray(cursor, Org.Neo4j.Values.Storable.ValueWriter_ArrayType.Point, GeometryArrayType.readGeometryArrayItem, into));
 }
Exemplo n.º 24
0
 public abstract void WriteMetaData(PageCursor cursor);
Exemplo n.º 25
0
 internal override void PutValue(PageCursor cursor, GenericKey state)
 {
     Put(cursor, state.Long0, state.Long1);
 }
Exemplo n.º 26
0
 public abstract void ReadValue(PageCursor cursor, VALUE into, int valueSize);
Exemplo n.º 27
0
 internal static void Put(PageCursor cursor, long long0, long long1)
 {
     cursor.PutLong(long1);
     cursor.PutInt(( int )long0);
 }
Exemplo n.º 28
0
 public abstract void ReadKey(PageCursor cursor, KEY into, int keySize);
Exemplo n.º 29
0
 private void ReadFormatVersion(PageCursor c)
 {
     c.Int;               // Major version
     c.Int;               // Minor version
 }
Exemplo n.º 30
0
 internal abstract bool LeafUnderflow(PageCursor cursor, int keyCount);