Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.Value


        try {
            Connector conn = mockInstance.getConnector("user1", "password");
            BatchWriter writer = conn.createBatchWriter
                    (PEOPLE_TABLE, MAX_MEMORY, MAX_LATENCY, MAX_WRITE_THREADS);
            Mutation m1 = new Mutation("row1");
            m1.put(INFO_CF, NAME, new Value("brian".getBytes()));
            m1.put(INFO_CF, AGE, new Value(ByteBuffer.wrap(new byte[4]).putInt(30).array()));
            m1.put(INFO_CF, SIBLINGS, new Value(ByteBuffer.wrap(new byte[4]).putInt(3).array()));
            m1.put(INFO_CF, LIFETIME_MILLS, new Value(ByteBuffer.wrap(new byte[8]).putLong(12345l).array()));
            m1.put(INFO_CF, GPA, new Value(ByteBuffer.wrap(new byte[8]).putDouble(3.7d).array()));
            m1.put(INFO_CF, HEIGHT, new Value("6ft".getBytes()));
            m1.put(EVENTS_CF, EVENT1, new Value("".getBytes()));
            m1.put(EVENTS_CF, EVENT2, new Value("".getBytes()));

            Mutation m2 = new Mutation("row2");
            m2.put(INFO_CF, NAME, new Value("adam".getBytes()));
            m2.put(INFO_CF, AGE, new Value(ByteBuffer.wrap(new byte[4]).putInt(29).array()));
            m2.put(INFO_CF, SIBLINGS, new Value(ByteBuffer.wrap(new byte[4]).putInt(6).array()));
            m2.put(INFO_CF, LIFETIME_MILLS, new Value(ByteBuffer.wrap(new byte[8]).putLong(6789l).array()));
            m2.put(INFO_CF, GPA, new Value(ByteBuffer.wrap(new byte[8]).putDouble(3.2d).array()));
            m2.put(INFO_CF, HEIGHT, new Value("5ft7inch".getBytes()));
            m2.put(EVENTS_CF, EVENT1, new Value("".getBytes()));

            writer.addMutation(m1);
            writer.addMutation(m2);
            writer.close();
View Full Code Here


        try {
            Connector conn = mockInstance.getConnector("user1", "password");
            BatchWriter writer = conn.createBatchWriter
                    (PEOPLE_TABLE, MAX_MEMORY, MAX_LATENCY, MAX_WRITE_THREADS);
            Mutation m1 = new Mutation("row1");
            m1.put(INFO_CF, NAME, new Value("brian".getBytes()));
            m1.put(INFO_CF, AGE, new Value("30".getBytes()));
            m1.put(INFO_CF, HEIGHT, new Value("6ft".getBytes()));
            m1.put(EVENTS_CF, EVENT1, new Value("".getBytes()));
            m1.put(EVENTS_CF, EVENT2, new Value("".getBytes()));

            Mutation m2 = new Mutation("row2");
            m2.put(INFO_CF, NAME, new Value("adam".getBytes()));
            m2.put(INFO_CF, AGE, new Value("29".getBytes()));
            m2.put(INFO_CF, HEIGHT, new Value("5ft7inch".getBytes()));
            m2.put(EVENTS_CF, EVENT1, new Value("".getBytes()));

            writer.addMutation(m1);
            writer.addMutation(m2);
            writer.close();
View Full Code Here

                List<Mutation> mutations = Lists.newArrayList();
                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String label = CellReflector.getLabelAsString(cell);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(label), new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String label = CellReflector.getLabelAsString(cell);
                    String colVis = CellReflector.getAuxiliaryValue(String.class, cell, colVisAuxName);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(label), new ColumnVisibility(colVis), new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

                    String colFam = CellReflector.getColFam(cell);
                    String label = CellReflector.getLabelAsString(cell);
                    String colVis = CellReflector.getAuxiliaryValue(String.class, cell, colVisAuxName);
                    long ts = CellReflector.getAuxiliaryValue(long.class, cell, timestampAuxName);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(label), new ColumnVisibility(colVis), ts, new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String label = CellReflector.getLabelAsString(cell);
                    long ts = CellReflector.getAuxiliaryValue(long.class, cell, timestampAuxName);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(label),ts, new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    if(colFamsToWriteValueAsQual.contains(colFam)){
                        qual = CellReflector.getValueAsString(cell);
                        value = emptyArray;
                    }
                    m1.put(new Text(colFam), new Text(qual),new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

               List<Mutation> mutations = Lists.newArrayList();
                for (C cell : group.getInternalList()) {
                    String colFam = CellReflector.getColFam(cell);
                    String qual = CellReflector.getLabelAsString(cell);
                    byte[] value = CellReflector.getValueBytesIfPrimative(cell);
                    m1.put(new Text(colFam), new Text(qual),new Value(value));
                }
                mutations.add(m1);
                return mutations;
            }
        };
View Full Code Here

          value = update.getValue();
        if (update.isSetTimestamp()) {
          if (update.isSetDeleteCell()) {
            m.putDelete(new Text(update.getColFamily()), new Text(update.getColQualifier()), viz, update.getTimestamp());
          } else {
              m.put(new Text(update.getColFamily()), new Text(update.getColQualifier()), viz, update.getTimestamp(), new Value(value));
            }
        } else {
          if (update.isSetDeleteCell()) {
            m.putDelete(new Text(update.getColFamily()), new Text(update.getColQualifier()), viz);
          } else {
            m.put(new Text(update.getColFamily()), new Text(update.getColQualifier()), viz, new Value(value));
          }
        }
      }
      try {
        bwpe.writer.addMutation(m);
View Full Code Here

        if (timeType.equals(TimeType.LOGICAL))
          key.setTimestamp(mutationCount);
        else
          key.setTimestamp(now);
     
      table.put(new MockMemKey(key, mutationCount), new Value(u.getValue()));
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.data.Value

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.