Examples of UDF


Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

  @GET
  @Path("{udfId}")
  @Produces(MediaType.APPLICATION_JSON)
  public Response getUDF(@PathParam("udfId") String udfId) {
    try {
      UDF udf = getResourceManager().read(udfId);
      JSONObject object = new JSONObject();
      object.put("udf", udf);
      return Response.ok(object).build();
    } catch (WebApplicationException ex) {
      throw ex;
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

  public Response createUDF(UDFRequest request, @Context HttpServletResponse response,
                            @Context UriInfo ui) {
    try {
      getResourceManager().create(request.udf);

      UDF udf = getResourceManager().read(request.udf.getId());

      response.setHeader("Location",
          String.format("%s/%s", ui.getAbsolutePath().toString(), request.udf.getId()));

      JSONObject object = new JSONObject();
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

    udfService = getService(UDFService.class, handler, context);
  }

  private Response doCreateUDF() {
    UDFService.UDFRequest request = new UDFService.UDFRequest();
    request.udf = new UDF();
    request.udf.setPath("/tmp/udf.jar");
    request.udf.setName("TestUDF");

    UriInfo uriInfo = createNiceMock(UriInfo.class);
    URI uri = UriBuilder.fromUri("http://host/a/b").build();
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

  public void updateUDF() {
    Response createdUDF = doCreateUDF();
    String createdUdfId = ((UDF) ((JSONObject) createdUDF.getEntity()).get("udf")).getId();

    UDFService.UDFRequest request = new UDFService.UDFRequest();
    request.udf = new UDF();
    request.udf.setPath("/tmp/updatedUDF.jar");
    request.udf.setName("TestUDF2");

    Response response = udfService.updateUDF(request, createdUdfId);
    Assert.assertEquals(204, response.getStatus());
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

        new OnlyOwnersFilteringStrategy(this.context.getUsername())));
  }

  @Override
  public void createResource(String s, Map<String, Object> stringObjectMap) throws SystemException, ResourceAlreadyExistsException, NoSuchResourceException, UnsupportedPropertyException {
    UDF udf = null;
    try {
      udf = new UDF(stringObjectMap);
    } catch (InvocationTargetException e) {
      throw new SystemException("error on creating resource", e);
    } catch (IllegalAccessException e) {
      throw new SystemException("error on creating resource", e);
    }
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

    getResourceManager().create(udf);
  }

  @Override
  public boolean updateResource(String resourceId, Map<String, Object> stringObjectMap) throws SystemException, NoSuchResourceException, UnsupportedPropertyException {
    UDF udf = null;
    try {
      udf = new UDF(stringObjectMap);
    } catch (InvocationTargetException e) {
      throw new SystemException("error on updating resource", e);
    } catch (IllegalAccessException e) {
      throw new SystemException("error on updating resource", e);
    }
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

    udfService = getService(UDFService.class, handler, context);
  }

  private Response doCreateUDF() {
    UDFService.UDFRequest request = new UDFService.UDFRequest();
    request.udf = new UDF();
    request.udf.setPath("/tmp/udf.jar");
    request.udf.setName("TestUDF");

    UriInfo uriInfo = createNiceMock(UriInfo.class);
    URI uri = UriBuilder.fromUri("http://host/a/b").build();
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

  public void updateUDF() {
    Response createdUDF = doCreateUDF();
    String createdUdfId = ((UDF) ((JSONObject) createdUDF.getEntity()).get("udf")).getId();

    UDFService.UDFRequest request = new UDFService.UDFRequest();
    request.udf = new UDF();
    request.udf.setPath("/tmp/updatedUDF.jar");
    request.udf.setName("TestUDF2");

    Response response = udfService.updateUDF(request, createdUdfId);
    Assert.assertEquals(204, response.getStatus());
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

   */
  @GET
  @Path("{udfId}")
  @Produces(MediaType.APPLICATION_JSON)
  public Response getUDF(@PathParam("udfId") String udfId) {
    UDF udf = null;
    try {
      udf = getResourceManager().read(udfId);
    } catch (ItemNotFound itemNotFound) {
      return Response.status(404).build();
    }
View Full Code Here

Examples of org.apache.ambari.view.pig.resources.udf.models.UDF

  @Consumes(MediaType.APPLICATION_JSON)
  public Response createUDF(UDFRequest request, @Context HttpServletResponse response,
                            @Context UriInfo ui) {
    getResourceManager().create(request.udf);

    UDF udf = null;

    try {
      udf = getResourceManager().read(request.udf.getId());
    } catch (ItemNotFound itemNotFound) {
      return Response.status(404).build();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.