/// <summary>
        /// Convert this structure into a valid Cassandra Thrift KeyRange
        /// </summary>
        /// <returns>a cassandra thrift KeyRange</returns>
        public KeyRange ToThrift()
        {
            KeyRange keyRange = new KeyRange();
            keyRange.Count = this.Count;
            keyRange.Start_key = this.StartKey;
            keyRange.End_key = this.EndKey;

            return keyRange;
        }
        /// <summary>
        /// Convert this structure into a valid Cassandra Thrift KeyRange
        /// </summary>
        /// <returns>a cassandra thrift KeyRange</returns>
        public KeyRange ToThrift()
        {
            KeyRange keyRange = new KeyRange();
            keyRange.Count = this.Count;
            keyRange.Start_token = this.StartToken;
            keyRange.End_token = this.EndToken;

            return keyRange;
        }
Exemple #3
0
 public static Apache.Cassandra.KeyRange ToThrift(this KeyRange keyRange)
 {
     var kr = new Apache.Cassandra.KeyRange();
     if (!string.IsNullOrEmpty(keyRange.StartKey))
         kr.Start_key = keyRange.StartKey;
     if (!string.IsNullOrEmpty(keyRange.EndKey))
         kr.End_key = keyRange.EndKey;
     if (!string.IsNullOrEmpty(keyRange.StartToken))
         kr.Start_token = keyRange.StartToken;
     if (!string.IsNullOrEmpty(keyRange.EndToken))
         kr.End_token = keyRange.EndToken;
     kr.Count = keyRange.Count;
     return kr;
 }
Exemple #4
0
        public static Apache.Cassandra.KeyRange ToThrift(this KeyRange keyRange)
        {
            var kr = new Apache.Cassandra.KeyRange();

            if (!string.IsNullOrEmpty(keyRange.StartKey))
            {
                kr.Start_key = keyRange.StartKey;
            }
            if (!string.IsNullOrEmpty(keyRange.EndKey))
            {
                kr.End_key = keyRange.EndKey;
            }
            if (!string.IsNullOrEmpty(keyRange.StartToken))
            {
                kr.Start_token = keyRange.StartToken;
            }
            if (!string.IsNullOrEmpty(keyRange.EndToken))
            {
                kr.End_token = keyRange.EndToken;
            }
            kr.Count = keyRange.Count;
            return(kr);
        }
 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_parent = new ColumnParent();
     Column_parent.Read(iprot);
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     case 2:
       if (field.Type == TType.Struct) {
     Predicate = new SlicePredicate();
     Predicate.Read(iprot);
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     case 3:
       if (field.Type == TType.Struct) {
     Range = new KeyRange();
     Range.Read(iprot);
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     case 4:
       if (field.Type == TType.I32) {
     Consistency_level = (ConsistencyLevel)iprot.ReadI32();
       } else {
     TProtocolUtil.Skip(iprot, field.Type);
       }
       break;
     default:
       TProtocolUtil.Skip(iprot, field.Type);
       break;
       }
       iprot.ReadFieldEnd();
     }
     iprot.ReadStructEnd();
 }
 public void send_get_range_slices(ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level)
 {
     oprot_.WriteMessageBegin(new TMessage("get_range_slices", TMessageType.Call, seqid_));
     get_range_slices_args args = new get_range_slices_args();
     args.Column_parent = column_parent;
     args.Predicate = predicate;
     args.Range = range;
     args.Consistency_level = consistency_level;
     args.Write(oprot_);
     oprot_.WriteMessageEnd();
     oprot_.Transport.Flush();
 }
 public List<KeySlice> get_range_slices(ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level)
 {
     send_get_range_slices(column_parent, predicate, range, consistency_level);
     return recv_get_range_slices();
 }
Exemple #8
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.String) {
           Column_family = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Range = new KeyRange();
           Range.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.String) {
           Start_column = iprot.ReadBinary();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.I32) {
           Consistency_level = (ConsistencyLevel)iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Exemple #9
0
 public void send_get_paged_slice(string column_family, KeyRange range, byte[] start_column, ConsistencyLevel consistency_level)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("get_paged_slice", TMessageType.Call, seqid_));
   get_paged_slice_args args = new get_paged_slice_args();
   args.Column_family = column_family;
   args.Range = range;
   args.Start_column = start_column;
   args.Consistency_level = consistency_level;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
Exemple #10
0
 public IAsyncResult send_get_paged_slice(AsyncCallback callback, object state, string column_family, KeyRange range, byte[] start_column, ConsistencyLevel consistency_level)
Exemple #11
0
      /// <summary>
      /// returns a range of columns, wrapping to the next rows if necessary to collect max_results.
      /// </summary>
      /// <param name="column_family"></param>
      /// <param name="range"></param>
      /// <param name="start_column"></param>
      /// <param name="consistency_level"></param>
      public List<KeySlice> get_paged_slice(string column_family, KeyRange range, byte[] start_column, ConsistencyLevel consistency_level)
      {
        #if !SILVERLIGHT
        send_get_paged_slice(column_family, range, start_column, consistency_level);
        return recv_get_paged_slice();

        #else
        var asyncResult = Begin_get_paged_slice(null, null, column_family, range, start_column, consistency_level);
        return End_get_paged_slice(asyncResult);

        #endif
      }
Exemple #12
0
 public IAsyncResult send_get_range_slices(AsyncCallback callback, object state, ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level)
Exemple #13
0
      /// <summary>
      /// returns a subset of columns for a contiguous range of keys.
      /// </summary>
      /// <param name="column_parent"></param>
      /// <param name="predicate"></param>
      /// <param name="range"></param>
      /// <param name="consistency_level"></param>
      public List<KeySlice> get_range_slices(ColumnParent column_parent, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level)
      {
        #if !SILVERLIGHT
        send_get_range_slices(column_parent, predicate, range, consistency_level);
        return recv_get_range_slices();

        #else
        var asyncResult = Begin_get_range_slices(null, null, column_parent, predicate, range, consistency_level);
        return End_get_range_slices(asyncResult);

        #endif
      }
 public List<KeySlice> get_paged_slice(string column_family, KeyRange range, byte[] start_column, ConsistencyLevel consistency_level)
 {
     send_get_paged_slice(column_family, range, start_column, consistency_level);
     return recv_get_paged_slice();
 }