Ejemplo n.º 1
0
 protected Statement peekNextStatement() throws Exception {
   if (!statefulHasNext()) return null;
   Map.Entry<Key, Value> entry = iter.peek();
   Key key = entry.getKey();
   if (DOC.equals(key.getColumnFamily()))
     return readStatement(
         ByteStreams.newDataInput(key.getColumnQualifier().getBytes()), VALUE_FACTORY);
   else
     return readStatement(
         ByteStreams.newDataInput(key.getColumnQualifier().getBytes()), VALUE_FACTORY, false);
 }
 public static Namespace getNamespace(Iterator<Entry<Key, Value>> rowResults) {
   for (; rowResults.hasNext(); ) {
     Entry<Key, Value> next = rowResults.next();
     Key key = next.getKey();
     Value val = next.getValue();
     String cf = key.getColumnFamily().toString();
     String cq = key.getColumnQualifier().toString();
     return new NamespaceImpl(key.getRow().toString(), new String(val.get()));
   }
   return null;
 }