Package eu.stratosphere.test.recordJobs.util

Examples of eu.stratosphere.test.recordJobs.util.Tuple.compact()


   
    Tuple t = new Tuple();
    t.addAttribute("Hello world!");
   
    Assert.assertTrue(t.getBytes().length == 256);
    t.compact();
    Assert.assertTrue(t.getBytes().length == 13);
   
    byte[] ba = new byte[1024];
    int[] of = {0};
    t = new Tuple(ba, of, 0);
View Full Code Here


    byte[] ba = new byte[1024];
    int[] of = {0};
    t = new Tuple(ba, of, 0);
   
    Assert.assertTrue(t.getBytes().length == 1024);
    t.compact();
    Assert.assertTrue(t.getBytes().length == 0);
   
    ba = "attr1|attr2|3|4|attr5|thisdoesnotbelongtothetuple".getBytes();
    int[] of2 = {0,6,12,14,16,22};
    t = new Tuple(ba, of2, 5);
View Full Code Here

    ba = "attr1|attr2|3|4|attr5|thisdoesnotbelongtothetuple".getBytes();
    int[] of2 = {0,6,12,14,16,22};
    t = new Tuple(ba, of2, 5);
   
    Assert.assertTrue(t.getBytes().length == ba.length);
    t.compact();
    Assert.assertTrue(t.getBytes().length == 22);
   
  }

  @Test
View Full Code Here

    t.addAttribute("a".getBytes());
    Assert.assertTrue(t.getNumberOfColumns() == 1);
    Assert.assertTrue(t.getStringValueAt(0).equals("a"));
    Assert.assertTrue(t.getBytes().length == 256);
   
    t.compact();
    t.addAttribute("123345".getBytes());
    Assert.assertTrue(t.getNumberOfColumns() == 2);
    Assert.assertTrue(t.getLongValueAt(1) == 123345);
    Assert.assertTrue(t.getBytes().length == 9);
   
View Full Code Here

    t2.addAttributeFromKVRecord(t1, 1);
    Assert.assertTrue(t2.getNumberOfColumns() == 1);
    Assert.assertTrue(t2.getLongValueAt(0) == 123345);
    Assert.assertTrue(t2.getBytes().length == 256);
   
    t2.compact();

    t2.addAttributeFromKVRecord(t1, 2);
    Assert.assertTrue(t2.getNumberOfColumns() == 2);
    byte[] ret = t2.getByteArrayValueAt(1);
    Assert.assertTrue(ret.length == "adfasdfg".getBytes().length);
View Full Code Here

    t.addAttribute("a");
    Assert.assertTrue(t.getNumberOfColumns() == 1);
    Assert.assertTrue(t.getStringValueAt(0).equals("a"));
    Assert.assertTrue(t.getBytes().length == 256);
   
    t.compact();
    t.addAttribute(123345+"");
    Assert.assertTrue(t.getNumberOfColumns() == 2);
    Assert.assertTrue(t.getLongValueAt(1) == 123345);
    Assert.assertTrue(t.getBytes().length == 9);
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.