@Override public boolean advanceNextPosition() { if (nanoStart == 0) { nanoStart = System.nanoTime(); } try { if (iterator.hasNext()) { serializer.reset(); Entry<Key, Value> row = iterator.next(); for (Entry<Key, Value> entry : WholeRowIterator.decodeRow(row.getKey(), row.getValue()).entrySet()) { bytesRead += entry.getKey().getSize() + entry.getValue().getSize(); serializer.deserialize(entry); } return true; } else { return false; } } catch (IOException e) { throw new PrestoException(IO_ERROR, "Caught IO error from serializer on read", e); } }
for (Entry<Key, Value> entry : scanner) { SortedMap<Key, Value> row = WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()); HashMap<String, ByteIterator> rowData; if (null != fields) {
for (Entry<Key, Value> entry : scanner) { SortedMap<Key, Value> row = WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()); HashMap<String, ByteIterator> rowData; if (null != fields) {
for (Entry<Key, Value> entry : scanner) { SortedMap<Key, Value> row = WholeRowIterator.decodeRow(entry.getKey(), entry.getValue()); HashMap<String, ByteIterator> rowData; if (null != fields) {
@Override public SortedMap<Key,Value> rowDecoder(Key rowKey, Value rowValue) throws IOException { return decodeRow(rowKey, rowValue); }
private void decodeRows(TreeMap<Key,Value> encodedResults, TreeMap<Key,Value> results) throws AccumuloException { for (Entry<Key,Value> entry : encodedResults.entrySet()) { try { results.putAll(WholeRowIterator.decodeRow(entry.getKey(), entry.getValue())); } catch (IOException e) { throw new AccumuloException(e); } } }
SortedMap<Key,Value> columns; try { columns = WholeRowIterator.decodeRow(rowEntry.getKey(), rowEntry.getValue()); } catch (IOException e) { log.error("Could not deserialize {} with WholeRowIterator", rowEntry.getKey().getRow(), e);
for (Entry<Key,Value> entry : entries) { try { results.putAll(WholeRowIterator.decodeRow(entry.getKey(), entry.getValue())); } catch (IOException e) { throw new RuntimeException(e);
SortedMap<Key,Value> wholeRow; try { wholeRow = WholeRowIterator.decodeRow(serializedRow.getKey(), serializedRow.getValue()); } catch (IOException e) { log.warn("Could not deserialize whole row with key {}",
public static TabletLocationState createTabletLocationState(Key k, Value v) throws IOException, BadLocationStateException { final SortedMap<Key,Value> decodedRow = WholeRowIterator.decodeRow(k, v); KeyExtent extent = null; TServerInstance future = null;
@Override public SortedMap<Key,Value> rowDecoder(Key rowKey, Value rowValue) throws IOException { return decodeRow(rowKey, rowValue); }
/** * Decodes a Key-Value pair encoded by <code>org.apache.accumulo.core.iterators.user.WholeRowIterator</code> into a * <code>SortedMap</code> containing the contents of the encoded row. * * @param encodedRow * @return * @throws IOException */ public static SortedMap<Key, Value> buildRowMap(Entry<Key, Value> encodedRow) throws IOException { return decodeRow(encodedRow.getKey(), encodedRow.getValue()); }
@Override public void receive(List<Entry<Key,Value>> entries) { for (Entry<Key,Value> entry : entries) { try { results.putAll(WholeRowIterator.decodeRow(entry.getKey(), entry.getValue())); } catch (IOException e) { throw new RuntimeException(e); } } } };
private void decodeRows(TreeMap<Key,Value> encodedResults, TreeMap<Key,Value> results) throws AccumuloException { for (Entry<Key,Value> entry : encodedResults.entrySet()) { try { results.putAll(WholeRowIterator.decodeRow(entry.getKey(), entry.getValue())); } catch (IOException e) { throw new AccumuloException(e); } } }
@Override public Iterator<? extends Map.Entry<Key, Value>> apply(final Key k0, Value v0) throws IOException { SortedMap<Key, Value> Trow = WholeRowIterator.decodeRow(k0, v0); int numWords = Trow.size(); double idf = Math.log(1 + (((double)numDocs) / (1 + numWords))); // log.debug(String.format("(numDocs, numWords)= %2d, %2d", numDocs, numWords)); Text wordHolder = new Text(); Set<Map.Entry<Key, Value>> entrySet = Trow.entrySet(); for (Map.Entry<Key, Value> entry : entrySet) { String word = entry.getKey().getColumnQualifier(wordHolder).toString(); double sumWordsInDoc = degMap.get(word); double oldval = Double.parseDouble(entry.getValue().toString()); double newval = oldval * (1/sumWordsInDoc) * idf; // log.debug(String.format("(numWords=%2d): %s %.3f * %.3f * %.3f = %.3f", // numWords, entry.getKey().toStringNoTime(), // oldval, (1/sumWordsInDoc), idf, newval)); entry.setValue(new Value(Double.toString(newval).getBytes(StandardCharsets.UTF_8))); } return entrySet.iterator(); }
@Override protected void map(final Key key, final Value value, final Context context) throws IOException, InterruptedException { final List<SimpleFeature> sf = sfg.mapOSMtoSimpleFeature(WholeRowIterator.decodeRow(key, value), osmProvider); if ((sf != null) && (sf.size() > 0)) { for (final SimpleFeature feat : sf) { final String name = feat.getType().getTypeName(); context.write(new GeoWaveOutputKey(name, indexName), feat); } } }
SortedMap<Key,Value> columns; try { columns = WholeRowIterator.decodeRow(rowEntry.getKey(), rowEntry.getValue()); } catch (IOException e) { log.error("Could not deserialize {} with WholeRowIterator", rowEntry.getKey().getRow(), e);
public static TabletLocationState createTabletLocationState(Key k, Value v) throws IOException, BadLocationStateException { final SortedMap<Key,Value> decodedRow = WholeRowIterator.decodeRow(k, v); KeyExtent extent = null; TServerInstance future = null;
SortedMap<Key,Value> wholeRow; try { wholeRow = WholeRowIterator.decodeRow(serializedRow.getKey(), serializedRow.getValue()); } catch (IOException e) { log.warn("Could not deserialize whole row with key {}",
public static TabletLocationState createTabletLocationState(Key k, Value v) throws IOException, BadLocationStateException { final SortedMap<Key,Value> decodedRow = WholeRowIterator.decodeRow(k, v); KeyExtent extent = null; TServerInstance future = null;