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


C# IFdbTransaction.Clear方法代码示例

本文整理汇总了C#中IFdbTransaction.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# IFdbTransaction.Clear方法的具体用法?C# IFdbTransaction.Clear怎么用?C# IFdbTransaction.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IFdbTransaction的用法示例。


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

示例1: DeleteValue

		/// <summary>Remove a field of an hashset</summary>
		/// <param name="trans"></param>
		/// <param name="id"></param>
		/// <param name="field"></param>
		public void DeleteValue(IFdbTransaction trans, IFdbTuple id, string field)
		{
			if (trans == null) throw new ArgumentNullException("trans");
			if (id == null) throw new ArgumentNullException("id");
			if (string.IsNullOrEmpty(field)) throw new ArgumentNullException("field");

			trans.Clear(GetFieldKey(id, field));
		}
开发者ID:rektide,项目名称:foundationdb-dotnet-client,代码行数:12,代码来源:FdbHashSetCollection.cs

示例2: Delete

		/// <summary>Remove one or more fields of an hashset</summary>
		/// <param name="trans"></param>
		/// <param name="id"></param>
		/// <param name="fields"></param>
		public void Delete(IFdbTransaction trans, IFdbTuple id, params string[] fields)
		{
			if (trans == null) throw new ArgumentNullException("trans");
			if (id == null) throw new ArgumentNullException("id");
			if (fields == null) throw new ArgumentNullException("fields");

			foreach (var field in fields)
			{
				if (string.IsNullOrEmpty(field)) throw new ArgumentException("Field cannot have an empty name", "fields");
				trans.Clear(GetFieldKey(id, field));
			}
		}
开发者ID:rektide,项目名称:foundationdb-dotnet-client,代码行数:16,代码来源:FdbHashSetCollection.cs

示例3: RemoveFromParent

		/// <summary>Remove an existing node from its parents</summary>
		/// <returns>True if the parent node was found, otherwise false</returns>
		private async Task<bool> RemoveFromParent(IFdbTransaction tr, IFdbTuple path)
		{
			Contract.Requires(tr != null && path != null);

			var parent = await FindAsync(tr, path.Substring(0, path.Count - 1)).ConfigureAwait(false);
			if (parent.Exists)
			{
				if (FdbDirectoryLayer.AnnotateTransactions) tr.Annotate("Removing path {0} from its parent folder at {1}", path, parent.Subspace.Key);
				tr.Clear(GetSubDirKey(parent.Subspace, path.Get<string>(-1)));
				return true;
			}
			return false;
		}
开发者ID:BedeGaming,项目名称:foundationdb-dotnet-client,代码行数:15,代码来源:FdbDirectoryLayer.cs

示例4: TryRemoteSplitPointAsync

		private async Task<bool> TryRemoteSplitPointAsync(IFdbTransaction trans, long offset)
		{
			Contract.Requires(trans != null && offset >= 0);

			var b = await GetChunkAtAsync(trans, offset).ConfigureAwait(false);
			if (b.Offset == 0 || b.Key == Slice.Nil) return false; // in sparse region, or at beginning

			var a = await GetChunkAtAsync(trans, b.Offset - 1).ConfigureAwait(false);
			if (a.Key == Slice.Nil) return false; // no previous chunk

			if (a.Offset + a.Data.Count != b.Offset) return false; // chunks can't be joined
			if (a.Data.Count + b.Data.Count > CHUNK_SMALL) return false;  // chunks shouldn't be joined
			// yay--merge chunks
			trans.Clear(b.Key);
			trans.Set(a.Key, a.Data + b.Data);
			return true;
		}
开发者ID:BedeGaming,项目名称:foundationdb-dotnet-client,代码行数:17,代码来源:FdbBlob.cs

示例5: Drop

		/// <summary>
		/// Drop a student from a class
		/// </summary>
		public async Task Drop(IFdbTransaction tr, string s, string c)
		{
			var rec = AttendsKey(s, c);
			if ((await tr.GetAsync(rec)).IsNullOrEmpty)
			{ // not taking this class
				return;
			}

			var students = Int32.Parse((await tr.GetAsync(ClassKey(c))).ToAscii());
			tr.Set(ClassKey(c), Slice.FromAscii((students + 1).ToString()));
			tr.Clear(rec);
		}
开发者ID:rektide,项目名称:foundationdb-dotnet-client,代码行数:15,代码来源:ClassScheduling.cs

示例6: Scenario1

		// Compare the behavior of the MemoryDB against a FoundationDB database

		private async Task Scenario1(IFdbTransaction tr)
		{
			tr.Set(Slice.FromAscii("hello"), Slice.FromAscii("world!"));
			tr.Clear(Slice.FromAscii("removed"));
			var result = await tr.GetAsync(Slice.FromAscii("narf"));
		}
开发者ID:BedeGaming,项目名称:foundationdb-dotnet-client,代码行数:8,代码来源:Comparisons.cs

示例7: RemoveFromParent

		/// <summary>Remove an existing node from its parents</summary>
		/// <returns>True if the parent node was found, otherwise false</returns>
		private async Task<bool> RemoveFromParent(IFdbTransaction tr, IFdbTuple path)
		{
			Contract.Requires(tr != null && path != null);

			var parent = await FindAsync(tr, path.Substring(0, path.Count - 1)).ConfigureAwait(false);
			if (parent.Exists)
			{
				tr.Clear(GetSubDirKey(parent.Subspace, path.Get<string>(-1)));
				return true;
			}
			return false;
		}
开发者ID:Rustemt,项目名称:foundationdb-dotnet-client,代码行数:14,代码来源:FdbDirectoryLayer.cs


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