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


C# Client.Policy类代码示例

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


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

示例1: ReadHeaderCommand

 public ReadHeaderCommand(Cluster cluster, Policy policy, Key key)
 {
     this.cluster = cluster;
     this.policy = policy;
     this.key = key;
     this.partition = new Partition(key);
 }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:7,代码来源:ReadHeaderCommand.cs

示例2: Main

        public static void Main(string[] args)
        {
            var client = Connect();
            var policy = new Policy();
            var writePolicy = new WritePolicy();
            var batchPolicy = new BatchPolicy();

            //NOTE: adjust the timeout value depending on your demo machine
            writePolicy.timeout = 1000;
            var key = new Key("test", "myset", "mykey");

            WriteSingleValue(client, writePolicy, key);
            CheckKeyExists(client, policy, key);
            AddSingleValue(client, writePolicy);
            WriteMultipleValues(client, writePolicy, key);
            WriteValueWithTtl(client);

            ReadAllValuesForKey(client, policy, key);
            ReadSomeValuesForKey(client, policy, key);

            DeleteValue(client, writePolicy, key);
            DeleteRecord(client, writePolicy, key);

            AddRecords(client, writePolicy);
            BatchReadRecords(client, batchPolicy);

            MultiOps(client, writePolicy, key);

            client.Close();
        }
开发者ID:jamesrcounts,项目名称:areospike-client-demo-net,代码行数:30,代码来源:Program.cs

示例3: Prepare

        public static void Prepare(TestContext testContext)
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            RegisterTask rtask = client.Register(null, assembly, "Aerospike.Test.Resources.record_example.lua", "record_example.lua", Language.LUA);
            rtask.Wait();

            Policy policy = new Policy();
            policy.timeout = 0; // Do not timeout on index create.
            IndexTask task = client.CreateIndex(policy, args.ns, args.set, indexName, binName, IndexType.STRING, IndexCollectionType.MAPKEYS);
            task.Wait();

            for (int i = 1; i <= size; i++)
            {
                Key key = new Key(args.ns, args.set, keyPrefix + i);
                Dictionary<string, string> map = new Dictionary<string, string>();

                map[mapKeyPrefix + 1] = mapValuePrefix + i;
                if (i % 2 == 0)
                {
                    map[mapKeyPrefix + 2] = mapValuePrefix + i;
                }
                if (i % 3 == 0)
                {
                    map[mapKeyPrefix + 3] = mapValuePrefix + i;
                }

                Bin bin = new Bin(binName, map);
                client.Put(null, key, bin);
            }
        }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:30,代码来源:TestQueryCollection.cs

示例4: Prepare

 public static void Prepare(TestContext testContext)
 {
     Policy policy = new Policy();
     policy.timeout = 0; // Do not timeout on index create.
     IndexTask task = client.CreateIndex(policy, args.ns, args.set, indexName, binName, IndexType.NUMERIC);
     task.Wait();
 }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:7,代码来源:TestAsyncQuery.cs

示例5: QueryRecordCommand

 public QueryRecordCommand(Node node, Policy policy, Statement statement, RecordSet recordSet)
     : base(node, true)
 {
     this.policy = policy;
     this.statement = statement;
     this.recordSet = recordSet;
 }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:7,代码来源:QueryRecordCommand.cs

示例6: CheckKeyExists

 private static void CheckKeyExists(AerospikeClient client, Policy policy,
         Key key)
 {
     Console.WriteLine("Check a record exists");
     var exists = client.Exists(policy, key);
     Console.WriteLine(key + " exists? " + exists);
     Console.WriteLine("");
 }
开发者ID:jamesrcounts,项目名称:areospike-client-demo-net,代码行数:8,代码来源:Program.cs

示例7: ReadCommand

 public ReadCommand(Cluster cluster, Policy policy, Key key, string[] binNames)
 {
     this.cluster = cluster;
     this.policy = policy;
     this.key = key;
     this.partition = new Partition(key);
     this.binNames = binNames;
 }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:8,代码来源:ReadCommand.cs

示例8: AsyncReadHeader

 public AsyncReadHeader(AsyncCluster cluster, Policy policy, RecordListener listener, Key key)
     : base(cluster)
 {
     this.policy = policy;
     this.listener = listener;
     this.key = key;
     this.partition = new Partition(key);
 }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:8,代码来源:AsyncReadHeader.cs

示例9: AsyncRead

 public AsyncRead(AsyncCluster cluster, Policy policy, RecordListener listener, Key key, string[] binNames)
     : base(cluster)
 {
     this.policy = policy;
     this.listener = listener;
     this.key = key;
     this.partition = new Partition(key);
     this.binNames = binNames;
 }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:9,代码来源:AsyncRead.cs

示例10: CreateIndex

        private void CreateIndex(AerospikeClient client, Arguments args, IndexCollectionType indexType, string indexName, string binName)
        {
            console.Info("Create GeoJSON {0} index: ns={1} set={2} index={3} bin={4}", indexType, args.ns, args.set, indexName, binName);

            Policy policy = new Policy();
            policy.timeout = 0; // Do not timeout on index create.
            IndexTask task = client.CreateIndex(policy, args.ns, args.set, indexName, binName, IndexType.GEO2DSPHERE, indexType);
            task.Wait();
        }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:9,代码来源:QueryGeoCollection.cs

示例11: CreateIndex

        private void CreateIndex(AsyncClient client, Arguments args, string indexName, string binName)
        {
            console.Info("Create index: ns=" + args.ns + " set=" + args.set + " index=" + indexName + " bin=" + binName);

            Policy policy = new Policy();
            policy.timeout = 0; // Do not timeout on index create.
            IndexTask task = client.CreateIndex(policy, args.ns, args.set, indexName, binName, IndexType.NUMERIC);
            task.Wait();
        }
开发者ID:vonbv,项目名称:aerospike-client-csharp,代码行数:9,代码来源:AsyncQuery.cs

示例12: CreateIndex

        private void CreateIndex(AerospikeClient client, Arguments args, string indexName, string binName)
        {
            console.Info("Create index: ns={0} set={1} index={2} bin={3}",
                args.ns, args.set, indexName, binName);

            Policy policy = new Policy();
            policy.timeout = 0; // Do not timeout on index create.
            IndexTask task = client.CreateIndex(policy, args.ns, args.set, indexName, binName, IndexType.NUMERIC);
            task.Wait();
        }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:10,代码来源:QueryAverage.cs

示例13: QueryAggregateCommand

        public QueryAggregateCommand(
			Node node,
			Policy policy,
			Statement statement,
			BlockingCollection<object> inputQueue,
			CancellationToken cancelToken
		)
            : base(node, true)
        {
            this.policy = policy;
            this.statement = statement;
            this.inputQueue = inputQueue;
            this.cancelToken = cancelToken;
        }
开发者ID:alanprot,项目名称:aerospike-client-csharp,代码行数:14,代码来源:QueryAggregateCommand.cs

示例14: Prepare

        public static void Prepare(TestContext testContext)
        {
            Policy policy = new Policy();
            policy.timeout = 0; // Do not timeout on index create.
            IndexTask task = client.CreateIndex(policy, args.ns, args.set, indexName, binName, IndexType.NUMERIC);
            task.Wait();

            for (int i = 1; i <= size; i++)
            {
                Key key = new Key(args.ns, args.set, keyPrefix + i);
                Bin bin = new Bin(binName, i);
                client.Put(null, key, bin);
            }
        }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:14,代码来源:TestQueryInteger.cs

示例15: ReadRecord

 protected override void ReadRecord(Policy policy, Key key, string binName)
 {
     if (shared.readLatency != null)
     {
         Stopwatch watch = Stopwatch.StartNew();
         Record record = client.Get(policy, key, binName);
         double elapsed = watch.Elapsed.TotalMilliseconds;
         OnReadSuccess(elapsed);
     }
     else
     {
         Record record = client.Get(policy, key, binName);
         OnReadSuccess();
     }
 }
开发者ID:Caldas,项目名称:aerospike-client-csharp,代码行数:15,代码来源:BenchmarkThreadSync.cs


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