public static void WriteRecords(TestContext testContext)
        {
            sendKeys = new Key[size];

            for (int i = 0; i < size; i++)
            {
                sendKeys[i] = new Key(args.ns, args.set, keyPrefix + (i + 1));
            }

            AsyncMonitor monitor = new AsyncMonitor();
            WriteHandler handler = new WriteHandler(monitor, size);

            for (int i = 1; i <= size; i++)
            {
                Key key = sendKeys[i - 1];
                Bin bin = new Bin(binName, valuePrefix + i);
                client.Put(null, handler, key, bin);
            }
            monitor.WaitTillComplete();
        }
        public static void WriteRecords(TestContext testContext)
        {
            sendKeys = new Key[size];

            for (int i = 0; i < size; i++)
            {
                sendKeys[i] = new Key(args.ns, args.set, keyPrefix + (i + 1));
            }

            AsyncMonitor monitor = new AsyncMonitor();
            WriteHandler handler = new WriteHandler(monitor, size);

            WritePolicy policy = new WritePolicy();
            policy.expiration = 2592000;

            for (int i = 1; i <= size; i++)
            {
                Key key = sendKeys[i - 1];
                Bin bin = new Bin(binName, valuePrefix + i);
                client.Put(policy, handler, key, bin);
            }
            monitor.WaitTillComplete();
        }
예제 #3
0
        public AsyncBatchInit()
        {
            TestAsyncBatch.sendKeys = new Key[TestAsyncBatch.size];

            for (int i = 0; i < TestAsyncBatch.size; i++)
            {
                TestAsyncBatch.sendKeys[i] = new Key(args.ns, args.set, TestAsyncBatch.keyPrefix + (i + 1));
            }

            AsyncMonitor monitor = new AsyncMonitor();
            WriteHandler handler = new WriteHandler(monitor, TestAsyncBatch.size);

            WritePolicy policy = new WritePolicy();

            policy.expiration = 2592000;

            for (int i = 1; i <= TestAsyncBatch.size; i++)
            {
                Key key = TestAsyncBatch.sendKeys[i - 1];
                Bin bin = new Bin(TestAsyncBatch.binName, TestAsyncBatch.valuePrefix + i);
                client.Put(policy, handler, key, bin);
            }
            monitor.WaitTillComplete();
        }
예제 #4
0
 public WriteHandler(AsyncMonitor monitor, int max)
 {
     this.monitor = monitor;
     this.max     = max;
 }
 public WriteHandler(AsyncMonitor monitor, int max)
 {
     this.monitor = monitor;
     this.max = max;
 }