use of com.xrtb.blocks.SimpleMultiset in project XRTB by benmfaul.
the class Configuration method readData.
public static String readData(String type, String name, S3Object object, long size) throws Exception {
String message = "";
switch(type) {
case "range":
case "cidr":
NavMap map = new NavMap(name, object);
message = "Added NavMap " + name + ": has " + map.size() + " members";
break;
case "set":
SimpleSet set = new SimpleSet(name, object);
message = "Initialize Set: " + name + " from S3, entries = " + set.size();
break;
case "bloom":
Bloom b = new Bloom(name, object, size);
message = "Initialize Bloom Filter: " + name + " from S3, members = " + b.getMembers();
break;
case "cuckoo":
Cuckoo c = new Cuckoo(name, object, size);
message = "Initialize Cuckoo Filter: " + name + " from S3, entries = " + c.getMembers();
break;
case "multiset":
SimpleMultiset ms = new SimpleMultiset(name, object);
message = "Initialize Multiset " + name + " from S3, entries = " + ms.getMembers();
break;
default:
message = "Unknown type: " + type;
}
System.out.println("*** " + message);
return message;
}
use of com.xrtb.blocks.SimpleMultiset in project XRTB by benmfaul.
the class Configuration method readData.
public static String readData(String fileName) throws Exception {
String message = "";
int i = fileName.indexOf(".");
if (i == -1)
throw new Exception("Filename is missing type field");
String type = fileName.substring(i);
NavMap map;
SimpleMultiset set;
SimpleSet sset;
Bloom b;
Cuckoo c;
switch(type) {
case "range":
map = new NavMap(fileName, fileName, false);
message = "Added NavMap " + fileName + ": from file, has " + map.size() + " members";
break;
case "cidr":
map = new NavMap(fileName, fileName, true);
message = "Added NavMap " + fileName + ": from file, has " + map.size() + " members";
break;
case "bloom":
b = new Bloom(fileName, fileName);
message = "Initialize Bloom Filter: " + fileName + " from file, members = " + b.getMembers();
break;
case "cuckoo":
c = new Cuckoo(fileName, fileName);
break;
case "multiset":
set = new SimpleMultiset(fileName, fileName);
message = "Initialize Multiset " + fileName + " from file, entries = " + set.getMembers();
break;
case "set":
sset = new SimpleSet(fileName, fileName);
message = "Initialize Multiset " + fileName + " from file, entries = " + sset.size();
break;
default:
message = "Unknown type: " + type;
}
System.out.println("*** " + message);
return message;
}
Aggregations