예제 #1
0
  @SuppressWarnings("unchecked")
  public List<RayoNode> getRayoNodesForPlatform(String platformId) {

    try {
      log.debug("Finding rayo nodes for platform: [%s]", platformId);
      Set<String> platforms = new HashSet<String>();
      platforms.add(platformId);

      List<RayoNode> nodes = new ArrayList<RayoNode>();
      Selector selector = Pelops.createSelector(schemaName);
      List<SuperColumn> columns =
          selector.getSuperColumnsFromRow("nodes", platformId, false, ConsistencyLevel.ONE);
      for (SuperColumn column : columns) {
        String id = Bytes.toUTF8(column.getName());
        RayoNode rayoNode = buildNode(column.getColumns());
        rayoNode.setHostname(id);
        rayoNode.setPlatforms(platforms);
        nodes.add(rayoNode);
      }

      return nodes;
    } catch (PelopsException pe) {
      log.error(pe.getMessage(), pe);
      return Collections.EMPTY_LIST;
    }
  }
예제 #2
0
  @Override
  public Collection<String> getCalls() {

    log.debug("Getting list with all active calls");

    try {
      Selector selector = Pelops.createSelector(schemaName);
      List<String> calls = new ArrayList<String>();
      List<SuperColumn> cols =
          selector.getSuperColumnsFromRow("jids", "nodes", false, ConsistencyLevel.ONE);
      for (SuperColumn col : cols) {
        List<Column> columns = col.getColumns();
        for (Column column : columns) {
          calls.add(Bytes.toUTF8(column.getValue()));
        }
      }
      return calls;
    } catch (PelopsException pe) {
      log.error(pe.getMessage(), pe);
      return null;
    }
  }