当前位置: 首页>>代码示例>>C#>>正文


C# CassandraObject类代码示例

本文整理汇总了C#中CassandraObject的典型用法代码示例。如果您正苦于以下问题:C# CassandraObject类的具体用法?C# CassandraObject怎么用?C# CassandraObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CassandraObject类属于命名空间,在下文中一共展示了CassandraObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetBytes

        private byte[] GetBytes(CassandraObject[] components)
        {
            using (var bytes = new MemoryStream())
            {
                foreach (var c in components)
                {
                    var b = (byte[])c;
                    var length = (ushort)b.Length;

                    // comparator part
                    bytes.WriteByte((byte)1);
                    bytes.WriteByte((byte)_aliases.FirstOrDefault(x => x.Value == c.GetType()).Key);

                    // value length
                    bytes.Write(BitConverter.GetBytes(length), 0, 2);

                    // value
                    bytes.Write(b, 0, length);

                    // end of component
                    bytes.WriteByte((byte)0);
                }

                return bytes.ToArray();
            }
        }
开发者ID:nativex,项目名称:fluentcassandra,代码行数:26,代码来源:DynamicCompositeTypeTest.cs

示例2: InsertCounterColumn

 public static void InsertCounterColumn(this CassandraColumnFamily family, CassandraObject key,
                                        CassandraObject superColumnName, CassandraObject columnName,
                                        long columnValue)
 {
     var op = new AddColumn(key, superColumnName, columnName, columnValue);
     family.ExecuteOperation(op);
 }
开发者ID:achinn,项目名称:fluentcassandra,代码行数:7,代码来源:CassandraColumnFamilyOperations.cs

示例3: CassandraRangeSlicePredicate

		public CassandraRangeSlicePredicate(CassandraObject start, CassandraObject finish, bool reversed = false, int count = 100)
		{
			Start = start;
			Finish = finish;
			Reversed = reversed;
			Count = count;
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:7,代码来源:CassandraRangeSlicePredicate.cs

示例4: get

		public Apache.Cassandra.ColumnOrSuperColumn get(CassandraObject key, CassandraColumnPath column_path, Apache.Cassandra.ConsistencyLevel consistency_level)
		{
			return _client.get(
				key.TryToBigEndian(),
				Helper.CreateColumnPath(column_path),
				consistency_level);
		}
开发者ID:nathannis,项目名称:fluentcassandra,代码行数:7,代码来源:CassandraClientWrapper.cs

示例5: add

 public void add(CassandraObject key, CassandraColumnParent column_parent, CassandraCounterColumn column, Apache.Cassandra.ConsistencyLevel consistency_level)
 {
     _client.add(
         key.TryToBigEndian(),
         Helper.CreateColumnParent(column_parent),
         Helper.CreateCounterColumn(column),
         consistency_level);
 }
开发者ID:bjuris,项目名称:fluentcassandra,代码行数:8,代码来源:CassandraClientWrapper.cs

示例6: get_count

		public int get_count(CassandraObject key, CassandraColumnParent column_parent, CassandraSlicePredicate predicate, Apache.Cassandra.ConsistencyLevel consistency_level)
		{
			return _client.get_count(
				key.TryToBigEndian(),
				Helper.CreateColumnParent(column_parent),
				Helper.CreateSlicePredicate(predicate),
				consistency_level);
		}
开发者ID:nathannis,项目名称:fluentcassandra,代码行数:8,代码来源:CassandraClientWrapper.cs

示例7: CassandraKeyRange

		public CassandraKeyRange(CassandraObject startKey, CassandraObject endKey, string startToken, string endToken, int count)
		{
			StartKey = startKey;
			EndKey = endKey;
			StartToken = startToken;
			EndToken = endToken;
			Count = count;
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:8,代码来源:CassandraKeyRange.cs

示例8: InsertColumn

        public static void InsertColumn(this CassandraColumnFamily family, CassandraObject key, FluentColumnPath path)
        {
            var columnName = path.Column.ColumnName;
            var columnValue = path.Column.ColumnValue;
            var timestamp = path.Column.ColumnTimestamp;
            var timeToLive = path.Column.ColumnSecondsUntilDeleted;

            var op = new InsertColumn(key, columnName, columnValue, timestamp, timeToLive);
            family.ExecuteOperation(op);
        }
开发者ID:rsparkyc,项目名称:fluentcassandra,代码行数:10,代码来源:CassandraColumnFamilyOperations.cs

示例9: CassandraQuerySetup

		public CassandraQuerySetup()
		{
			Reverse = false;

			KeyCount = 100;
			ColumnCount = 100;

			Keys = new CassandraObject[0];
			Columns = new CassandraObject[0];
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:10,代码来源:CassandraQuerySetup.cs

示例10: Implicit_ByteArray_Cast

        public void Implicit_ByteArray_Cast()
        {
            // arrange
            var expected = new CassandraObject[] { (AsciiType)"string1", (LongType)300 };
            byte[] bytes = GetBytes(expected);

            // act
            CompositeType actual = bytes;

            // assert
            Assert.IsTrue(expected.SequenceEqual(actual));
        }
开发者ID:bjuris,项目名称:fluentcassandra,代码行数:12,代码来源:CompositeTypeTest.cs

示例11: CassandraType_Cast

        public void CassandraType_Cast()
        {
            // arranage
            var expected = new CassandraObject[] { (AsciiType)"string1", (LongType)300 };

            // act
            CompositeType actualType = expected;
            CassandraObject actual = actualType;

            // assert
            Assert.IsTrue(expected.SequenceEqual((CassandraObject[])actual));
        }
开发者ID:bjuris,项目名称:fluentcassandra,代码行数:12,代码来源:CompositeTypeTest.cs

示例12: JavaBytes_To_CompositeType

        public void JavaBytes_To_CompositeType()
        {
            // arrange
            var expected = new CassandraObject[] { (BytesType)_compositeType[0].GetValue<string>(), (BytesType)_compositeType[1].GetValue<long>() };

            // act
            var actual = new CompositeType();
            actual.SetValueFromBigEndian(_javaByteOrder);

            // assert
            Assert.True(expected.SequenceEqual((CassandraObject[])actual));
        }
开发者ID:bjuris,项目名称:fluentcassandra,代码行数:12,代码来源:CompositeTypeTest.cs

示例13: GetBytes

		private byte[] GetBytes(CassandraObject[] components)
		{
			using (var bytes = new MemoryStream())
			{
				foreach (var c in components)
				{
					var b = (byte[])c;
					var length = (ushort)b.Length;

					// value length
					bytes.Write(BitConverter.GetBytes(length), 0, 2);

					// value
					bytes.Write(b, 0, length);

					// end of component
					bytes.WriteByte((byte)0);
				}

				return bytes.ToArray();
			}
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:22,代码来源:CompositeTypeTest.cs

示例14: SuperColumnCount

		public static int SuperColumnCount(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject columnStart, CassandraObject columnEnd, bool reversed = false, int count = 100)
		{
			var op = new ColumnCount(key, superColumnName, new CassandraRangeSlicePredicate(columnStart, columnEnd, reversed, count));
			return family.ExecuteOperation(op);
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:5,代码来源:CassandraSuperColumnFamilyOperations.cs

示例15: GetSingle

		public static FluentSuperColumnFamily GetSingle(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject columnStart, CassandraObject columnEnd, bool reversed = false, int count = 100)
		{
			var op = new GetSuperColumnFamilySlice(key, new CassandraRangeSlicePredicate(columnStart, columnEnd, reversed, count));
			return family.ExecuteOperation(op);
		}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:5,代码来源:CassandraSuperColumnFamilyOperations.cs


注:本文中的CassandraObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。