@Override public String toString() { return "<value: " + (value == null ? "null" : value.toString()) + ">"; } }
@Override public String getLastOutput() { if (bytes != null) { return new BytesWritable(bytes).toString(); } else { return null; } }
@Override public String getLastOutput() { if (bytes != null) { return new BytesWritable(bytes).toString(); } else { return null; } }
private void checkToString(byte[] input, String expected) { String actual = new BytesWritable(input).toString(); assertEquals(expected, actual); }
private static String textifyBytes(Text t) { BytesWritable b = new BytesWritable(); b.set(t.getBytes(), 0, t.getLength()); return b.toString(); }
@Override public String toString() { return "<key: " + (key == null ? "null" : key.toString()) + ", partition: " + partition.toString() + ">"; }
public void reduce(BytesWritable key, Iterator<IntWritable> values, OutputCollector<BytesWritable, IntWritable> output, Reporter reporter) throws IOException { int ones = 0; int twos = 0; while (values.hasNext()) { IntWritable count = values.next(); if (count.equals(sortInput)) { ++ones; } else if (count.equals(sortOutput)) { ++twos; } else { throw new IOException("Invalid 'value' of " + count.get() + " for (key,value): " + key.toString()); } } // Check to ensure there are equal no. of ones and twos if (ones != twos) { throw new IOException("Illegal ('one', 'two'): (" + ones + ", " + twos + ") for (key, value): " + key.toString()); } } }
/** * @return A String declaring how an inserted BLOB will be returned to * us via the sequencefile. */ protected String getBlobSeqOutput(String asInserted) { return new BytesWritable(getBlobDbOutput(asInserted)).toString(); }
/** * @return A String declaring how an inserted VARBINARY will be * returned to us via the sequencefile. */ protected String getVarBinarySeqOutput(String asInserted) { return new BytesWritable(getBlobDbOutput(asInserted)).toString(); }
private void checkToString(byte[] input, String expected) { String actual = new BytesWritable(input).toString(); assertEquals(expected, actual); }
private void checkToString(byte[] input, String expected) { String actual = new BytesWritable(input).toString(); assertEquals(expected, actual); }
public void reduce(BytesWritable key, Iterator<IntWritable> values, OutputCollector<BytesWritable, IntWritable> output, Reporter reporter) throws IOException { int ones = 0; int twos = 0; while (values.hasNext()) { IntWritable count = values.next(); if (count.equals(sortInput)) { ++ones; } else if (count.equals(sortOutput)) { ++twos; } else { throw new IOException("Invalid 'value' of " + count.get() + " for (key,value): " + key.toString()); } } // Check to ensure there are equal no. of ones and twos if (ones != twos) { throw new IOException("Illegal ('one', 'two'): (" + ones + ", " + twos + ") for (key, value): " + key.toString()); } } }
assertEquals("objects with same backing array should be equal", zeroBuf, copyBuf); assertEquals("string repr of objects with same backing array should be equal", zeroBuf.toString(), copyBuf.toString()); assertTrue("compare order objects with same backing array should be equal", zeroBuf.compareTo(copyBuf) == 0);
assertEquals("objects with same backing array should be equal", zeroBuf, copyBuf); assertEquals("string repr of objects with same backing array should be equal", zeroBuf.toString(), copyBuf.toString()); assertTrue("compare order objects with same backing array should be equal", zeroBuf.compareTo(copyBuf) == 0);