public final class FactTable extends Object implements Closeable
Facts.
Thread safe as long as the passed into the constructor datasets are thread safe (usually is not the case).| Constructor and Description |
|---|
FactTable(MetricsTable timeSeriesTable,
EntityTable entityTable,
int resolution,
int rollTime)
Creates an instance of
FactTable. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(List<Fact> facts) |
void |
close() |
void |
delete(FactScan scan)
Delete entries in fact table.
|
Set<String> |
findMeasureNames(List<String> allDimensionNames,
Map<String,String> dimensionSlice,
long startTs,
long endTs)
Finds all measure names of the facts that match given
DimensionValues and time range. |
Set<co.cask.cdap.api.dataset.lib.cube.DimensionValue> |
findSingleDimensionValue(List<String> allDimensionNames,
Map<String,String> dimensionSlice,
long startTs,
long endTs)
Searches for first non-null valued dimensions in records that contain given list of dimensions and match given
dimension values in given time range.
|
static byte[][] |
getSplits(int aggGroupsCount) |
FactScanner |
scan(FactScan scan) |
void |
setMetricsCollector(MetricsCollector metrics) |
public FactTable(MetricsTable timeSeriesTable, EntityTable entityTable, int resolution, int rollTime)
FactTable.timeSeriesTable - A table for storing facts information.entityTable - The table for storing dimension encoding mappings.resolution - Resolution in secondsrollTime - Number of resolution for writing to a new row with a new timebase.
Meaning the differences between timebase of two consecutive rows divided by
resolution seconds. It essentially defines how many columns per row in the table.
This value should be < 65535.public void setMetricsCollector(MetricsCollector metrics)
public FactScanner scan(FactScan scan)
public void delete(FactScan scan)
scan - specifies deletion criteriapublic Set<co.cask.cdap.api.dataset.lib.cube.DimensionValue> findSingleDimensionValue(List<String> allDimensionNames, Map<String,String> dimensionSlice, long startTs, long endTs)
allDimensionNames - list of all dimension names to be present in the recorddimensionSlice - dimension values to filter by, null means any non-null value.startTs - start of the time range, in secondsendTs - end of the time range, in secondsSet of DimensionValuespublic Set<String> findMeasureNames(List<String> allDimensionNames, Map<String,String> dimensionSlice, long startTs, long endTs)
DimensionValues and time range.allDimensionNames - list of all dimension names to be present in the fact recorddimensionSlice - dimension values to filter by, null means any non-null value.startTs - start timestamp, in secendTs - end timestamp, in secSet of measure namespublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic static byte[][] getSplits(int aggGroupsCount)
Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.