@Override public String toString() { return super.toString() + " mc=" + kvCount; }
@Override public String next() { final Entry<Key,Value> entry = iter.next(); String key; // Observe the timestamps if (config.willPrintTimestamps()) { key = entry.getKey().toString(); } else { key = entry.getKey().toStringNoTime(); } final Value v = entry.getValue(); // Approximate how much space we'll need final StringBuilder sb = new StringBuilder(key.length() + v.getSize() * 5); sb.append(key).append(tab); for (byte b : v.get()) { if ((b >= 48 && b <= 57) || (b >= 97 && b <= 102)) { sb.append(String.format("0x%x ", Integer.valueOf(b))); } } return sb.toString().trim() + newline; }
public static String stringTopKey(SortedKeyValueIterator<Key,Value> iter) { if (iter.hasTop()) return iter.getTopKey().toString(); return ""; }
@Override public String toString() { return super.toString() + " count=" + count; }
@Override public String getNextIdentifier() { return topKey.toString(); }
@Override public String toString() { return super.toString() + " mc=" + kvCount; }
public String toString() { return super.toString() + " mc=" + kvCount; }
@Override public String toString() { return new ToStringBuilder(this).append("tableName", tableName).append("key", key.toString()).toString(); }
/** * Just a generic print function given an iterator. Not necessarily just for printing a single row * * @param scanner */ private static void printRow(Scanner scanner) { // iterates through and prints for (Entry<Key,Value> entry : scanner) log.info("Key: " + entry.getKey().toString() + " Value: " + entry.getValue().toString()); }
public static Text parseDocID(Key key) { Text colq = key.getColumnQualifier(); int firstZeroIndex = colq.find("\0"); if (firstZeroIndex < 0) { throw new IllegalArgumentException("bad docid: " + key.toString()); } int secondZeroIndex = colq.find("\0", firstZeroIndex + 1); if (secondZeroIndex < 0) { throw new IllegalArgumentException("bad docid: " + key.toString()); } int thirdZeroIndex = colq.find("\0", secondZeroIndex + 1); if (thirdZeroIndex < 0) { throw new IllegalArgumentException("bad docid: " + key.toString()); } Text docID = new Text(); try { docID.set(colq.getBytes(), firstZeroIndex + 1, thirdZeroIndex - 1 - firstZeroIndex); } catch (ArrayIndexOutOfBoundsException e) { throw new IllegalArgumentException("bad indices for docid: " + key.toString() + " " + firstZeroIndex + " " + secondZeroIndex + " " + thirdZeroIndex); } return docID; }
public static String stringTopKey(SortedKeyValueIterator<Key,Value> iter) { if (iter.hasTop()) return iter.getTopKey().toString(); return ""; }
protected Key buildDocKey() { if (log.isTraceEnabled()) log.trace("building doc key for " + currentPartition + " " + currentDocID); int zeroIndex = currentDocID.find("\0"); if (zeroIndex < 0) throw new IllegalArgumentException("bad current docID"); Text colf = new Text(docColf); colf.append(nullByte, 0, 1); colf.append(currentDocID.getBytes(), 0, zeroIndex); docColfSet = Collections .singleton((ByteSequence) new ArrayByteSequence(colf.getBytes(), 0, colf.getLength())); if (log.isTraceEnabled()) log.trace(zeroIndex + " " + currentDocID.getLength()); Text colq = new Text(); colq.set(currentDocID.getBytes(), zeroIndex + 1, currentDocID.getLength() - zeroIndex - 1); Key k = new Key(currentPartition, colf, colq); if (log.isTraceEnabled()) log.trace("built doc key for seek: " + k.toString()); return k; }
public static String stringTopKey(SortedKeyValueIterator<Key,Value> iter) { if (iter.hasTop()) return iter.getTopKey().toString(); return ""; }
public static String stringTopKey(SortedKeyValueIterator<Key,Value> iter) { if (iter.hasTop()) return iter.getTopKey().toString(); return ""; }
public static String stringTopKey(final SortedKeyValueIterator<Key, Value> iter) { if (iter.hasTop()) { return iter.getTopKey().toString(); } return ""; }
public static String stringTopKey(final SortedKeyValueIterator<Key, Value> iter) { if (iter.hasTop()) { return iter.getTopKey().toString(); } return ""; }
public int read() throws IOException { if (source == null) return -1; log.debug("pos: " + pos + " count: " + count); if (pos >= count) { if (fill() <= 0) { log.debug("done reading input stream at key: " + (currentKey == null ? "null" : currentKey.toString())); if (source != null && source.hasNext()) log.debug("next key: " + source.peek().getKey()); clear(); return -1; } } return buf[pos++] & 0xff; }
@Override protected void advanceToIntersection() throws IOException { super.advanceToIntersection(); if (topKey == null) return; if (log.isTraceEnabled()) log.trace("using top key to seek for doc: " + topKey.toString()); Key docKey = buildDocKey(); docSource.seek(new Range(docKey, true, null, false), docColfSet, true); log.debug("got doc key: " + docSource.getTopKey().toString()); if (docSource.hasTop() && docKey.equals(docSource.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL)) { value = docSource.getTopValue(); } log.debug("got doc value: " + value.toString()); }
buf = entry.getValue().get(); while (!currentKey.getColumnFamily().equals(FileDataIngest.CHUNK_CF)) { log.debug("skipping key: " + currentKey.toString()); if (!source.hasNext()) return; buf = entry.getValue().get(); log.debug("starting chunk: " + currentKey.toString()); count = buf.length; currentVis.add(currentKey.getColumnVisibility());
System.out.println(entry.getKey().toString() + " -> " + entry.getValue().toString());