public void write(DECISIONS dec, Context context, String url) throws IOException, InterruptedException{ DefaultTuple defTup=new DefaultTuple(); defTup.append(url); context.write(new IntWritable(dec.ordinal()), defTup); }
@Override public void readFields(DataInput in) throws IOException { // Clear our fields, in case we're being reused. mFields.clear(); // Make sure it's a tuple. byte b = in.readByte(); if (b != DataType.TUPLE) { int errCode = 2112; String msg = "Unexpected data while reading tuple " + "from binary file."; throw new ExecException(msg, errCode, PigException.BUG); } // Read the number of fields int sz = in.readInt(); for (int i = 0; i < sz; i++) { try { append(DataReaderWriter.readDatum(in)); } catch (ExecException ee) { throw ee; } } }