Search in sources :

Example 11 with SegmentWriteOutMedium

use of org.apache.druid.segment.writeout.SegmentWriteOutMedium in project druid by druid-io.

the class CompressedFloatsSerdeTest method testTooManyValues.

// this test takes ~30 minutes to run
@Ignore
@Test
public void testTooManyValues() throws IOException {
    expectedException.expect(ColumnCapacityExceededException.class);
    expectedException.expectMessage(ColumnCapacityExceededException.formatMessage("test"));
    try (SegmentWriteOutMedium segmentWriteOutMedium = TmpFileSegmentWriteOutMediumFactory.instance().makeSegmentWriteOutMedium(temporaryFolder.newFolder())) {
        ColumnarFloatsSerializer serializer = CompressionFactory.getFloatSerializer("test", segmentWriteOutMedium, "test", order, compressionStrategy);
        serializer.open();
        final long numRows = Integer.MAX_VALUE + 100L;
        for (long i = 0L; i < numRows; i++) {
            serializer.add(ThreadLocalRandom.current().nextFloat());
        }
    }
}
Also used : OffHeapMemorySegmentWriteOutMedium(org.apache.druid.segment.writeout.OffHeapMemorySegmentWriteOutMedium) SegmentWriteOutMedium(org.apache.druid.segment.writeout.SegmentWriteOutMedium) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

SegmentWriteOutMedium (org.apache.druid.segment.writeout.SegmentWriteOutMedium)11 OffHeapMemorySegmentWriteOutMedium (org.apache.druid.segment.writeout.OffHeapMemorySegmentWriteOutMedium)9 Test (org.junit.Test)6 FileSmoosher (org.apache.druid.java.util.common.io.smoosh.FileSmoosher)5 Ignore (org.junit.Ignore)5 File (java.io.File)4 SmooshedFileMapper (org.apache.druid.java.util.common.io.smoosh.SmooshedFileMapper)3 SmooshedWriter (org.apache.druid.java.util.common.io.smoosh.SmooshedWriter)3 FileOutputStream (java.io.FileOutputStream)1 IntBuffer (java.nio.IntBuffer)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 TreeMap (java.util.TreeMap)1 Nullable (javax.annotation.Nullable)1 HyperLogLogCollector (org.apache.druid.hll.HyperLogLogCollector)1 Closer (org.apache.druid.java.util.common.io.Closer)1 AggregatorFactory (org.apache.druid.query.aggregation.AggregatorFactory)1 RuntimeShapeInspector (org.apache.druid.query.monomorphicprocessing.RuntimeShapeInspector)1 ObjectColumnSelector (org.apache.druid.segment.ObjectColumnSelector)1 ColumnBuilder (org.apache.druid.segment.column.ColumnBuilder)1