Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.Mutation.readFields()


          System.out.println("Log : " + entry.getValue());
        lastLog = entry.getValue().toString();
      } else if (entry.getKey().getColumnQualifier().toString().equals("mut")) {
        DataInputStream dis = new DataInputStream(new ByteArrayInputStream(entry.getValue().get()));
        Mutation m = new Mutation();
        m.readFields(dis);
       
        LogFileValue lfv = new LogFileValue();
        lfv.mutations = Collections.singletonList(m);
       
        System.out.println(LogFileValue.format(lfv, 1));
View Full Code Here


          System.out.println("Log : " + entry.getValue());
        lastLog = entry.getValue().toString();
      } else if (entry.getKey().getColumnQualifier().toString().equals("mut")) {
        DataInputStream dis = new DataInputStream(new ByteArrayInputStream(entry.getValue().get()));
        Mutation m = new Mutation();
        m.readFields(dis);
       
        LogFileValue lfv = new LogFileValue();
        lfv.mutations = Collections.singletonList(m);
       
        System.out.println(LogFileValue.format(lfv, 1));
View Full Code Here

        return eventType != CLOSE_EVENT;
      }
     
      public Mutation next() {
        try {
          mutation.readFields(login);
          eventType = login.readByte();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
       
View Full Code Here

        return eventType != CLOSE_EVENT;
      }
     
      public Mutation next() {
        try {
          mutation.readFields(login);
          eventType = login.readByte();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
       
View Full Code Here

    // reuse the same mutation object, and make sure everything is correct.
    ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
    DataInputStream dis = new DataInputStream(bis);
   
    Mutation m = new Mutation();
    m.readFields(dis);
   
    assertEquals("row1", new String(m.getRow()));
    assertEquals(size1, m.size());
    assertEquals(nb1, m.numBytes());
    assertEquals(3, m.getUpdates().size());
View Full Code Here

    assertEquals(m.getUpdates().get(1), "cf1.2", "cq1.2", "C|D", 0L, false, false, "val1.2");
    assertEquals(m.getUpdates().get(2), "cf1.3", "cq1.3", "E|F", 0L, false, false, new String(val1_3));
   
    // Reuse the same mutation object (which is what happens in the hadoop framework
    // when objects are read by an input format)
    m.readFields(dis);
   
    assertEquals("row2", new String(m.getRow()));
    assertEquals(size2, m.size());
    assertEquals(nb2, m.numBytes());
    assertEquals(1, m.getUpdates().size());
View Full Code Here

    ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
    DataInputStream dis = new DataInputStream(bis);
   
    // used to be a bug where puts done before readFields would be seen
    // after readFields
    m2.readFields(dis);
   
    assertEquals("r1", new String(m2.getRow()));
    assertEquals(2, m2.getUpdates().size());
    assertEquals(2, m2.size());
    assertEquals(m2.getUpdates().get(0), "cf1", "cq1", "", 0l, false, false, "v1");
View Full Code Here

        return eventType != CLOSE_EVENT;
      }
     
      public Mutation next() {
        try {
          mutation.readFields(login);
          eventType = login.readByte();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
       
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.