Java Code Examples for org.apache.hadoop.io.WritableUtils#cloneInto()

The following examples show how to use org.apache.hadoop.io.WritableUtils#cloneInto() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultiFilterRecordReader.java    From hadoop with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
public boolean next(K key, V value) throws IOException {
  if (jc.flush(ivalue)) {
    WritableUtils.cloneInto(key, jc.key());
    WritableUtils.cloneInto(value, emit(ivalue));
    return true;
  }
  jc.clear();
  K iterkey = createKey();
  final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue();
  while (!q.isEmpty()) {
    fillJoinCollector(iterkey);
    jc.reset(iterkey);
    if (jc.flush(ivalue)) {
      WritableUtils.cloneInto(key, jc.key());
      WritableUtils.cloneInto(value, emit(ivalue));
      return true;
    }
    jc.clear();
  }
  return false;
}
 
Example 2
Source File: JoinRecordReader.java    From hadoop with Apache License 2.0 6 votes vote down vote up
/**
 * Emit the next set of key, value pairs as defined by the child
 * RecordReaders and operation associated with this composite RR.
 */
public boolean next(K key, TupleWritable value) throws IOException {
  if (jc.flush(value)) {
    WritableUtils.cloneInto(key, jc.key());
    return true;
  }
  jc.clear();
  K iterkey = createKey();
  final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue();
  while (!q.isEmpty()) {
    fillJoinCollector(iterkey);
    jc.reset(iterkey);
    if (jc.flush(value)) {
      WritableUtils.cloneInto(key, jc.key());
      return true;
    }
    jc.clear();
  }
  return false;
}
 
Example 3
Source File: MultiFilterRecordReader.java    From big-c with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
public boolean next(K key, V value) throws IOException {
  if (jc.flush(ivalue)) {
    WritableUtils.cloneInto(key, jc.key());
    WritableUtils.cloneInto(value, emit(ivalue));
    return true;
  }
  jc.clear();
  K iterkey = createKey();
  final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue();
  while (!q.isEmpty()) {
    fillJoinCollector(iterkey);
    jc.reset(iterkey);
    if (jc.flush(ivalue)) {
      WritableUtils.cloneInto(key, jc.key());
      WritableUtils.cloneInto(value, emit(ivalue));
      return true;
    }
    jc.clear();
  }
  return false;
}
 
Example 4
Source File: MultiFilterRecordReader.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
public boolean next(K key, V value) throws IOException {
  if (jc.flush(ivalue)) {
    WritableUtils.cloneInto(key, jc.key());
    WritableUtils.cloneInto(value, emit(ivalue));
    return true;
  }
  jc.clear();
  K iterkey = createKey();
  final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue();
  while (!q.isEmpty()) {
    fillJoinCollector(iterkey);
    jc.reset(iterkey);
    if (jc.flush(ivalue)) {
      WritableUtils.cloneInto(key, jc.key());
      WritableUtils.cloneInto(value, emit(ivalue));
      return true;
    }
    jc.clear();
  }
  return false;
}
 
Example 5
Source File: MultiFilterRecordReader.java    From RDFS with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
public boolean next(K key, V value) throws IOException {
  if (jc.flush(ivalue)) {
    WritableUtils.cloneInto(key, jc.key());
    WritableUtils.cloneInto(value, emit(ivalue));
    return true;
  }
  jc.clear();
  K iterkey = createKey();
  final PriorityQueue<ComposableRecordReader<K,?>> q = getRecordReaderQueue();
  while (!q.isEmpty()) {
    fillJoinCollector(iterkey);
    jc.reset(iterkey);
    if (jc.flush(ivalue)) {
      WritableUtils.cloneInto(key, jc.key());
      WritableUtils.cloneInto(value, emit(ivalue));
      return true;
    }
    jc.clear();
  }
  return false;
}
 
Example 6
Source File: MultiFilterRecordReader.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public boolean next(V val) throws IOException {
  boolean ret;
  if (ret = jc.flush(ivalue)) {
    WritableUtils.cloneInto(val, emit(ivalue));
  }
  return ret;
}
 
Example 7
Source File: WrappedRecordReader.java    From RDFS with Apache License 2.0 5 votes vote down vote up
/**
 * Write key-value pair at the head of this stream to the objects provided;
 * get next key-value pair from proxied RR.
 */
public boolean next(K key, U value) throws IOException {
  if (hasNext()) {
    WritableUtils.cloneInto(key, khead);
    WritableUtils.cloneInto(value, vhead);
    next();
    return true;
  }
  return false;
}
 
Example 8
Source File: ArrayListBackedIterator.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public boolean next(X val) throws IOException {
  if (iter.hasNext()) {
    WritableUtils.cloneInto(val, iter.next());
    if (null == hold) {
      hold = WritableUtils.clone(val, null);
    } else {
      WritableUtils.cloneInto(hold, val);
    }
    return true;
  }
  return false;
}
 
Example 9
Source File: ArrayListBackedIterator.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
public boolean next(X val) throws IOException {
  if (iter.hasNext()) {
    WritableUtils.cloneInto(val, iter.next());
    if (null == hold) {
      hold = WritableUtils.clone(val, null);
    } else {
      WritableUtils.cloneInto(hold, val);
    }
    return true;
  }
  return false;
}
 
Example 10
Source File: MultiFilterRecordReader.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public boolean next(V val) throws IOException {
  boolean ret;
  if (ret = jc.flush(ivalue)) {
    WritableUtils.cloneInto(val, emit(ivalue));
  }
  return ret;
}
 
Example 11
Source File: WrappedRecordReader.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Write key-value pair at the head of this stream to the objects provided;
 * get next key-value pair from proxied RR.
 */
public boolean next(K key, U value) throws IOException {
  if (hasNext()) {
    WritableUtils.cloneInto(key, khead);
    WritableUtils.cloneInto(value, vhead);
    next();
    return true;
  }
  return false;
}
 
Example 12
Source File: MultiFilterRecordReader.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
public boolean next(V val) throws IOException {
  boolean ret;
  if (ret = jc.flush(ivalue)) {
    WritableUtils.cloneInto(val, emit(ivalue));
  }
  return ret;
}
 
Example 13
Source File: WrappedRecordReader.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Write key-value pair at the head of this stream to the objects provided;
 * get next key-value pair from proxied RR.
 */
public boolean next(K key, U value) throws IOException {
  if (hasNext()) {
    WritableUtils.cloneInto(key, khead);
    WritableUtils.cloneInto(value, vhead);
    next();
    return true;
  }
  return false;
}
 
Example 14
Source File: MultiFilterRecordReader.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
public boolean replay(V val) throws IOException {
  WritableUtils.cloneInto(val, emit(ivalue));
  return true;
}
 
Example 15
Source File: MultiFilterRecordReader.java    From big-c with Apache License 2.0 4 votes vote down vote up
public boolean replay(V val) throws IOException {
  WritableUtils.cloneInto(val, emit(ivalue));
  return true;
}
 
Example 16
Source File: MultiFilterRecordReader.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public boolean replay(V val) throws IOException {
  WritableUtils.cloneInto(val, emit(ivalue));
  return true;
}
 
Example 17
Source File: WrappedRecordReader.java    From hadoop with Apache License 2.0 4 votes vote down vote up
/**
 * Clone the key at the head of this RR into the object supplied.
 */
public void key(K qkey) throws IOException {
  WritableUtils.cloneInto(qkey, khead);
}
 
Example 18
Source File: ArrayListBackedIterator.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public boolean replay(X val) throws IOException {
  WritableUtils.cloneInto(val, hold);
  return true;
}
 
Example 19
Source File: WrappedRecordReader.java    From RDFS with Apache License 2.0 4 votes vote down vote up
/**
 * Clone the key at the head of this RR into the object supplied.
 */
public void key(K qkey) throws IOException {
  WritableUtils.cloneInto(qkey, khead);
}
 
Example 20
Source File: MultiFilterRecordReader.java    From hadoop with Apache License 2.0 4 votes vote down vote up
public boolean replay(V val) throws IOException {
  WritableUtils.cloneInto(val, emit(ivalue));
  return true;
}