Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ private static class BenchData {
private ByteBuffer[] decodeInputs = new ByteBuffer[NUM_ALL_UNITS];

public static void configure(int dataSizeMB, int chunkSizeKB) {
Preconditions.checkArgument(dataSizeMB > 0);
chunkSize = chunkSizeKB * 1024;
// buffer size needs to be a multiple of (numDataUnits * chunkSize)
int round = (int) Math.round(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.hadoop.io.erasurecode.rawcoder;

import org.apache.hadoop.io.erasurecode.ErasureCodeNative;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;

Expand All @@ -33,6 +34,14 @@ public void testDummyCoder() throws Exception {
RawErasureCoderBenchmark.CODER.DUMMY_CODER, 2, 100, 1024);
RawErasureCoderBenchmark.performBench("decode",
RawErasureCoderBenchmark.CODER.DUMMY_CODER, 5, 150, 100);

try {
RawErasureCoderBenchmark.performBench("decode",
RawErasureCoderBenchmark.CODER.DUMMY_CODER, 5, -150, 100);
Assert.fail("should have thrown an IllegalArgumentException");
} catch (IllegalArgumentException e) {
// intentionally swallow exception
}
}

@Test
Expand Down