public static int execute(ActiveRDMA c, int[] args) { // args[] is the key byte[] k = new byte[args.length]; for (int i = 0; i < args.length; i++) k[i] = (byte) args[i]; DHT_RDMA r = new DHT_RDMA(c, N, true); return r.has(k) ? 1 : 0; }
public static int execute(ActiveRDMA c, int[] args) { // args[] is the value, followed by the key byte[] k = new byte[args.length - 1]; for (int i = 0; i < args.length - 1; i++) k[i] = (byte) args[i + 1]; DHT_RDMA r = new DHT_RDMA(c, N, true); r.put(k, args[0]); return 0; }
public static int[] execute(ActiveRDMA c, int[] args) { // args[1] is the key byte[] pattern = new byte[args.length - 1]; for (int i = 0; i < args.length; i++) pattern[i] = (byte) args[i]; DHT_RDMA r = new DHT_RDMA(c, N, true); return r.match(args[0], pattern); }