Package org.apache.hadoop.chukwa.datacollection.writer

Examples of org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter


   * Checks the CommitCheckServlet works correctly with a one-chunk file.
   */
  public void testDelayedAck() throws Exception {
    Configuration conf = new Configuration();

    SeqFileWriter writer = new SeqFileWriter();

    conf.set("writer.hdfs.filesystem", "file:///");
   
    File tempDir = new File(System.getProperty("test.build.data", "/tmp"));
    if (!tempDir.exists()) {
      tempDir.mkdirs();
    }
   
    String outputDirectory = tempDir.getPath() + "/test_DA" + System.currentTimeMillis();

    String seqWriterOutputDir = outputDirectory +"/seqWriter/seqOutputDir";
    conf.set(SeqFileWriter.OUTPUT_DIR_OPT, seqWriterOutputDir );

    writer.init(conf);
    ArrayList<Chunk> oneChunk = new ArrayList<Chunk>();
    oneChunk.add(new ChunkImpl("dt", "name", 1, new byte[] {'b'}, null));

    ChukwaWriter.CommitStatus cs = writer.add(oneChunk);
    writer.close();
   
    File seqWriterFile = null;
    File directory = new File(seqWriterOutputDir);
    String[] files = directory.list();
    for(String file: files) {
View Full Code Here


   * Checks the CommitCheckServlet works correctly with a one-chunk file.
   */
  public void testDelayedAck() throws Exception {
    Configuration conf = new Configuration();

    SeqFileWriter writer = new SeqFileWriter();

    conf.set("writer.hdfs.filesystem", "file:///");
   
    File tempDir = new File(System.getProperty("test.build.data", "/tmp"));
    if (!tempDir.exists()) {
      tempDir.mkdirs();
    }
   
    String outputDirectory = tempDir.getPath() + "/test_DA" + System.currentTimeMillis();

    String seqWriterOutputDir = outputDirectory +"/seqWriter/seqOutputDir";
    conf.set(SeqFileWriter.OUTPUT_DIR_OPT, seqWriterOutputDir );

    writer.init(conf);
    ArrayList<Chunk> oneChunk = new ArrayList<Chunk>();
    oneChunk.add(new ChunkImpl("dt", "name", 1, new byte[] {'b'}, null));

    ChukwaWriter.CommitStatus cs = writer.add(oneChunk);
    writer.close();
   
    File seqWriterFile = null;
    File directory = new File(seqWriterOutputDir);
    String[] files = directory.list();
    for(String file: files) {
View Full Code Here

        }
      }
      */
          //FIXME: seems weird to initialize a static object here
      if (writer == null)
        writer =  new SeqFileWriter();

    } catch (IOException e) {
      throw new ServletException("Problem init-ing servlet", e);
    }   
  }
View Full Code Here

    }
   
    // We default to here if the pipeline construction failed or didn't happen.
    try {
      if (writer == null) {
        writer =  new SeqFileWriter();
      }
     
      writer.init(conf);
    } catch (Throwable e) {
      log.warn("Exception trying to initialize SeqFileWriter",e);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter

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.