Skip to content
Merged
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 @@ -65,21 +65,26 @@ public static void main(String[] args) throws IOException
dirPath = args[0];
}

BenchmarkColumnSchema enumeratedSchema = BenchmarkColumnSchema.makeEnumerated("", ValueType.FLOAT, true, 1, 0d,
ImmutableList.of(
0f,
1.1f,
2.2f,
3.3f,
4.4f
),
ImmutableList.of(
0.95,
0.001,
0.0189,
0.03,
0.0001
)
BenchmarkColumnSchema enumeratedSchema = BenchmarkColumnSchema.makeEnumerated(
"",
ValueType.FLOAT,
true,
1,
0d,
ImmutableList.of(
0f,
1.1f,
2.2f,
3.3f,
4.4f
),
ImmutableList.of(
0.95,
0.001,
0.0189,
0.03,
0.0001
)
);
BenchmarkColumnSchema zipfLowSchema = BenchmarkColumnSchema.makeZipf(
"",
Expand Down Expand Up @@ -151,6 +156,7 @@ public static void main(String[] args) throws IOException
File dataFile = new File(dir, entry.getKey());

ColumnarFloatsSerializer writer = CompressionFactory.getFloatSerializer(
"float-benchmark",
new OffHeapMemorySegmentWriteOutMedium(),
"float",
ByteOrder.nativeOrder(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,26 @@ public static void main(String[] args) throws IOException
dirPath = args[0];
}

BenchmarkColumnSchema enumeratedSchema = BenchmarkColumnSchema.makeEnumerated("", ValueType.LONG, true, 1, 0d,
ImmutableList.of(
0,
1,
2,
3,
4
),
ImmutableList.of(
0.95,
0.001,
0.0189,
0.03,
0.0001
)
BenchmarkColumnSchema enumeratedSchema = BenchmarkColumnSchema.makeEnumerated(
"",
ValueType.LONG,
true,
1,
0d,
ImmutableList.of(
0,
1,
2,
3,
4
),
ImmutableList.of(
0.95,
0.001,
0.0189,
0.03,
0.0001
)
);
BenchmarkColumnSchema zipfLowSchema = BenchmarkColumnSchema.makeZipf("", ValueType.LONG, true, 1, 0d, -1, 1000, 1d);
BenchmarkColumnSchema zipfHighSchema = BenchmarkColumnSchema.makeZipf(
Expand Down Expand Up @@ -144,6 +149,7 @@ public static void main(String[] args) throws IOException
File dataFile = new File(dir, entry.getKey());

ColumnarLongsSerializer writer = CompressionFactory.getLongSerializer(
"long-benchmark",
new OffHeapMemorySegmentWriteOutMedium(),
"long",
ByteOrder.nativeOrder(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,31 @@
public class DoubleColumnSerializer implements GenericColumnSerializer<Object>
{
public static DoubleColumnSerializer create(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
CompressionStrategy compression
)
{
return new DoubleColumnSerializer(segmentWriteOutMedium, filenameBase, IndexIO.BYTE_ORDER, compression);
return new DoubleColumnSerializer(columnName, segmentWriteOutMedium, filenameBase, IndexIO.BYTE_ORDER, compression);
}

private final String columnName;
private final SegmentWriteOutMedium segmentWriteOutMedium;
private final String filenameBase;
private final ByteOrder byteOrder;
private final CompressionStrategy compression;
private ColumnarDoublesSerializer writer;

private DoubleColumnSerializer(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
ByteOrder byteOrder,
CompressionStrategy compression
)
{
this.columnName = columnName;
this.segmentWriteOutMedium = segmentWriteOutMedium;
this.filenameBase = filenameBase;
this.byteOrder = byteOrder;
Expand All @@ -64,6 +68,7 @@ private DoubleColumnSerializer(
public void open() throws IOException
{
writer = CompressionFactory.getDoubleSerializer(
columnName,
segmentWriteOutMedium,
StringUtils.format("%s.double_column", filenameBase),
byteOrder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@
public class DoubleColumnSerializerV2 implements GenericColumnSerializer<Object>
{
public static DoubleColumnSerializerV2 create(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
CompressionStrategy compression,
BitmapSerdeFactory bitmapSerdeFactory
)
{
return new DoubleColumnSerializerV2(
columnName,
segmentWriteOutMedium,
filenameBase,
IndexIO.BYTE_ORDER,
Expand All @@ -60,6 +62,7 @@ public static DoubleColumnSerializerV2 create(
);
}

private final String columnName;
private final SegmentWriteOutMedium segmentWriteOutMedium;
private final String filenameBase;
private final ByteOrder byteOrder;
Expand All @@ -72,13 +75,15 @@ public static DoubleColumnSerializerV2 create(
private int rowCount = 0;

private DoubleColumnSerializerV2(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
ByteOrder byteOrder,
CompressionStrategy compression,
BitmapSerdeFactory bitmapSerdeFactory
)
{
this.columnName = columnName;
this.segmentWriteOutMedium = segmentWriteOutMedium;
this.filenameBase = filenameBase;
this.byteOrder = byteOrder;
Expand All @@ -90,6 +95,7 @@ private DoubleColumnSerializerV2(
public void open() throws IOException
{
writer = CompressionFactory.getDoubleSerializer(
columnName,
segmentWriteOutMedium,
StringUtils.format("%s.double_column", filenameBase),
byteOrder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,31 @@
public class FloatColumnSerializer implements GenericColumnSerializer<Object>
{
public static FloatColumnSerializer create(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
CompressionStrategy compression
)
{
return new FloatColumnSerializer(segmentWriteOutMedium, filenameBase, IndexIO.BYTE_ORDER, compression);
return new FloatColumnSerializer(columnName, segmentWriteOutMedium, filenameBase, IndexIO.BYTE_ORDER, compression);
}

private final String columnName;
private final SegmentWriteOutMedium segmentWriteOutMedium;
private final String filenameBase;
private final ByteOrder byteOrder;
private final CompressionStrategy compression;
private ColumnarFloatsSerializer writer;

private FloatColumnSerializer(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
ByteOrder byteOrder,
CompressionStrategy compression
)
{
this.columnName = columnName;
this.segmentWriteOutMedium = segmentWriteOutMedium;
this.filenameBase = filenameBase;
this.byteOrder = byteOrder;
Expand All @@ -64,6 +68,7 @@ private FloatColumnSerializer(
public void open() throws IOException
{
writer = CompressionFactory.getFloatSerializer(
columnName,
segmentWriteOutMedium,
StringUtils.format("%s.float_column", filenameBase),
byteOrder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@
public class FloatColumnSerializerV2 implements GenericColumnSerializer<Object>
{
public static FloatColumnSerializerV2 create(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
CompressionStrategy compression,
BitmapSerdeFactory bitmapSerdeFactory
)
{
return new FloatColumnSerializerV2(
columnName,
segmentWriteOutMedium,
filenameBase,
IndexIO.BYTE_ORDER,
Expand All @@ -60,6 +62,7 @@ public static FloatColumnSerializerV2 create(
);
}

private final String columnName;
private final SegmentWriteOutMedium segmentWriteOutMedium;
private final String filenameBase;
private final ByteOrder byteOrder;
Expand All @@ -72,13 +75,15 @@ public static FloatColumnSerializerV2 create(
private int rowCount = 0;

private FloatColumnSerializerV2(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
ByteOrder byteOrder,
CompressionStrategy compression,
BitmapSerdeFactory bitmapSerdeFactory
)
{
this.columnName = columnName;
this.segmentWriteOutMedium = segmentWriteOutMedium;
this.filenameBase = filenameBase;
this.byteOrder = byteOrder;
Expand All @@ -90,6 +95,7 @@ private FloatColumnSerializerV2(
public void open() throws IOException
{
writer = CompressionFactory.getFloatSerializer(
columnName,
segmentWriteOutMedium,
StringUtils.format("%s.float_column", filenameBase),
byteOrder,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,15 @@ static GenericColumnSerializer createLongColumnSerializer(
// If using default values for null use LongColumnSerializer to allow rollback to previous versions.
if (NullHandling.replaceWithDefault()) {
return LongColumnSerializer.create(
columnName,
segmentWriteOutMedium,
columnName,
indexSpec.getMetricCompression(),
indexSpec.getLongEncoding()
);
} else {
return LongColumnSerializerV2.create(
columnName,
segmentWriteOutMedium,
columnName,
indexSpec.getMetricCompression(),
Expand All @@ -646,12 +648,14 @@ static GenericColumnSerializer createDoubleColumnSerializer(
// If using default values for null use DoubleColumnSerializer to allow rollback to previous versions.
if (NullHandling.replaceWithDefault()) {
return DoubleColumnSerializer.create(
columnName,
segmentWriteOutMedium,
columnName,
indexSpec.getMetricCompression()
);
} else {
return DoubleColumnSerializerV2.create(
columnName,
segmentWriteOutMedium,
columnName,
indexSpec.getMetricCompression(),
Expand All @@ -669,12 +673,14 @@ static GenericColumnSerializer createFloatColumnSerializer(
// If using default values for null use FloatColumnSerializer to allow rollback to previous versions.
if (NullHandling.replaceWithDefault()) {
return FloatColumnSerializer.create(
columnName,
segmentWriteOutMedium,
columnName,
indexSpec.getMetricCompression()
);
} else {
return FloatColumnSerializerV2.create(
columnName,
segmentWriteOutMedium,
columnName,
indexSpec.getMetricCompression(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@
public class LongColumnSerializer implements GenericColumnSerializer<Object>
{
public static LongColumnSerializer create(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
CompressionStrategy compression,
CompressionFactory.LongEncodingStrategy encoding
)
{
return new LongColumnSerializer(segmentWriteOutMedium, filenameBase, IndexIO.BYTE_ORDER, compression, encoding);
return new LongColumnSerializer(columnName, segmentWriteOutMedium, filenameBase, IndexIO.BYTE_ORDER, compression, encoding);
}

private final String columnName;
private final SegmentWriteOutMedium segmentWriteOutMedium;
private final String filenameBase;
private final ByteOrder byteOrder;
Expand All @@ -53,13 +55,15 @@ public static LongColumnSerializer create(
private ColumnarLongsSerializer writer;

private LongColumnSerializer(
String columnName,
SegmentWriteOutMedium segmentWriteOutMedium,
String filenameBase,
ByteOrder byteOrder,
CompressionStrategy compression,
CompressionFactory.LongEncodingStrategy encoding
)
{
this.columnName = columnName;
this.segmentWriteOutMedium = segmentWriteOutMedium;
this.filenameBase = filenameBase;
this.byteOrder = byteOrder;
Expand All @@ -71,6 +75,7 @@ private LongColumnSerializer(
public void open() throws IOException
{
writer = CompressionFactory.getLongSerializer(
columnName,
segmentWriteOutMedium,
StringUtils.format("%s.long_column", filenameBase),
byteOrder,
Expand Down
Loading