test_class.declarator: TEST_DATA = "target/test-data/TestHttpDataServer"
test_class.modifier: private
test_class.original_string: private String TEST_DATA = "target/test-data/TestHttpDataServer";
test_class.type: String
test_class.var_name: TEST_DATA
test_class.file: tajo-core/src/test/java/org/apache/tajo/worker/dataserver/TestHttpDataServer.java
test_class.identifier: TestHttpDataServer
test_case.body: @Test
    public final void testHttpDataServer() throws Exception {
      Random rnd = new Random();
      FileWriter writer = new FileWriter(TEST_DATA+"/"+"testHttp");
      String watermark = "test_"+rnd.nextInt();
      writer.write(watermark+"\n");
      writer.flush();
      writer.close();
  
      DataRetriever ret = new DirectoryRetriever(TEST_DATA);
      HttpDataServer server = new HttpDataServer(
          NetUtils.createSocketAddr("127.0.0.1:0"), ret);
      server.start();
  
      InetSocketAddress addr = server.getBindAddress();
      URL url = new URL("http://127.0.0.1:"+addr.getPort() 
          + "/testHttp");
      BufferedReader in = new BufferedReader(new InputStreamReader(
          url.openStream()));
      String line;
      boolean found = false;
      while ((line = in.readLine()) != null) {
        if (line.equals(watermark))
          found = true;
      }    
      assertTrue(found);
      in.close();    
      server.stop();
    }
test_case.class_method_signature: TestHttpDataServer.testHttpDataServer()
test_case.full_signature: @Test public final void testHttpDataServer()
test_case.identifier: testHttpDataServer
test_case.invocations: nextInt write flush close createSocketAddr start getBindAddress getPort openStream readLine equals assertTrue close stop
test_case.modifiers: @Test public final
test_case.parameters: ()
test_case.return: void
test_case.signature: void testHttpDataServer()
focal_class.declarator: LOG = LogFactory.getLog(HttpDataServer.class)
focal_class.modifier: private final static
focal_class.original_string: private final static Log LOG = LogFactory.getLog(HttpDataServer.class);
focal_class.type: Log
focal_class.var_name: LOG
focal_class.declarator: addr
focal_class.modifier: private final
focal_class.original_string: private final InetSocketAddress addr;
focal_class.type: InetSocketAddress
focal_class.var_name: addr
focal_class.declarator: bindAddr
focal_class.modifier: private
focal_class.original_string: private InetSocketAddress bindAddr;
focal_class.type: InetSocketAddress
focal_class.var_name: bindAddr
focal_class.declarator: bootstrap = null
focal_class.modifier: private
focal_class.original_string: private ServerBootstrap bootstrap = null;
focal_class.type: ServerBootstrap
focal_class.var_name: bootstrap
focal_class.declarator: factory = null
focal_class.modifier: private
focal_class.original_string: private ChannelFactory factory = null;
focal_class.type: ChannelFactory
focal_class.var_name: factory
focal_class.declarator: channelGroup = null
focal_class.modifier: private
focal_class.original_string: private ChannelGroup channelGroup = null;
focal_class.type: ChannelGroup
focal_class.var_name: channelGroup
focal_class.file: tajo-core/src/main/java/org/apache/tajo/worker/dataserver/HttpDataServer.java
focal_class.identifier: HttpDataServer
focal_class.class_method_signature: HttpDataServer.HttpDataServer(final InetSocketAddress addr, 
        final DataRetriever retriever)
focal_class.full_signature: public  HttpDataServer(final InetSocketAddress addr, 
        final DataRetriever retriever)
focal_class.identifier: HttpDataServer
focal_class.modifiers: public
focal_class.parameters: (final InetSocketAddress addr, 
        final DataRetriever retriever)
focal_class.signature:  HttpDataServer(final InetSocketAddress addr, 
        final DataRetriever retriever)
focal_class.class_method_signature: HttpDataServer.HttpDataServer(String bindaddr, DataRetriever retriever)
focal_class.full_signature: public  HttpDataServer(String bindaddr, DataRetriever retriever)
focal_class.identifier: HttpDataServer
focal_class.modifiers: public
focal_class.parameters: (String bindaddr, DataRetriever retriever)
focal_class.signature:  HttpDataServer(String bindaddr, DataRetriever retriever)
focal_class.class_method_signature: HttpDataServer.start()
focal_class.full_signature: public void start()
focal_class.identifier: start
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void start()
focal_class.class_method_signature: HttpDataServer.getBindAddress()
focal_class.full_signature: public InetSocketAddress getBindAddress()
focal_class.identifier: getBindAddress
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: InetSocketAddress
focal_class.signature: InetSocketAddress getBindAddress()
focal_class.class_method_signature: HttpDataServer.stop()
focal_class.full_signature: public void stop()
focal_class.identifier: stop
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void stop()
focal_method.body: public HttpDataServer(final InetSocketAddress addr, 
        final DataRetriever retriever) {
      this.addr = addr;
      this.factory = new NioServerSocketChannelFactory(
          Executors.newCachedThreadPool(), Executors.newCachedThreadPool(),
          Runtime.getRuntime().availableProcessors() * 2);
  
      // Configure the server.
      this.bootstrap = new ServerBootstrap(factory);
      // Set up the event pipeline factory.
      this.bootstrap.setPipelineFactory(
          new HttpDataServerPipelineFactory(retriever));    
      this.channelGroup = new DefaultChannelGroup();
    }
focal_method.class_method_signature: HttpDataServer.HttpDataServer(final InetSocketAddress addr, 
        final DataRetriever retriever)
focal_method.full_signature: public  HttpDataServer(final InetSocketAddress addr, 
        final DataRetriever retriever)
focal_method.identifier: HttpDataServer
focal_method.modifiers: public
focal_method.parameters: (final InetSocketAddress addr, 
        final DataRetriever retriever)
focal_method.signature:  HttpDataServer(final InetSocketAddress addr, 
        final DataRetriever retriever)