use of org.apache.accumulo.core.data.KeyValue in project accumulo by apache.
the class IteratorAdapter method next.
@Override
public Entry<Key, Value> next() {
try {
Entry<Key, Value> result = new KeyValue(new Key(inner.getTopKey()), new Value(inner.getTopValue()).get());
inner.next();
return result;
} catch (IOException ex) {
throw new NoSuchElementException();
}
}
use of org.apache.accumulo.core.data.KeyValue in project accumulo by apache.
the class AccumuloRowInputFormatIT method prepareRows.
@BeforeClass
public static void prepareRows() {
row1 = new ArrayList<>();
row1.add(new KeyValue(new Key(ROW1, COLF1, "colq1"), "v1".getBytes()));
row1.add(new KeyValue(new Key(ROW1, COLF1, "colq2"), "v2".getBytes()));
row1.add(new KeyValue(new Key(ROW1, "colf2", "colq3"), "v3".getBytes()));
row2 = new ArrayList<>();
row2.add(new KeyValue(new Key(ROW2, COLF1, "colq4"), "v4".getBytes()));
row3 = new ArrayList<>();
row3.add(new KeyValue(new Key(ROW3, COLF1, "colq5"), "v5".getBytes()));
}
use of org.apache.accumulo.core.data.KeyValue in project accumulo by apache.
the class OfflineIterator method next.
@Override
public Entry<Key, Value> next() {
try {
byte[] v = iter.getTopValue().get();
// copy just like tablet server does, do this before calling next
KeyValue ret = new KeyValue(new Key(iter.getTopKey()), Arrays.copyOf(v, v.length));
iter.next();
while (iter != null && !iter.hasTop()) nextTablet();
return ret;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of org.apache.accumulo.core.data.KeyValue in project accumulo-examples by apache.
the class ChunkInputStreamTest method addData.
private static void addData(List<Entry<Key, Value>> data, String row, String cf, int chunkSize, int chunkCount, String vis, String value) {
Text chunkCQ = new Text(FileDataIngest.intToBytes(chunkSize));
chunkCQ.append(FileDataIngest.intToBytes(chunkCount), 0, 4);
data.add(new KeyValue(new Key(new Text(row), new Text(cf), chunkCQ, new Text(vis)), value.getBytes()));
}
use of org.apache.accumulo.core.data.KeyValue in project accumulo by apache.
the class AccumuloRowInputFormatIT method prepareRows.
@BeforeClass
public static void prepareRows() {
row1 = new ArrayList<>();
row1.add(new KeyValue(new Key(ROW1, COLF1, "colq1"), "v1".getBytes()));
row1.add(new KeyValue(new Key(ROW1, COLF1, "colq2"), "v2".getBytes()));
row1.add(new KeyValue(new Key(ROW1, "colf2", "colq3"), "v3".getBytes()));
row2 = new ArrayList<>();
row2.add(new KeyValue(new Key(ROW2, COLF1, "colq4"), "v4".getBytes()));
row3 = new ArrayList<>();
row3.add(new KeyValue(new Key(ROW3, COLF1, "colq5"), "v5".getBytes()));
}
Aggregations