/// <summary>
        /// Convert this object to its equivalent Thrift object
        /// </summary>
        /// <returns>a Thrift Object</returns>
        public Mutation ToThrift()
        {
            Deletion deletion = new Deletion();
            deletion.Predicate = this.Predicate.ToThrift();
            deletion.Super_column = ByteEncoderHelper.ToByteArray(this.SuperColumn);
            deletion.Timestamp = this.Timestamp;

            return new Mutation() { Deletion = deletion };
        }
Exemplo n.º 2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.Struct)
                        {
                            Column_or_supercolumn = new ColumnOrSuperColumn();
                            Column_or_supercolumn.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            Deletion = new Deletion();
                            Deletion.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Exemplo n.º 3
0
        public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.Struct)
                    {
                        this.column_or_supercolumn = new ColumnOrSuperColumn();
                        this.column_or_supercolumn.Read(iprot);
                        this.__isset.column_or_supercolumn = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Struct)
                    {
                        this.deletion = new Deletion();
                        this.deletion.Read(iprot);
                        this.__isset.deletion = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
Exemplo n.º 4
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Struct) {
           Column_or_supercolumn = new ColumnOrSuperColumn();
           Column_or_supercolumn.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Deletion = new Deletion();
           Deletion.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Exemplo n.º 5
0
        public static IEnumerable<Mutation> CreateDeletedSuperColumnMutation(IEnumerable<FluentMutation> mutation)
        {
            foreach (var col in mutation)
            {
                var superColumn = col.Column.GetPath().SuperColumn.ColumnName.TryToBigEndian();

                var deletion = new Deletion {
                    Timestamp = col.ColumnTimestamp.ToCassandraTimestamp(),
                    Super_column = superColumn,
                    Predicate = CreateSlicePredicate(new[] { col.Column.ColumnName })
                };

                yield return new Mutation {
                    Deletion = deletion
                };
            }
        }
Exemplo n.º 6
0
        public static IEnumerable<Mutation> CreateDeletedColumnMutation(IEnumerable<FluentMutation> mutation)
        {
            foreach (var col in mutation)
            {
                var deletion = new Deletion {
                    Timestamp = col.ColumnTimestamp.ToCassandraTimestamp(),
                    Predicate = CreateSlicePredicate(new[] { col.Column.ColumnName })
                };

                yield return new Mutation {
                    Deletion = deletion
                };
            }
        }