@ Override public void insert ( Session session , PersistentStore store , Row row ) { NodeAVL n ; NodeAVL x ; boolean isleft = true ; int compare = - 1 ; writeLock . lock ( ) ; try { n = getAccessor ( store ) ; x = n ; if ( n == null ) { store . setAccessor ( this , ( ( RowAVL ) row ) . getNode ( position ) ) ; return ; } while ( true ) { Row currentRow = n . getRow ( store ) ; compare = compareRowForInsertOrDelete ( session , row , currentRow ) ; if ( compare == 0 ) { throw Error . error ( ErrorCode . X_23505 ) ; } isleft = compare < 0 ; x = n ; n = child ( store , x , isleft ) ; if ( n == null ) { break ; } } x = set ( store , x , isleft , ( ( RowAVL ) row ) . getNode ( position ) ) ; balance ( store , x , isleft ) ; } finally { writeLock . unlock ( ) ; } }
Insert a node into the index