@@ -96,6 +96,10 @@ public FrameData getFrameData() {
9696 return frameData ;
9797 }
9898
99+ public void setFrameData (FrameData frameData ) {
100+ this .frameData = frameData ;
101+ }
102+
99103 public DataObject getDataObject () {
100104 return dataObject ;
101105 }
@@ -271,10 +275,11 @@ public Frame(byte[] bb, int file, long pointer, int size, FrameData bd, DataObje
271275 this .res09 = bs .getIntFromBytes (92 );
272276
273277 if ((this .file ==0 )&&(this .pointer ==0 )) {
278+ logger .error ("empty frame header frameId = " + (bd == null ? "N/A" : bd .getFrameId ()) + " allocId = " + (bd == null ? "N/A" : bd .getAllocId ()));
274279 throw new EmptyFrameHeaderFound ();
275280 }
276281 if ((this .file !=file )||(this .pointer !=pointer )) {
277- logger .error ("InvalidFrameHeader: " + this . file + ":" + file + " " + this . pointer + ":" + pointer );
282+ logger .error ("invalid frame header frameId = " + ( bd == null ? "N/A" : bd . getFrameId ()) + " allocId = " + ( bd == null ? "N/A" : bd . getAllocId ()) );
278283 throw new InvalidFrameHeader ();
279284 }
280285 if (this .objectId <0 ) {
@@ -296,8 +301,10 @@ public synchronized byte[] getFrame() throws InvalidFrame {
296301
297302 if (Config .getConfig ().SYNC_LOCK_ENABLE ||sync ==0 ) {
298303 for (Chunk c : data .getChunks ()) {
304+ final byte [] chunk_ = c .getChunk ();
305+ c .getHeader ().setLen (chunk_ .length );
299306 res2 .append (c .getHeader ().getHeader ());
300- res2 .append (c . getChunk () );
307+ res2 .append (chunk_ );
301308 used = used + c .getBytesAmount ();
302309 }
303310 } else {
@@ -306,8 +313,10 @@ public synchronized byte[] getFrame() throws InvalidFrame {
306313 }
307314 for (Chunk c : data .getChunks ()) {
308315 if (c .getHeader ().getLltId () < sync ) {
316+ final byte [] chunk_ = c .getChunk ();
317+ // c.getHeader().setLen(chunk_.length);
309318 res2 .append (c .getHeader ().getHeader ());
310- res2 .append (c . getChunk () );
319+ res2 .append (chunk_ );
311320 used = used + c .getBytesAmount ();
312321 }
313322 }
@@ -352,32 +361,6 @@ public synchronized byte[] getFrame() throws InvalidFrame {
352361 return res .getBytes ();
353362 }
354363
355- public synchronized byte [] flushHeader () {
356- final ByteString res = new ByteString ();
357- final ByteString bs = new ByteString (this .b );
358- res .addBytesFromInt (this .file );
359- res .addBytesFromLong (this .pointer );
360- res .addBytesFromInt (this .objectId );
361- res .addBytesFromInt (this .type );
362- res .addBytesFromInt (this .cptr );
363- res .addBytesFromInt (this .bytesAmount );
364- res .addBytesFromInt (this .rowCntr );
365- res .addBytesFromInt (this .sptr );
366- res .addBytesFromInt (this .allocFile );
367- res .addBytesFromLong (this .allocPointer );
368- res .addBytesFromInt (this .res01 );
369- res .addBytesFromInt (this .res02 );
370- res .addBytesFromInt (this .res03 );
371- res .addBytesFromInt (this .res04 );
372- res .addBytesFromInt (this .res05 );
373- res .addBytesFromLong (this .res06 );
374- res .addBytesFromLong (this .res07 );
375- res .addBytesFromLong (this .res08 );
376- res .addBytesFromInt (this .res09 );
377- res .append (bs .substring (FRAME_HEADER_SIZE , this .b .length ));
378- return res .getBytes ();
379- }
380-
381364 public boolean equals (Frame bl ) {
382365 if ((this .file ==bl .getFile ())&&(this .pointer ==bl .getPointer ())) {
383366 return true ;
@@ -461,7 +444,7 @@ public synchronized int updateChunk(DataChunk chunk, Object o, Session s, LLT ll
461444 if (chunk .getEntity ()!=o ) { //not same object
462445 chunk .updateEntity (o );
463446 }
464-
447+ chunk . setNormalState ();
465448 final byte [] ncb = chunk .getChunk ();
466449 chunk .getHeader ().setLen (ncb .length );
467450 final int newlen = chunk .getBytesAmount ();
@@ -652,11 +635,6 @@ public HashMap getLiveTransactions() {
652635 return rtran ;
653636 }
654637
655- public ArrayList <TransFrame > getLiveTransFrames () {
656- final long ptr = this .file + this .pointer ;
657- return Instance .getInstance ().getTransFrames (ptr );
658- }
659-
660638 public int getBytesAmount () {
661639 int used = FRAME_HEADER_SIZE ;
662640 final int size = data .getChunks ().size ();
0 commit comments