示例#1
0
 public Map<String, Map<String, String>> getKeyspaces() {
   Map<String, Map<String, String>> rval = new HashMap<String, Map<String, String>>();
   for (KeyspaceDefinition k : cluster.describeKeyspaces()) {
     if (!k.getName().equals("system")) {
       rval.put(keyPrefix + '/' + k.getName(), k.getStrategyOptions());
     }
   }
   // TODO add empty check
   return rval;
 }
 // iterate the keyspaces and query each one of them
 public int queryAllKeyspaces(int limit, Writer out) throws IOException {
   int total_rows = 0;
   for (KeyspaceDefinition ksDef : _cluster.describeKeyspaces()) {
     String keyspace = ksDef.getName();
     // only keyspaces that uses as prefix our pre-defined one
     if (!keyspace.startsWith(Listener.DEFAULT_ERS_KEYSPACES_PREFIX)
         || keyspace.equals(Listener.GRAPHS_NAMES_KEYSPACE)) continue;
     // query this keyspace
     total_rows += queryEntireKeyspace(keyspace, out, limit);
   }
   return total_rows;
 }