test_class.declarator: HADOOP_TMP_PATH = "target/hadoop"
test_class.modifier: private static final
test_class.original_string: private static final String HADOOP_TMP_PATH = "target/hadoop";
test_class.type: String
test_class.var_name: HADOOP_TMP_PATH
test_class.declarator: conf
test_class.modifier: private
test_class.original_string: private Configuration conf;
test_class.type: Configuration
test_class.var_name: conf
test_class.declarator: fileSystem
test_class.modifier: private
test_class.original_string: private FileSystem fileSystem;
test_class.type: FileSystem
test_class.var_name: fileSystem
test_class.file: service/src/test/java/org/pig/oink/rest/TestPigResource.java
test_class.identifier: TestPigResource
test_case.body: @Test 
      public void testGetOutpu() throws Exception {
      	PigResource resource= new PigResource();
  
      	String requestId= UUID.randomUUID().toString();
      	String inputString= "1,2,3,4,5";
      	String path= PropertyLoader.getInstance().getProperty("requests.basepath") + requestId 
      			+ "/output/part-00000";
      	
      	BufferedWriter writer= new BufferedWriter(
      			new OutputStreamWriter(fileSystem.create(new Path(path), false)));
  		writer.write(inputString);
  		writer.close();
      	Response resp=  resource.getOutput(requestId);
      	Assert.assertEquals(resp.getStatus(), 200);
      	
      	StreamingPigOutputImpl out= (StreamingPigOutputImpl) resp.getEntity();
      	ByteArrayOutputStream output= new ByteArrayOutputStream();
      	out.write(output);
      	
      	String outStr= output.toString();
      	Assert.assertEquals(outStr.contains("1,2,3,4"), true);
      	
      	requestId= "abc";
      	try {
      		resp=  resource.getOutput(requestId);
      	} catch (Exception e) {
      		Assert.assertNotNull(resp);
      	}
      }
test_case.class_method_signature: TestPigResource.testGetOutpu()
test_case.full_signature: @Test public void testGetOutpu()
test_case.identifier: testGetOutpu
test_case.invocations: toString randomUUID getProperty getInstance create write close getOutput assertEquals getStatus getEntity write toString assertEquals contains getOutput assertNotNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetOutpu()
focal_class.declarator: logger= Logger.getLogger(PigResource.class)
focal_class.modifier: private
focal_class.original_string: private Logger logger= Logger.getLogger(PigResource.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: requestInfo
focal_class.modifier: @Context 
  	private
focal_class.original_string: @Context 
  	private HttpServletRequest requestInfo;
focal_class.type: HttpServletRequest
focal_class.var_name: requestInfo
focal_class.file: service/src/main/java/org/pig/oink/rest/PigResource.java
focal_class.identifier: PigResource
focal_class.class_method_signature: PigResource.registerJar(@PathParam("jarName") String jarName, InputStream uploadedJar)
focal_class.full_signature: @POST @Path("/jar/{jarName}") @Consumes ( {MediaType.APPLICATION_OCTET_STREAM} ) @Produces ({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) public Response registerJar(@PathParam("jarName") String jarName, InputStream uploadedJar)
focal_class.identifier: registerJar
focal_class.modifiers: @POST @Path("/jar/{jarName}") @Consumes ( {MediaType.APPLICATION_OCTET_STREAM} ) @Produces ({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) public
focal_class.parameters: (@PathParam("jarName") String jarName, InputStream uploadedJar)
focal_class.return: Response
focal_class.signature: Response registerJar(@PathParam("jarName") String jarName, InputStream uploadedJar)
focal_class.class_method_signature: PigResource.unregisterJar(@PathParam("jarName") String jarName)
focal_class.full_signature: @DELETE @Path("/jar/{jarName}") @Produces ( {MediaType.TEXT_PLAIN} ) public Response unregisterJar(@PathParam("jarName") String jarName)
focal_class.identifier: unregisterJar
focal_class.modifiers: @DELETE @Path("/jar/{jarName}") @Produces ( {MediaType.TEXT_PLAIN} ) public
focal_class.parameters: (@PathParam("jarName") String jarName)
focal_class.return: Response
focal_class.signature: Response unregisterJar(@PathParam("jarName") String jarName)
focal_class.class_method_signature: PigResource.getRegisteredJar(@PathParam("jarName") String jarName)
focal_class.full_signature: @GET @Path("/jar/{jarName}") @Produces ( {MediaType.APPLICATION_OCTET_STREAM} ) public Response getRegisteredJar(@PathParam("jarName") String jarName)
focal_class.identifier: getRegisteredJar
focal_class.modifiers: @GET @Path("/jar/{jarName}") @Produces ( {MediaType.APPLICATION_OCTET_STREAM} ) public
focal_class.parameters: (@PathParam("jarName") String jarName)
focal_class.return: Response
focal_class.signature: Response getRegisteredJar(@PathParam("jarName") String jarName)
focal_class.class_method_signature: PigResource.registerScript(@PathParam("scriptName") String scriptName, InputStream uploadedScript)
focal_class.full_signature: @POST @Path("/script/{scriptName}") @Consumes ( {MediaType.APPLICATION_OCTET_STREAM} ) @Produces ({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) public Response registerScript(@PathParam("scriptName") String scriptName, InputStream uploadedScript)
focal_class.identifier: registerScript
focal_class.modifiers: @POST @Path("/script/{scriptName}") @Consumes ( {MediaType.APPLICATION_OCTET_STREAM} ) @Produces ({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN}) public
focal_class.parameters: (@PathParam("scriptName") String scriptName, InputStream uploadedScript)
focal_class.return: Response
focal_class.signature: Response registerScript(@PathParam("scriptName") String scriptName, InputStream uploadedScript)
focal_class.class_method_signature: PigResource.unregisterScript(@PathParam("scriptName") String scriptName)
focal_class.full_signature: @DELETE @Path("/script/{scriptName}") @Produces ( {MediaType.TEXT_PLAIN} ) public Response unregisterScript(@PathParam("scriptName") String scriptName)
focal_class.identifier: unregisterScript
focal_class.modifiers: @DELETE @Path("/script/{scriptName}") @Produces ( {MediaType.TEXT_PLAIN} ) public
focal_class.parameters: (@PathParam("scriptName") String scriptName)
focal_class.return: Response
focal_class.signature: Response unregisterScript(@PathParam("scriptName") String scriptName)
focal_class.class_method_signature: PigResource.getRegisteredScript(@PathParam("scriptName") String scriptName)
focal_class.full_signature: @GET @Path("/script/{scriptName}") @Produces ( {MediaType.APPLICATION_OCTET_STREAM} ) public Response getRegisteredScript(@PathParam("scriptName") String scriptName)
focal_class.identifier: getRegisteredScript
focal_class.modifiers: @GET @Path("/script/{scriptName}") @Produces ( {MediaType.APPLICATION_OCTET_STREAM} ) public
focal_class.parameters: (@PathParam("scriptName") String scriptName)
focal_class.return: Response
focal_class.signature: Response getRegisteredScript(@PathParam("scriptName") String scriptName)
focal_class.class_method_signature: PigResource.submitPigJob(@PathParam("scriptName") String scriptName, String data)
focal_class.full_signature: @POST @Path("/request/{scriptName}") @Consumes( {MediaType.APPLICATION_JSON} ) @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} ) public Response submitPigJob(@PathParam("scriptName") String scriptName, String data)
focal_class.identifier: submitPigJob
focal_class.modifiers: @POST @Path("/request/{scriptName}") @Consumes( {MediaType.APPLICATION_JSON} ) @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} ) public
focal_class.parameters: (@PathParam("scriptName") String scriptName, String data)
focal_class.return: Response
focal_class.signature: Response submitPigJob(@PathParam("scriptName") String scriptName, String data)
focal_class.class_method_signature: PigResource.getInput(@PathParam("requestId") String requestId)
focal_class.full_signature: @GET @Path("/request/{requestId}") @Produces( {MediaType.APPLICATION_JSON} ) public Response getInput(@PathParam("requestId") String requestId)
focal_class.identifier: getInput
focal_class.modifiers: @GET @Path("/request/{requestId}") @Produces( {MediaType.APPLICATION_JSON} ) public
focal_class.parameters: (@PathParam("requestId") String requestId)
focal_class.return: Response
focal_class.signature: Response getInput(@PathParam("requestId") String requestId)
focal_class.class_method_signature: PigResource.getRequestStats(@PathParam("requestId") String requestId)
focal_class.full_signature: @GET @Path("/request/{requestId}/stats") @Produces( {MediaType.APPLICATION_JSON} ) public Response getRequestStats(@PathParam("requestId") String requestId)
focal_class.identifier: getRequestStats
focal_class.modifiers: @GET @Path("/request/{requestId}/stats") @Produces( {MediaType.APPLICATION_JSON} ) public
focal_class.parameters: (@PathParam("requestId") String requestId)
focal_class.return: Response
focal_class.signature: Response getRequestStats(@PathParam("requestId") String requestId)
focal_class.class_method_signature: PigResource.getOutput(@PathParam("requestId") String requestId)
focal_class.full_signature: @GET @Path("/request/{requestId}/output") @Produces( {MediaType.TEXT_PLAIN} ) public Response getOutput(@PathParam("requestId") String requestId)
focal_class.identifier: getOutput
focal_class.modifiers: @GET @Path("/request/{requestId}/output") @Produces( {MediaType.TEXT_PLAIN} ) public
focal_class.parameters: (@PathParam("requestId") String requestId)
focal_class.return: Response
focal_class.signature: Response getOutput(@PathParam("requestId") String requestId)
focal_class.class_method_signature: PigResource.getRequestStatus(@PathParam("requestId") String requestId)
focal_class.full_signature: @GET @Path("request/{requestId}/status") @Produces( {MediaType.TEXT_PLAIN} ) public Response getRequestStatus(@PathParam("requestId") String requestId)
focal_class.identifier: getRequestStatus
focal_class.modifiers: @GET @Path("request/{requestId}/status") @Produces( {MediaType.TEXT_PLAIN} ) public
focal_class.parameters: (@PathParam("requestId") String requestId)
focal_class.return: Response
focal_class.signature: Response getRequestStatus(@PathParam("requestId") String requestId)
focal_class.class_method_signature: PigResource.cancelRequest(@PathParam("requestId") String requestId)
focal_class.full_signature: @GET @Path("request/{requestId}/cancel") @Produces( {MediaType.TEXT_PLAIN} ) public Response cancelRequest(@PathParam("requestId") String requestId)
focal_class.identifier: cancelRequest
focal_class.modifiers: @GET @Path("request/{requestId}/cancel") @Produces( {MediaType.TEXT_PLAIN} ) public
focal_class.parameters: (@PathParam("requestId") String requestId)
focal_class.return: Response
focal_class.signature: Response cancelRequest(@PathParam("requestId") String requestId)
focal_method.body: @GET 
  	@Path("/request/{requestId}/output")
  	@Produces( {MediaType.TEXT_PLAIN} )
  	public Response getOutput(@PathParam("requestId") String requestId) throws IOException {
          logger.info("Request for reading output for " + requestId);
  		String outputPath= PropertyLoader.getInstance().getProperty(Constants.REQUEST_PATH) + requestId;
  		StreamingPigOutputImpl streamingPigOutputImpl = new StreamingPigOutputImpl(outputPath);	
     
  		if(streamingPigOutputImpl.isAvailable() == false) {
  		    logger.info("Request " + requestId + " not available");
  			return Response.status(404).entity("Invalid Request ID").build();				   
  	    }
  		return Response.ok(streamingPigOutputImpl).build();
  	}
focal_method.class_method_signature: PigResource.getOutput(@PathParam("requestId") String requestId)
focal_method.full_signature: @GET @Path("/request/{requestId}/output") @Produces( {MediaType.TEXT_PLAIN} ) public Response getOutput(@PathParam("requestId") String requestId)
focal_method.identifier: getOutput
focal_method.invocations: info getProperty getInstance isAvailable info build entity status build ok
focal_method.modifiers: @GET @Path("/request/{requestId}/output") @Produces( {MediaType.TEXT_PLAIN} ) public
focal_method.parameters: (@PathParam("requestId") String requestId)
focal_method.return: Response
focal_method.signature: Response getOutput(@PathParam("requestId") String requestId)