Beispiel #1
0
            public virtual void OnSuccess(List <BatchRead> records)
            {
                // Show results.
                int found = 0;

                foreach (BatchRead record in records)
                {
                    Key    key = record.key;
                    Record rec = record.record;

                    if (rec != null)
                    {
                        found++;
                        parent.console.Info("Record: ns={0} set={1} key={2} bin={3} value={4}",
                                            key.ns, key.setName, key.userKey, parent.binName, rec.GetValue(parent.binName));
                    }
                    else
                    {
                        parent.console.Info("Record not found: ns={0} set={1} key={2} bin={3}",
                                            key.ns, key.setName, key.userKey, parent.binName);
                    }
                }

                if (found != 8)
                {
                    parent.console.Error("Records found mismatch. Expected 8. Received " + found);
                }
                parent.TaskComplete();
            }
Beispiel #2
0
            public virtual void OnSuccess(Key[] keys, Record[] records)
            {
                for (int i = 0; i < records.Length; i++)
                {
                    Key       key        = keys[i];
                    Record    record     = records[i];
                    Log.Level level      = Log.Level.ERROR;
                    int       generation = 0;
                    int       expiration = 0;

                    if (record != null && (record.generation > 0 || record.expiration > 0))
                    {
                        level      = Log.Level.INFO;
                        generation = record.generation;
                        expiration = record.expiration;
                    }
                    parent.console.Write(level, "Record: namespace={0} set={1} key={2} generation={3} expiration={4}",
                                         key.ns, key.setName, key.userKey, generation, expiration);
                }

                if (records.Length != BatchSize)
                {
                    parent.console.Error("Record size mismatch. Expected {0}. Received {1}.", BatchSize, records.Length);
                }
                parent.TaskComplete();
            }
Beispiel #3
0
            public virtual void OnSuccess(Key[] keys, Record[] records)
            {
                for (int i = 0; i < records.Length; i++)
                {
                    Key       key    = keys[i];
                    Record    record = records[i];
                    Log.Level level  = Log.Level.ERROR;
                    object    value  = null;

                    if (record != null)
                    {
                        level = Log.Level.INFO;
                        value = record.GetValue(parent.binName);
                    }
                    parent.console.Write(level, "Record: namespace={0} set={1} key={2} bin={3} value={4}",
                                         key.ns, key.setName, key.userKey, parent.binName, value);
                }

                if (records.Length != BatchSize)
                {
                    parent.console.Error("Record size mismatch. Expected {0}. Received {1}.",
                                         BatchSize, records.Length);
                }
                parent.TaskComplete();
            }
Beispiel #4
0
 public virtual void OnSuccess(Key[] keys, bool[] existsArray)
 {
     for (int i = 0; i < existsArray.Length; i++)
     {
         Key  key    = keys[i];
         bool exists = existsArray[i];
         parent.console.Info("Record: namespace={0} set={1} key={2} exists={3}",
                             key.ns, key.setName, key.userKey, exists);
     }
     parent.TaskComplete();
 }
Beispiel #5
0
 public virtual void OnSuccess()
 {
     parent.TaskComplete();
 }