org.apache.druid.segment.MMappedIndex Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of druid-processing Show documentation
Show all versions of druid-processing Show documentation
A module that is everything required to understands Druid Segments
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.druid.segment;
import org.apache.druid.collections.bitmap.ImmutableBitmap;
import org.apache.druid.collections.spatial.ImmutableRTree;
import org.apache.druid.java.util.common.io.smoosh.SmooshedFileMapper;
import org.apache.druid.segment.data.CompressedColumnarLongsSupplier;
import org.apache.druid.segment.data.GenericIndexed;
import org.apache.druid.segment.data.VSizeColumnarMultiInts;
import org.joda.time.Interval;
import javax.annotation.Nullable;
import java.nio.ByteBuffer;
import java.util.Map;
/**
*/
public class MMappedIndex
{
final GenericIndexed availableDimensions;
final GenericIndexed availableMetrics;
final Interval dataInterval;
final CompressedColumnarLongsSupplier timestamps;
final Map metrics;
final Map> dimValueUtf8Lookups;
final Map dimColumns;
final Map> invertedIndexes;
final Map spatialIndexes;
final SmooshedFileMapper fileMapper;
public MMappedIndex(
GenericIndexed availableDimensions,
GenericIndexed availableMetrics,
Interval dataInterval,
CompressedColumnarLongsSupplier timestamps,
Map metrics,
Map> dimValueUtf8Lookups,
Map dimColumns,
Map> invertedIndexes,
Map spatialIndexes,
SmooshedFileMapper fileMapper
)
{
this.availableDimensions = availableDimensions;
this.availableMetrics = availableMetrics;
this.dataInterval = dataInterval;
this.timestamps = timestamps;
this.metrics = metrics;
this.dimValueUtf8Lookups = dimValueUtf8Lookups;
this.dimColumns = dimColumns;
this.invertedIndexes = invertedIndexes;
this.spatialIndexes = spatialIndexes;
this.fileMapper = fileMapper;
}
public GenericIndexed getAvailableDimensions()
{
return availableDimensions;
}
public GenericIndexed getAvailableMetrics()
{
return availableMetrics;
}
public Interval getDataInterval()
{
return dataInterval;
}
@Nullable
public MetricHolder getMetricHolder(String metric)
{
return metrics.get(metric);
}
public GenericIndexed getDimValueUtf8Lookup(String dimension)
{
return dimValueUtf8Lookups.get(dimension);
}
public VSizeColumnarMultiInts getDimColumn(String dimension)
{
return dimColumns.get(dimension);
}
public Map> getBitmapIndexes()
{
return invertedIndexes;
}
public Map getSpatialIndexes()
{
return spatialIndexes;
}
public SmooshedFileMapper getFileMapper()
{
return fileMapper;
}
}