Search in sources :

Example 1 with Algorithm

use of org.apache.accumulo.core.file.rfile.bcfile.Compression.Algorithm in project accumulo by apache.

the class CompressionTest method testSingle.

@Test
public void testSingle() throws IOException {
    for (final Algorithm al : Algorithm.values()) {
        if (isSupported.get(al) != null && isSupported.get(al)) {
            // first call to issupported should be true
            Assert.assertTrue(al + " is not supported, but should be", al.isSupported());
            Assert.assertNotNull(al + " should have a non-null codec", al.getCodec());
            Assert.assertNotNull(al + " should have a non-null codec", al.getCodec());
        }
    }
}
Also used : Algorithm(org.apache.accumulo.core.file.rfile.bcfile.Compression.Algorithm) Test(org.junit.Test)

Example 2 with Algorithm

use of org.apache.accumulo.core.file.rfile.bcfile.Compression.Algorithm in project accumulo by apache.

the class CompressionTest method testSingleNoSideEffect.

@Test
public void testSingleNoSideEffect() throws IOException {
    for (final Algorithm al : Algorithm.values()) {
        if (isSupported.get(al) != null && isSupported.get(al)) {
            Assert.assertTrue(al + " is not supported, but should be", al.isSupported());
            Assert.assertNotNull(al + " should have a non-null codec", al.getCodec());
            // assert that additional calls to create will not create
            // additional codecs
            Assert.assertNotEquals(al + " should have created a new codec, but did not", System.identityHashCode(al.getCodec()), al.createNewCodec(88 * 1024));
        }
    }
}
Also used : Algorithm(org.apache.accumulo.core.file.rfile.bcfile.Compression.Algorithm) Test(org.junit.Test)

Aggregations

Algorithm (org.apache.accumulo.core.file.rfile.bcfile.Compression.Algorithm)2 Test (org.junit.Test)2