Package org.apache.hadoop.hdfs.qjournal.client

Examples of org.apache.hadoop.hdfs.qjournal.client.HttpImageUploadChannel


  public void testMaxBuffer() throws Exception {
    long txid = 101;
    // set timeout to 5 seconds
    HttpImageUploadChannel.setTimeoutForTesting(5);
    // setting -1 will cause the first send operation to fail
    HttpImageUploadChannel channel = new HttpImageUploadChannel(httpAddress,
        journalId, FAKE_NSINFO, txid, 0, -1);
    channel.start();

    ByteArrayOutputStream bos = genBos();
    channel.send(bos);
    assertTrue(channel.isDisabled());
  }
View Full Code Here


  @Test
  public void testBasic() throws Exception {
    long txid = 101;
    int iterations = 10;

    HttpImageUploadChannel channel = new HttpImageUploadChannel(httpAddress,
        journalId, FAKE_NSINFO, txid, 0, 100);
    channel.start();

    ByteArrayOutputStream bos = genBos();
    for (int i = 0; i < iterations; i++) {
      channel.send(bos);
    }
    channel.close();

    // validate

    // the file should exist
    File uploaded = journal.getImageStorage().getCheckpointImageFile(txid);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.qjournal.client.HttpImageUploadChannel

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.