Package org.apache.hadoop.chukwa.rest.objects

Examples of org.apache.hadoop.chukwa.rest.objects.Disk


    // get one object
    @GET
    @Path("timestamp/{timestamp}")
    @Produces({"application/xml","text/xml"})
    public String getByTimestampXML( @PathParam ("timestamp") String timestamp) {
  Disk model = DiskHome.find(timestamp);
  return convertToXml(model);
    }
View Full Code Here


   
    @GET
    @Path("timestamp/{timestamp}")
    @Produces("application/json")
    public String getByTimestampJason( @PathParam ("timestamp") String timestamp) {
  Disk model = DiskHome.find(timestamp);
  return convertToJson(model);
    }
View Full Code Here

   
    @GET
    @Path("timestamp/{timestamp}")
    @Produces({"text/plain","text/csv"})
    public String getByTimestampCsv( @PathParam ("timestamp") String timestamp) {
  Disk model = DiskHome.find(timestamp);
  return convertToCsv(model);
    }
View Full Code Here

    @Path("timestamp/{timestamp}/host/{host}/mount/{mount}")
    @Produces({"application/xml","text/xml"})
  public String getByTimestampHostXML( @PathParam ("timestamp") String timestamp,
               @PathParam ("host") String host,
               @PathParam ("mount") String mount ) {
  Disk model = DiskHome.find(timestamp, host,mount);
  return convertToXml(model);
    }
View Full Code Here

    @Path("timestamp/{timestamp}/host/{host}/mount/{mount}")
    @Produces("application/json")
  public String getByTimestampHostJason( @PathParam ("timestamp") String timestamp,
                 @PathParam ("host") String host,
                 @PathParam ("mount") String mount  ) {
  Disk model = DiskHome.find(timestamp, host, mount);
  return convertToJson(model);
    }
View Full Code Here

    @Path("timestamp/{timestamp}/host/{host}/mount/{mount}")
    @Produces({"text/plain","text/csv"})
  public String getByTimestampHostCsv( @PathParam ("timestamp") String timestamp,
               @PathParam ("host") String host,
               @PathParam ("mount") String mount  ) {
  Disk model = DiskHome.find(timestamp, host, mount);
  return convertToCsv(model);
    }
View Full Code Here

    /*
     * convert from a result set record to an object
     */
    private static Disk createDisk(ResultSet rs) {
  Disk obj = null;
  try {
      obj = new Disk(
          rs.getTimestamp("timestamp"),
          rs.getString("host"),
          rs.getString("mount"),
          rs.getDouble("used"),
          rs.getDouble("available"),
View Full Code Here

      // get simple value
            try {
    String query = getSingleQuery(DiskHome.table,"timestamp",timestamp);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        Disk obj = createDisk(rs);
        return obj;
    }
      } catch (Exception e) {
    log.error("exception:"+e.toString());
      }
View Full Code Here

    criteriaMap.put("mount",mount);

    String query = getCriteriaQuery(DiskHome.table,criteriaMap);
        ResultSet rs = dbw.query(query);
        if (rs.next()) {
        Disk obj = createDisk(rs);
        return obj;
    }
      } catch (Exception e) {
    log.error("exception:"+e.toString());
      }
View Full Code Here

  try {
      String query = getTimeBetweenQuery(DiskHome.table,starttime,endtime);     
      ResultSet rs = dbw.query(query);
      while (rs.next()) {
    Disk obj = createDisk(rs);
    collection.add(obj);
      }
  } catch (Exception e) {
      log.error("exception:"+e.toString());
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.chukwa.rest.objects.Disk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.