@@ -100,17 +100,10 @@ public IndexFrame(int file, long pointer, int size, FrameData bd, Table t, Class
100100 }
101101
102102 //constructor for replication service
103- public IndexFrame (byte [] b , int file , long pointer , HashMap <Long , Long > imap , HashMap <Long , Long > hmap , Map < Long , List < Chunk >> umap , Table t ) {
103+ public IndexFrame (byte [] b , int file , long pointer , Map <Long , Long > imap , Map <Long , Long > hmap , Table t ) {
104104 super (b , file , pointer , t );
105105 int ptr = FRAME_HEADER_SIZE ;
106106
107- final Map <Integer , UndoChunk > ucmap = new HashMap <>();
108- if (umap .get (file + pointer ) != null ) {
109- for (Chunk c : umap .get (file + pointer )) {
110- ucmap .put (((UndoChunk ) c .getEntity ()).getPtr (), (UndoChunk ) c .getEntity ());
111- }
112- }
113-
114107 final ByteString bs = new ByteString (this .b );
115108 while (ptr <this .b .length ) {
116109 if (this .b .length >=ptr +INDEX_HEADER_SIZE ) {
@@ -124,13 +117,7 @@ public IndexFrame(byte[] b, int file, long pointer, HashMap<Long, Long> imap, Ha
124117 h .getFramePtrRowId ().setFramePointer (bptr - (bptr % 4096 ));
125118 }
126119 final DataChunk dc = new DataChunk (bs .substring (ptr , ptr +INDEX_HEADER_SIZE +h .getLen ()), this .getFile (), this .getPointer (), INDEX_HEADER_SIZE , this .getDataObject (), this .getEntityClass ());
127- dc .setUndoChunk (ucmap .get (h .getPtr ()));
128120 dc .setHeader (h );
129- if (this .getType ()==INDEX_FRAME_LEAF ) {
130- if (INITIALIZE_DURING_CONSTRUCT == 1 ) {
131- final IndexChunk ib = (IndexChunk ) dc .getEntity ();
132- }
133- }
134121 data .add (dc );
135122 ptr = ptr + INDEX_HEADER_SIZE + h .getLen ();
136123 } else {
@@ -144,12 +131,10 @@ public IndexFrame(byte[] b, int file, long pointer, HashMap<Long, Long> imap, Ha
144131 }
145132
146133 public IndexFrame add (DataChunk e , Table t , Session s , LLT llt ) throws Exception {
147- IndexFrame res = null ;
148-
149134 if (this .isFill (e )) {
150135
151136 final int nfileId = t .getIndexFileId (this .getFrameData ());
152- res = t .createNewFrame (this .getFrameData (), nfileId , this .getType (), 0 , false , false , false , s , llt ).getIndexFrame ();
137+ final IndexFrame res = t .createNewFrame (this .getFrameData (), nfileId , this .getType (), 0 , false , false , false , s , llt ).getIndexFrame ();
153138 res .setParentF (this .getParentF ());
154139 res .setParentB (this .getParentB ());
155140 final ValueSet max = this .sort ();
@@ -173,7 +158,8 @@ public IndexFrame add (DataChunk e, Table t, Session s, LLT llt) throws Exceptio
173158 this .setLcF (0 );
174159 this .setLcB (0 );
175160 } else {
176- if (e .getDcs ().compareTo (this .mv )>0 ) {
161+ final int cmv = e .getDcs ().compareTo (this .mv );
162+ if (cmv > 0 ) {
177163 throw new InternalException ();
178164 } else {
179165 res .setDivided (1 );
@@ -215,10 +201,11 @@ public IndexFrame add (DataChunk e, Table t, Session s, LLT llt) throws Exceptio
215201 }
216202 }
217203 }
204+ return res ;
218205 } else {
219206 this .insertChunk (e , s , false , llt );
207+ return null ;
220208 }
221- return res ;
222209 }
223210
224211 public DataChunk get (int index ) {
0 commit comments