package com.orientechnologies.orient.core.storage.impl.local.paginated.wal;

import java.nio.ByteBuffer;

import static com.orientechnologies.orient.core.storage.impl.local.paginated.wal.WALRecordTypes.HIGH_LEVEL_TRANSACTION_CHANGE_RECORD;

public class OHighLevelTransactionChangeRecord extends OOperationUnitRecord {
  private byte[] data;

  public OHighLevelTransactionChangeRecord() {

  }

  public OHighLevelTransactionChangeRecord(OOperationUnitId operationUnitId, byte[] data) {
    super(operationUnitId);
    this.data = data;
  }

  @Override
  protected void serializeToByteBuffer(ByteBuffer buffer) {
    buffer.putInt(data.length);
    buffer.put(data, 0, data.length);
  }

  @Override
  protected void deserializeFromByteBuffer(ByteBuffer buffer) {
    int size = buffer.getInt();
    data = new byte[size];
    buffer.get(data, 0, size);
  }

  @Override
  public boolean isUpdateMasterRecord() {
    return false;
  }

  @Override
  public int getId() {
    return HIGH_LEVEL_TRANSACTION_CHANGE_RECORD;
  }

  public byte[] getData() {
    return data;
  }
}

@@ -70,16 +70,155 @@
 d.wal;%0A%0A
+import com.orientechnologies.common.serialization.types.OIntegerSerializer;%0Aimport com.orientechnologies.orient.core.sql.parser.OInteger;%0A%0A
 import j
@@ -985,32 +985,160 @@
  0, size);%0A  %7D%0A%0A
+  @Override%0A  public int serializedSize() %7B%0A    return super.serializedSize() + OIntegerSerializer.INT_SIZE + data.length;%0A  %7D%0A%0A
   @Override%0A  pu

fix the required record size for the new high level change in wal record