Beispiel #1
0
        public override Void Execute()
        {
            var schema = ColumnFamily.GetSchema();

            var parent = new CassandraColumnParent {
                ColumnFamily = ColumnFamily.FamilyName,
            };

            if (SuperColumnName != null)
            {
                parent.SuperColumn = SuperColumnName.GetValue(schema.SuperColumnNameType);
            }

            var column = new CassandraColumn {
                Name      = ColumnName.GetValue(schema.ColumnNameType),
                Value     = ColumnValue,
                Timestamp = Timestamp,
                Ttl       = TimeToLive
            };

            Session.GetClient().insert(
                Key,
                parent,
                column,
                Session.WriteConsistency
                );

            return(new Void());
        }
Beispiel #2
0
 public void insert(CassandraObject key, CassandraColumnParent column_parent, CassandraColumn column, Apache.Cassandra.ConsistencyLevel consistency_level)
 {
     _client.insert(
         key.TryToBigEndian(),
         Helper.CreateColumnParent(column_parent),
         Helper.CreateColumn(column),
         consistency_level);
 }
Beispiel #3
0
        public static Column CreateColumn(CassandraColumn column)
        {
            var ccol = new Column {
                Name      = column.Name.TryToBigEndian(),
                Value     = column.Value.TryToBigEndian(),
                Timestamp = column.Timestamp.ToCassandraTimestamp()
            };

            if (column.Ttl.HasValue && column.Ttl.Value > 0)
            {
                ccol.Ttl = column.Ttl.Value;
            }

            return(ccol);
        }
Beispiel #4
0
        public static Column CreateColumn(CassandraColumn column)
        {
            var ccol = new Column {
                Name = column.Name.TryToBigEndian(),
                Value = column.Value.TryToBigEndian(),
                Timestamp = column.Timestamp.ToCassandraTimestamp()
            };

            if (column.Ttl.HasValue && column.Ttl.Value > 0)
                ccol.Ttl = column.Ttl.Value;

            return ccol;
        }
 public void insert(CassandraObject key, CassandraColumnParent column_parent, CassandraColumn column, Apache.Cassandra.ConsistencyLevel consistency_level)
 {
     _client.insert(
         key.TryToBigEndian(),
         Helper.CreateColumnParent(column_parent),
         Helper.CreateColumn(column),
         consistency_level);
 }