Package org.apache.hadoop.chukwa.util.ConstRateValidator

Examples of org.apache.hadoop.chukwa.util.ConstRateValidator.ByteRange


 
  public void testBasicSM() throws Exception {
    ValidatorSM sm = new ValidatorSM();
    byte[] dat = "test".getBytes();   
    ChunkImpl c = new ChunkImpl("Data", "aname", dat.length, dat, null);
    ByteRange b = new ByteRange(c);
    assertEquals(4, b.len);
    assertEquals(0, b.start);
    String t = sm.advanceSM(b);
    assertNull(t);
    if(t != null)
      System.out.println(t);

    dat = "ing".getBytes();
    c = new ChunkImpl("Data", "aname", dat.length+4, dat, null);
    b = new ByteRange(c);
    assertEquals(4, b.start);
    t = sm.advanceSM(b);
    assertNull(t);
    if(t != null)
      System.out.println(t);
   
   b = new ByteRange(new ChunkImpl("Data", "aname", 12, "more".getBytes(), null));
   t= sm.advanceSM(b);
   System.out.println(t);
  }
View Full Code Here


      ChukwaArchiveKey key = new ChukwaArchiveKey();
      ChunkImpl chunk = ChunkImpl.getBlankChunk();

      while (reader.next(key, chunk)) {
          String s = sm.advanceSM(new ByteRange(chunk));
          assertNull(s);
      }
      reader.close();
      assertEquals(NUM_CHUNKS, sm.chunks);     
      localfs.delete(tmpFile);
View Full Code Here

        ChukwaArchiveKey key = new ChukwaArchiveKey();
        ChunkImpl chunk = ChunkImpl.getBlankChunk();

        while (reader.next(key, chunk)) {
         bytes.add(new ByteRange(chunk));
        }
        reader.close();
      }
    }
View Full Code Here

        ChukwaArchiveKey key = new ChukwaArchiveKey();
        ChunkImpl chunk = ChunkImpl.getBlankChunk();

        while (reader.next(key, chunk)) {
         bytes.add(new ByteRange(chunk));
        }
        reader.close();
      }
    }
View Full Code Here

        ChukwaArchiveKey key = new ChukwaArchiveKey();
        ChunkImpl chunk = ChunkImpl.getBlankChunk();

        while (reader.next(key, chunk)) {
         bytes.add(new ByteRange(chunk));
        }
        reader.close();
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.chukwa.util.ConstRateValidator.ByteRange

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.