Package org.apache.hadoop.mrunit.internal.io

Examples of org.apache.hadoop.mrunit.internal.io.Serialization.copy()


      for (InputSplit inputSplit : inputSplits) {
        RecordReader<K, V> recordReader = inputFormat.createRecordReader(
            inputSplit, taskAttemptContext);
        recordReader.initialize(inputSplit, taskAttemptContext);
        while (recordReader.nextKeyValue()) {
          outputs.add(new Pair<K, V>(serialization.copy(recordReader
              .getCurrentKey()), serialization.copy(recordReader
              .getCurrentValue())));
        }
      }
    } catch (InterruptedException e) {
View Full Code Here


        RecordReader<K, V> recordReader = inputFormat.createRecordReader(
            inputSplit, taskAttemptContext);
        recordReader.initialize(inputSplit, taskAttemptContext);
        while (recordReader.nextKeyValue()) {
          outputs.add(new Pair<K, V>(serialization.copy(recordReader
              .getCurrentKey()), serialization.copy(recordReader
              .getCurrentValue())));
        }
      }
    } catch (InterruptedException e) {
      throw new IOException(e);
View Full Code Here

  public void testClassWithoutNoArgConstructor() {
    final Configuration conf = new Configuration();
    conf.setStrings("io.serializations",
        "org.apache.hadoop.io.serializer.JavaSerialization");
    Serialization serialization = new Serialization(conf);
    assertEquals(new Integer(1), serialization.copy(new Integer(1)));
  }

  @Test
  public void testChangeStateOfCopyArgument() {
    final IntWritable int1 = new IntWritable(1);
View Full Code Here

  @Test
  public void testChangeStateOfCopyArgument() {
    final IntWritable int1 = new IntWritable(1);
    final IntWritable int2 = new IntWritable(2);
    Serialization serialization = new Serialization(new Configuration());
    final IntWritable copy = (IntWritable) serialization.copy(int1, int2);
    assertEquals(int1, copy);
    assertEquals(int1, int2);
  }

  @Test
View Full Code Here

    conf.setStrings("io.serializations",
        "org.apache.hadoop.io.serializer.JavaSerialization");
    final Integer int1 = new Integer(1);
    final Integer int2 = new Integer(2);
    Serialization serialization = new Serialization(conf);
    final Integer copy = (Integer) serialization.copy(int1, int2);
    assertEquals(int1, copy);
    assertEquals(new Integer(2), int2);
  }

}
View Full Code Here

      for (InputSplit inputSplit : inputSplits) {
        RecordReader<K, V> recordReader = inputFormat.createRecordReader(
            inputSplit, taskAttemptContext);
        recordReader.initialize(inputSplit, taskAttemptContext);
        while (recordReader.nextKeyValue()) {
          outputs.add(new Pair<K, V>(serialization.copy(recordReader
              .getCurrentKey()), serialization.copy(recordReader
              .getCurrentValue())));
        }
      }
    } catch (InterruptedException e) {
View Full Code Here

        RecordReader<K, V> recordReader = inputFormat.createRecordReader(
            inputSplit, taskAttemptContext);
        recordReader.initialize(inputSplit, taskAttemptContext);
        while (recordReader.nextKeyValue()) {
          outputs.add(new Pair<K, V>(serialization.copy(recordReader
              .getCurrentKey()), serialization.copy(recordReader
              .getCurrentValue())));
        }
      }
    } catch (InterruptedException e) {
      throw new IOException(e);
View Full Code Here

      for (InputSplit inputSplit : inputSplits) {
        RecordReader<K, V> recordReader = inputFormat.createRecordReader(
            inputSplit, taskAttemptContext);
        recordReader.initialize(inputSplit, taskAttemptContext);
        while (recordReader.nextKeyValue()) {
          outputs.add(new Pair<K, V>(serialization.copy(recordReader
              .getCurrentKey()), serialization.copy(recordReader
              .getCurrentValue())));
        }
      }
    } catch (InterruptedException e) {
View Full Code Here

        RecordReader<K, V> recordReader = inputFormat.createRecordReader(
            inputSplit, taskAttemptContext);
        recordReader.initialize(inputSplit, taskAttemptContext);
        while (recordReader.nextKeyValue()) {
          outputs.add(new Pair<K, V>(serialization.copy(recordReader
              .getCurrentKey()), serialization.copy(recordReader
              .getCurrentValue())));
        }
      }
    } catch (InterruptedException e) {
      throw new IOException(e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.