/** * If key provided matches that of this Composite, give JoinCollector * iterator over values it may emit. */ @SuppressWarnings("unchecked") // No values from static EMPTY class @Override public void accept(CompositeRecordReader.JoinCollector jc, K key) throws IOException, InterruptedException { if (hasNext() && 0 == cmp.compare(key, key())) { fillJoinCollector(createKey()); jc.add(id, getDelegate()); return; } jc.add(id, EMPTY); }
/** * Create a new key common to all child RRs. * @throws ClassCastException if key classes differ. */ @SuppressWarnings("unchecked") protected K createKey() { if (keyclass == null || keyclass.equals(NullWritable.class)) { return (K) NullWritable.get(); } return (K) ReflectionUtils.newInstance(keyclass, getConf()); }
@SuppressWarnings("unchecked") public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { super.initialize(split, context); }
/** * Clone the key at the top of this RR into the given object. */ public void key(K key) throws IOException { ReflectionUtils.copy(conf, key(), key); }
@SuppressWarnings("unchecked") // child types unknowable public ComposableRecordReader createRecordReader(InputSplit split, TaskAttemptContext taskContext) throws IOException, InterruptedException { if (!(split instanceof CompositeInputSplit)) { throw new IOException("Invalid split type:" + split.getClass().getName()); } final CompositeInputSplit spl = (CompositeInputSplit)split; final int capacity = kids.size(); CompositeRecordReader ret = null; try { if (!rrCstrMap.containsKey(ident)) { throw new IOException("No RecordReader for " + ident); } ret = (CompositeRecordReader)rrCstrMap.get(ident). newInstance(id, taskContext.getConfiguration(), capacity, cmpcl); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InstantiationException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } for (int i = 0; i < capacity; ++i) { ret.add(kids.get(i).createRecordReader(spl.get(i), taskContext)); } return (ComposableRecordReader)ret; }
/** * Clone the key at the top of this RR into the given object. */ public void key(K key) throws IOException { ReflectionUtils.copy(conf, key(), key); }
@SuppressWarnings("unchecked") // child types unknowable public ComposableRecordReader createRecordReader(InputSplit split, TaskAttemptContext taskContext) throws IOException, InterruptedException { if (!(split instanceof CompositeInputSplit)) { throw new IOException("Invalid split type:" + split.getClass().getName()); } final CompositeInputSplit spl = (CompositeInputSplit)split; final int capacity = kids.size(); CompositeRecordReader ret = null; try { if (!rrCstrMap.containsKey(ident)) { throw new IOException("No RecordReader for " + ident); } ret = (CompositeRecordReader)rrCstrMap.get(ident). newInstance(id, taskContext.getConfiguration(), capacity, cmpcl); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InstantiationException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } for (int i = 0; i < capacity; ++i) { ret.add(kids.get(i).createRecordReader(spl.get(i), taskContext)); } return (ComposableRecordReader)ret; }
/** * If key provided matches that of this Composite, give JoinCollector * iterator over values it may emit. */ @SuppressWarnings("unchecked") // No values from static EMPTY class @Override public void accept(CompositeRecordReader.JoinCollector jc, K key) throws IOException, InterruptedException { if (hasNext() && 0 == cmp.compare(key, key())) { fillJoinCollector(createKey()); jc.add(id, getDelegate()); return; } jc.add(id, EMPTY); }
/** * Clone the key at the top of this RR into the given object. */ public void key(K key) throws IOException { ReflectionUtils.copy(conf, key(), key); }
@SuppressWarnings("unchecked") public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { super.initialize(split, context); }
/** * Create a new key common to all child RRs. * @throws ClassCastException if key classes differ. */ @SuppressWarnings("unchecked") protected K createKey() { if (keyclass == null || keyclass.equals(NullWritable.class)) { return (K) NullWritable.get(); } return (K) ReflectionUtils.newInstance(keyclass, getConf()); }
@SuppressWarnings("unchecked") // child types unknowable public ComposableRecordReader createRecordReader(InputSplit split, TaskAttemptContext taskContext) throws IOException, InterruptedException { if (!(split instanceof CompositeInputSplit)) { throw new IOException("Invalid split type:" + split.getClass().getName()); } final CompositeInputSplit spl = (CompositeInputSplit)split; final int capacity = kids.size(); CompositeRecordReader ret = null; try { if (!rrCstrMap.containsKey(ident)) { throw new IOException("No RecordReader for " + ident); } ret = (CompositeRecordReader)rrCstrMap.get(ident). newInstance(id, taskContext.getConfiguration(), capacity, cmpcl); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InstantiationException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } for (int i = 0; i < capacity; ++i) { ret.add(kids.get(i).createRecordReader(spl.get(i), taskContext)); } return (ComposableRecordReader)ret; }
/** * If key provided matches that of this Composite, give JoinCollector * iterator over values it may emit. */ @SuppressWarnings("unchecked") // No values from static EMPTY class @Override public void accept(CompositeRecordReader.JoinCollector jc, K key) throws IOException, InterruptedException { if (hasNext() && 0 == cmp.compare(key, key())) { fillJoinCollector(createKey()); jc.add(id, getDelegate()); return; } jc.add(id, EMPTY); }
/** * Clone the key at the top of this RR into the given object. */ public void key(K key) throws IOException { ReflectionUtils.copy(conf, key(), key); }
@SuppressWarnings("unchecked") public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { super.initialize(split, context); }
/** * Create a new key common to all child RRs. * @throws ClassCastException if key classes differ. */ @SuppressWarnings("unchecked") protected K createKey() { if (keyclass == null || keyclass.equals(NullWritable.class)) { return (K) NullWritable.get(); } return (K) ReflectionUtils.newInstance(keyclass, getConf()); }
@SuppressWarnings("unchecked") // child types unknowable public ComposableRecordReader createRecordReader(InputSplit split, TaskAttemptContext taskContext) throws IOException, InterruptedException { if (!(split instanceof CompositeInputSplit)) { throw new IOException("Invalid split type:" + split.getClass().getName()); } final CompositeInputSplit spl = (CompositeInputSplit)split; final int capacity = kids.size(); CompositeRecordReader ret = null; try { if (!rrCstrMap.containsKey(ident)) { throw new IOException("No RecordReader for " + ident); } ret = (CompositeRecordReader)rrCstrMap.get(ident). newInstance(id, taskContext.getConfiguration(), capacity, cmpcl); } catch (IllegalAccessException e) { throw new IOException(e); } catch (InstantiationException e) { throw new IOException(e); } catch (InvocationTargetException e) { throw new IOException(e); } for (int i = 0; i < capacity; ++i) { ret.add(kids.get(i).createRecordReader(spl.get(i), taskContext)); } return (ComposableRecordReader)ret; }
/** * If key provided matches that of this Composite, give JoinCollector * iterator over values it may emit. */ @SuppressWarnings("unchecked") // No values from static EMPTY class @Override public void accept(CompositeRecordReader.JoinCollector jc, K key) throws IOException, InterruptedException { if (hasNext() && 0 == cmp.compare(key, key())) { fillJoinCollector(createKey()); jc.add(id, getDelegate()); return; } jc.add(id, EMPTY); }
/** * Clone the key at the top of this RR into the given object. */ public void key(K key) throws IOException { ReflectionUtils.copy(conf, key(), key); }
@SuppressWarnings("unchecked") public void initialize(InputSplit split, TaskAttemptContext context) throws IOException, InterruptedException { super.initialize(split, context); }