/** * Copy one Writable to another. Copies bytes using data streams. * @param src Source Writable * @param tgt Target Writable * @return The target Writable. * @throws IOException e */ public static Writable copyWritable(final Writable src, final Writable tgt) throws IOException { return copyWritable(getBytes(src), tgt); }
/** * Copy one Writable to another. Copies bytes using data streams. * @param src Source Writable * @param tgt Target Writable * @return The target Writable. * @throws IOException e */ public static Writable copyWritable(final Writable src, final Writable tgt) throws IOException { return copyWritable(getBytes(src), tgt); }
/** * Copy one Writable to another. Copies bytes using data streams. * @param src Source Writable * @param tgt Target Writable * @return The target Writable. * @throws IOException e */ public static Writable copyWritable(final Writable src, final Writable tgt) throws IOException { return copyWritable(getBytes(src), tgt); }
/** * Copy one Writable to another. Copies bytes using data streams. * @param src Source Writable * @param tgt Target Writable * @return The target Writable. * @throws IOException e */ public static Writable copyWritable(final Writable src, final Writable tgt) throws IOException { return copyWritable(getBytes(src), tgt); }
/** * Copy one Writable to another. Copies bytes using data streams. * @param src Source Writable * @param tgt Target Writable * @return The target Writable. * @throws IOException e */ public static Writable copyWritable(final Writable src, final Writable tgt) throws IOException { return copyWritable(getBytes(src), tgt); }
@Override public boolean next(ImmutableBytesWritable rowKey, Result value) throws IOException { boolean next = false; try { next = recordReader.nextKeyValue(); if (next) { rowKey.set(recordReader.getCurrentValue().getRow()); Writables.copyWritable(recordReader.getCurrentValue(), value); } } catch (InterruptedException e) { throw new IOException(e); } return next; } };
} else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("TIMERANGE")) == 0) { TimeRangeTracker timeRangeTracker = new TimeRangeTracker(); Writables.copyWritable(e.getValue(), timeRangeTracker); System.out.println(timeRangeTracker.getMinimumTimestamp() + "...." + timeRangeTracker.getMaximumTimestamp());
} else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("TIMERANGE")) == 0) { TimeRangeTracker timeRangeTracker = new TimeRangeTracker(); Writables.copyWritable(e.getValue(), timeRangeTracker); System.out.println(timeRangeTracker.getMinimumTimestamp() + "...." + timeRangeTracker.getMaximumTimestamp());
Writables.copyWritable( (Writable) result, (Writable) value ); } else {
public Object convert( ValueMetaInterface meta, Result obj ) throws TypeConversionException { // we have to make a copy here because the TableRecordReader's next() // method in the mapred package re-uses the Result object. This is fine // for sequential apps, but not good for multi-threaded mappers. Result newResult = new Result(); try { // Some versions of HBase have removed the Writable interface from Result // and added a copyFrom() method. Check for this here, and call the appropriate // class and method if ( obj instanceof Writable && newResult instanceof Writable ) { Writables.copyWritable( (Writable) obj, (Writable) newResult ); } else { Method m = newResult.getClass().getMethod( "copyFrom", Result.class ); m.invoke( newResult, obj ); } } catch ( IOException ex ) { throw new TypeConversionException( "Problem copying result object!", ex ); } catch ( NoSuchMethodException ex ) { throw new TypeConversionException( "Problem copying result object!", ex ); } catch ( SecurityException ex ) { throw new TypeConversionException( "Problem copying result object!", ex ); } catch ( IllegalAccessException ex ) { throw new TypeConversionException( "Problem copying result object!", ex ); } catch ( IllegalArgumentException ex ) { throw new TypeConversionException( "Problem copying result object!", ex ); } catch ( InvocationTargetException ex ) { throw new TypeConversionException( "Problem copying result object!", ex ); } return newResult; }
if (!pagedResult.isEmpty()) { key.set(mCurrentPagedFijiRowDataWritable.getEntityId().getHBaseRowKey()); Writables.copyWritable(pagedResult, value); return true; mCurrentPagedFijiRowDataWritable = result; key.set(mCurrentPagedFijiRowDataWritable.getEntityId().getHBaseRowKey()); Writables.copyWritable(pagedResult, value); return true; Writables.copyWritable(result, value); ResourceUtils.closeOrLog(result); return true;
if (timerangeBytes != null) { this.reader.timeRangeTracker = new TimeRangeTracker(); Writables.copyWritable(timerangeBytes, this.reader.timeRangeTracker);
if (timerangeBytes != null) { this.reader.timeRangeTracker = new TimeRangeTracker(); Writables.copyWritable(timerangeBytes, this.reader.timeRangeTracker);