Esempio n. 1
0
        } //

        public void scanAllTweetsForAllUsers()

        {
            ScanPolicy policy = new ScanPolicy();

            policy.includeBinData = true;
            client.ScanAll(policy, "test", "tweets", scanTweetsCallback, "tweet");
        } //scanAllTweetsForAllUsers
Esempio n. 2
0
        } //updateUser

        public void scanAllTweetsForAllUsers()
        {
            ScanPolicy policy = new ScanPolicy();

            policy.concurrentNodes = true;
            policy.priority        = Priority.LOW;
            policy.includeBinData  = true;
            client.ScanAll(policy, "test", "tweets", scanTweetsCallback, "tweet");
        } //scanAllTweets
Esempio n. 3
0
        public void ScanBenchmark()
        {
            ScanPolicy policy = new ScanPolicy();

            policy.concurrentNodes = true;
            policy.priority        = Priority.DEFAULT;
            policy.includeBinData  = true;

            _client.ScanAll(policy, Namespace, Set, ScanCallback);
        }
Esempio n. 4
0
        private static Dictionary <Key, Record> GetRecords()
        {
            Log.Info("Reading records");
            var recs = new Dictionary <Key, Record>();

            client.ScanAll(null, Namespace, null, (Key key, Record rec) => {
                recs[key] = rec;
            });

            return(recs);
        }
Esempio n. 5
0
        } //updateUserUsingOperate

        public void scanAllTweetsForAllUsers()
        {
            // Scan all records
            // TODO: Create ScanPolicy instance with concurrentNodes, LOW priority and includeBinData
            // Exercise K4
            ScanPolicy policy = new ScanPolicy();

            policy.concurrentNodes = true;
            policy.priority        = Priority.LOW;
            policy.includeBinData  = true;

            // TODO: Initiate scan operation that invokes callback for outputting tweets to the console.
            // Exercise K4
            client.ScanAll(policy, "test", "tweets", scanTweetsCallback, "tweet");
        } //scanAllTweets
Esempio n. 6
0
        /// <summary>
        /// Scan all nodes in parallel and read all records in a set.
        /// </summary>
        public override void RunExample(AerospikeClient client, Arguments args)
        {
            console.Info("Scan parallel: namespace=" + args.ns + " set=" + args.set);
            recordCount = 0;
            DateTime   begin  = DateTime.Now;
            ScanPolicy policy = new ScanPolicy();

            client.ScanAll(policy, args.ns, args.set, ScanCallback);

            DateTime end     = DateTime.Now;
            double   seconds = end.Subtract(begin).TotalSeconds;

            console.Info("Total records returned: " + recordCount);
            console.Info("Elapsed time: " + seconds + " seconds");
            double performance = Math.Round((double)recordCount / seconds);

            console.Info("Records/second: " + performance);
        }
Esempio n. 7
0
        static void Delete(string host, int port, string asnamespace, string sets, int days, long limit, long rangeStart, long rangeEnd)
        {
            Console.WriteLine($"Host: {host}, Port: {port}, Namespace: {asnamespace}, Sets: {sets}, Days: {days}, Limit: {limit}, RangeStart: {rangeStart}, RangeEnd: {rangeEnd}");

            DateTime dt = DateTime.UtcNow.AddDays(days);

            Console.WriteLine($"Date: {dt}");

            _thresholdTime = UtcDateTimeToASTime(dt);


            _deleteSets       = sets;
            _deleteLimit      = limit;
            _deleteRangeStart = rangeStart;
            _deleteRangeEnd   = rangeEnd;
            _count            = _rewritecount = _total = 0;

            try
            {
                _client = new AerospikeClient(host, port);

                ScanPolicy scanPolicy = new ScanPolicy();
                // Scan the entire Set using ScanAll(). This will scan each node
                // in the cluster and return the record Digest to the call back object

                _watch = Stopwatch.StartNew();
                _client.ScanAll(scanPolicy, asnamespace, null, ScanCallback, new string[] { });
                _watch.Stop();

                Log($"Deleted {_count} records from set {sets}. Rewrites: {_rewritecount}");
            }
            catch (AerospikeException ex)
            {
                int resultCode = ex.Result;
                Log(ResultCode.GetResultString(resultCode));
                Log("Error details: " + ex.ToString());
            }

            return;
        }