Refine search
@Override public String[] getHostnames() { try { return this.hadoopInputSplit.getLocations(); } catch (IOException e) { return new String[0]; } }
/** * @return returns total length of all stored input splits */ public long getLength() throws IOException { long length = 0L; for (InputSplit inputSplit: inputSplits) { length += inputSplit.getLength(); } return length; }
public void readFields(DataInput in) throws IOException { path = new Path(Text.readString(in)); delegate.readFields(in); }
/** * Returns a string representation of a {@link InputSplit}. * * @param is Hadoop {@link InputSplit} * @return its string representation */ public static String toStringHadoopInputSplit(InputSplit is) { StringBuilder sb = new StringBuilder("HadoopInputSplit: "); try { sb.append(" Length: ").append(is.getLength()); sb.append(" , Locations: "); for (String loc : is.getLocations()) { sb.append(loc).append(" ; "); } } catch (IOException e) { LOG.error(e.getMessage()); } return sb.toString(); }
public void write(DataOutput out) throws IOException { Text.writeString(out, path.toString()); delegate.write(out); }
@Override public void readFields(DataInput in) throws IOException { String inputSplitClassName = in.readUTF(); try { inputSplit = (InputSplit) ReflectionUtil.newInstance(conf .getClassByName(inputSplitClassName), conf); } catch (Exception e) { throw new IOException( "Cannot create an instance of InputSplit class = " + inputSplitClassName + ":" + e.getMessage(), e); } inputSplit.readFields(in); inputFormatClassName = in.readUTF(); }
private void writeObject(ObjectOutputStream out) throws IOException { // serialize the parent fields and the final fields out.defaultWriteObject(); // the job conf knows how to serialize itself jobConf.write(out); // write the input split hadoopInputSplit.write(out); }
public void write(DataOutput out) throws IOException { Text.writeString(out, inputSplitClass.getName()); inputSplit.write(out); Text.writeString(out, inputFormatClass.getName()); Text.writeString(out, mapperClass.getName()); Text.writeString(out, schema.toString()); }
@Override public void readFields(DataInput in) throws IOException { super.readFields(in); this.isTableSplit = in.readBoolean(); if (this.isTableSplit) { tableSplit.readFields(in); } else { snapshotSplit.readFields(in); } }
@Override public void write(DataOutput out) throws IOException { out.writeUTF(inputSplit.getClass().getName()); inputSplit.write(out); out.writeUTF(inputFormatClassName); }
@Override public void write(final DataOutput out) throws IOException { Text.writeString(out, path.toString()); delegate.write(out); }
@SuppressWarnings("unchecked") public void readFields(DataInput in) throws IOException { inputSplitClass = (Class<? extends InputSplit>) readClass(in); inputSplit = (InputSplit) ReflectionUtils .newInstance(inputSplitClass, conf); inputSplit.readFields(in); inputFormatClass = (Class<? extends InputFormat>) readClass(in); mapperClass = (Class<? extends AvroMapper>) readClass(in); String schemaString = Text.readString(in); schema = schemaParser.parse(schemaString); }
@Override public String[] getLocations() throws IOException { assert (inputSplits != null && inputSplits.length > 0); return inputSplits[0].getLocations(); }
public long getLength() throws IOException { return inputSplit.getLength(); }
@Override public void readFields(DataInput in) throws IOException { String inputSplitClassName = in.readUTF(); int numSplits = in.readInt(); inputSplits = new InputSplit[numSplits]; for (int i = 0; i < numSplits; i++) { try { inputSplits[i] = (InputSplit) ReflectionUtil.newInstance(conf .getClassByName(inputSplitClassName), conf); } catch (Exception e) { throw new IOException( "Cannot create an instance of InputSplit class = " + inputSplitClassName + ":" + e.getMessage()); } inputSplits[i].readFields(in); } inputFormatClassName = in.readUTF(); }
@Override public void write(DataOutput out) throws IOException { assert (inputSplits != null && inputSplits.length > 0); out.writeUTF(inputSplits[0].getClass().getName()); out.writeInt(inputSplits.length); for (InputSplit inputSplit : inputSplits) { inputSplit.write(out); } out.writeUTF(inputFormatClassName); } }
public void write(DataOutput out) throws IOException { Text.writeString(out, path.toString()); delegate.write(out); }
@Override public void readFields(final DataInput in) throws IOException { path = new Path(Text.readString(in)); delegate.readFields(in); }
@Override public String[] getLocations() throws IOException { return inputSplit.getLocations(); }
public long getLength(int idx) { if (inputSplits != null) { try { return inputSplits[idx].getLength(); } catch (Exception e) { throw new RuntimeException(e); } } return -1; }