@Override public ByteValue createInstance() { return new ByteValue(); }
@Override public ByteValue deserialize(ByteValue reuse, DataInputView source) throws IOException { reuse.read(source); return reuse; }
break; case ByteValue: upload.setByte(index, ((ByteValue) value).getValue()); break; case CharValue:
@Override public void serialize(ByteValue record, DataOutputView target) throws IOException { record.write(target); }
@SuppressWarnings("unchecked") private<T> T convert(Record stratosphereType, int pos, Class<T> hadoopType) { if(hadoopType == LongWritable.class ) { return (T) new LongWritable((stratosphereType.getField(pos, LongValue.class)).getValue()); } if(hadoopType == org.apache.hadoop.io.Text.class) { return (T) new Text((stratosphereType.getField(pos, StringValue.class)).getValue()); } if(hadoopType == org.apache.hadoop.io.IntWritable.class) { return (T) new IntWritable((stratosphereType.getField(pos, IntValue.class)).getValue()); } if(hadoopType == org.apache.hadoop.io.FloatWritable.class) { return (T) new FloatWritable((stratosphereType.getField(pos, FloatValue.class)).getValue()); } if(hadoopType == org.apache.hadoop.io.DoubleWritable.class) { return (T) new DoubleWritable((stratosphereType.getField(pos, DoubleValue.class)).getValue()); } if(hadoopType == org.apache.hadoop.io.BooleanWritable.class) { return (T) new BooleanWritable((stratosphereType.getField(pos, BooleanValue.class)).getValue()); } if(hadoopType == org.apache.hadoop.io.ByteWritable.class) { return (T) new ByteWritable((stratosphereType.getField(pos, ByteValue.class)).getValue()); } throw new RuntimeException("Unable to convert Stratosphere type ("+stratosphereType.getClass().getCanonicalName()+") to Hadoop."); } }
@Override public void serialize(ByteValue record, DataOutputView target) throws IOException { record.write(target); }
@Override public ByteValue createValue() { return new ByteValue(); }
@Override public ByteValue deserialize(ByteValue reuse, DataInputView source) throws IOException { reuse.read(source); return reuse; }
@Override public ByteValue createValue() { return new ByteValue(); }
@Override public ByteValue createInstance() { return new ByteValue(); }
return new ByteValue(((java.lang.Byte)java).byteValue());
return new ByteValue(((java.lang.Byte)java).byteValue());
protected Value convert(Object hadoopType) { if(hadoopType instanceof org.apache.hadoop.io.LongWritable ) { return new LongValue(((LongWritable)hadoopType).get()); } if(hadoopType instanceof org.apache.hadoop.io.Text) { return new StringValue(((Text)hadoopType).toString()); } if(hadoopType instanceof org.apache.hadoop.io.IntWritable) { return new IntValue(((IntWritable)hadoopType).get()); } if(hadoopType instanceof org.apache.hadoop.io.FloatWritable) { return new FloatValue(((FloatWritable)hadoopType).get()); } if(hadoopType instanceof org.apache.hadoop.io.DoubleWritable) { return new DoubleValue(((DoubleWritable)hadoopType).get()); } if(hadoopType instanceof org.apache.hadoop.io.BooleanWritable) { return new BooleanValue(((BooleanWritable)hadoopType).get()); } if(hadoopType instanceof org.apache.hadoop.io.ByteWritable) { return new ByteValue(((ByteWritable)hadoopType).get()); } if (hadoopType instanceof NullWritable) { return NullValue.getInstance(); } throw new RuntimeException("Unable to convert Hadoop type ("+hadoopType.getClass().getCanonicalName()+") to Stratosphere."); } }