Hi,
I am just 2 day old with C#.
My env: Mac, Mono, Xamarin
My current task is to read all the records from the cluster. So I used the ScanAll method just like mentioned in the example in github:ScanParallel
The problem is that the ScanCallback is not being called at all.
here is my code: Please dont bother with my hard coded values: I am sure there is far bigger thing to be concerned about
using System; using System.Collections; using System.Threading; using Aerospike.Client; using System.Diagnostics; using System.Linq;
namespace ScanDelete { public class ESPRep1 {
AerospikeClient client; public ESPRep1 (String hostname, int port, Hashtable nsSets) { Stopwatch watch = new Stopwatch (); watch.Start (); scan (); watch.Stop (); Console.WriteLine ("Total time =" + watch.Elapsed);
}
public void scan(){ client = new AerospikeClient ("127.0.0.1", 3000); DateTime begin = DateTime.Now; ScanPolicy policy = new ScanPolicy(); policy.concurrentNodes = true; policy.maxConcurrentNodes = client.Nodes.Length; Console.WriteLine("number of nodes = " + client.Nodes.Length);
client.ScanAll(policy, "test", "set1", ScanCallback );
DateTime end = DateTime.Now; double seconds = end.Subtract(begin).TotalSeconds;
}
public void ScanCallback(Key key, Record record) {
Console.WriteLine ("I got inside this");
}
} }
Do I not have something like implements in java and just implement the ScanCalllBack interface and then override the ScanCallback method
regards