public DeleteRowRequest(RowDeleteChange rowDeleteChange)
 {
     RowDeleteChange = rowDeleteChange;
     TableName       = rowDeleteChange.TableName;
     Condition       = rowDeleteChange.Condition;
     PrimaryKey      = rowDeleteChange.PrimaryKey;
 }
Ejemplo n.º 2
0
        public static byte[] BuildRowDeleteChangeWithHeader(RowDeleteChange rowChange)
        {
            List <PlainBufferCell> pkCells = new List <PlainBufferCell>();

            foreach (var primaryKeyColumn in rowChange.GetPrimaryKey().GetPrimaryKeyColumns())
            {
                pkCells.Add(PlainBufferConversion.ToPlainBufferCell(primaryKeyColumn));
            }

            List <PlainBufferCell> cells = new List <PlainBufferCell>();
            PlainBufferRow         row   = new PlainBufferRow(pkCells, cells, true);

            int size = ComputePlainBufferRowWithHeader(row);
            PlainBufferOutputStream      output      = new PlainBufferOutputStream(size);
            PlainBufferCodedOutputStream codedOutput = new PlainBufferCodedOutputStream(output);

            codedOutput.WriteRowWithHeader(row);

            if (!output.IsFull())
            {
                throw new IOException("Bug: serialize row delete change failed.");
            }

            return(output.GetBuffer());
        }
 public DeleteRowRequest(string tableName, Condition condition, PrimaryKey primaryKey)
 {
     TableName       = tableName;
     Condition       = condition;
     PrimaryKey      = primaryKey;
     RowDeleteChange = new RowDeleteChange(tableName, primaryKey)
     {
         Condition = condition
     };
 }