Constructor and Description |
---|
SegmentationCandidate(SegmentationCandidate segmentationCandidate) |
Modifier and Type | Method and Description |
---|---|
void |
addAnswerableMeasurePhraseIndices(int index)
Add `index` as answerable index in a pre-decided list of queried phrases.
|
boolean |
contains(Candidate candidate)
Returns true if this candidate contains the given candidate
|
Candidate |
copy()
Clones this candidate
|
boolean |
equals(Object obj) |
boolean |
evaluateCompleteness(TimeRange timeRange,
TimeRange queriedTimeRange,
boolean failOnPartialData)
Calculates if this candidate can answer the query for given time range based on actual data registered with
the underlying candidate storages.
|
SegmentationCandidate |
explode()
Explode this candidate into another candidate.
|
Set<Integer> |
getAnswerableMeasurePhraseIndices()
Gets the index positions of answerable measure phrases in CubeQueryContext#selectPhrases
|
Collection<Candidate> |
getChildren()
Returns child candidates of this candidate if any.
|
int |
getChildrenCount()
Count of children
|
Optional<Date> |
getColumnEndTime(String column)
This method should give end time of a column, if there's any.
|
Collection<String> |
getColumns()
Returns all the fact columns
|
Optional<Date> |
getColumnStartTime(String column)
This method should give start time of a column, if there's any.
|
OptionalDouble |
getCost() |
CubeQueryContext |
getCubeQueryContext()
A candidate always works along with its cube query context.
|
Date |
getEndTime()
End Time for this candidate (calculated based on schema)
|
Set<FactPartition> |
getParticipatingPartitions()
Returns the set of fact partitions that will participate in this candidate.
|
Date |
getStartTime()
Start Time for this candidate (calculated based on schema)
|
int |
hashCode() |
boolean |
isDimAttributeEvaluable(String dim)
Checks whether a dim attribute is evaluable by this candidate
|
boolean |
isExpressionEvaluable(org.apache.lens.cube.parse.ExpressionResolver.ExpressionContext expr)
Checks whether an expression is evaluable by this candidate
1.
|
boolean |
isExpressionEvaluable(String expr)
Checks whether an expression is evaluable by this candidate
1.
|
boolean |
isPhraseAnswerable(org.apache.lens.cube.parse.QueriedPhraseContext phrase)
Checks whether the given queries phrase is evaluable by this candidate
|
boolean |
isTimeRangeCoverable(TimeRange timeRange)
Is time range coverable based on start and end times configured in schema for the composing storage candidates
and valid update periods.
|
String |
toString() |
coveredPhrases, decideMeasurePhrasesToAnswer, getConf, getCube, getCubeMetastoreClient, hasColumn, isColumnPresentAndValidForRange, isColumnValidForRange, isCompletelyValidForTimeRanges, isPartiallyValidForTimeRange, isPartiallyValidForTimeRanges, toQueryWriterContext, updateStorageCandidateQueriablePhraseIndices
public SegmentationCandidate(SegmentationCandidate segmentationCandidate) throws LensException
LensException
public SegmentationCandidate explode() throws LensException
Candidate
explode
in interface Candidate
LensException
public Collection<String> getColumns()
Candidate
getColumns
in interface Candidate
public Date getStartTime()
Candidate
getStartTime
in interface Candidate
public Date getEndTime()
Candidate
getEndTime
in interface Candidate
public OptionalDouble getCost()
public boolean contains(Candidate candidate)
Candidate
public Collection<Candidate> getChildren()
Candidate
getChildren
in interface Candidate
public int getChildrenCount()
Candidate
getChildrenCount
in interface Candidate
public boolean isTimeRangeCoverable(TimeRange timeRange) throws LensException
Candidate
Candidate.evaluateCompleteness(TimeRange, TimeRange, boolean)
.
isTimeRangeCoverable checks the the possibility of covering time range from schema perspective by using valid
storages/update periods while evaluateCompleteness checks if a time range can be covered based on
registered partitions. So isTimeRangeCoverable = false implies evaluateCompleteness = false but vice versa is
not true.isTimeRangeCoverable
in interface Candidate
timeRange
- The time range to checkLensException
- propagated exceptionspublic boolean evaluateCompleteness(TimeRange timeRange, TimeRange queriedTimeRange, boolean failOnPartialData) throws LensException
Candidate
Candidate.getParticipatingPartitions()
.evaluateCompleteness
in interface Candidate
timeRange
- : TimeRange to check completeness for. TimeRange consists of start time, end time and the
partition columnqueriedTimeRange
- : User quried timerangefailOnPartialData
- : fail fast if the candidate can answer the query only partiallyLensException
public Set<FactPartition> getParticipatingPartitions()
Candidate
Candidate.evaluateCompleteness(TimeRange, TimeRange, boolean)
getParticipatingPartitions
in interface Candidate
public boolean isExpressionEvaluable(org.apache.lens.cube.parse.ExpressionResolver.ExpressionContext expr)
Candidate
isExpressionEvaluable
in interface Candidate
expr
- Expression to be evaluated for Candidatepublic boolean isExpressionEvaluable(String expr)
Candidate
isExpressionEvaluable
in interface Candidate
expr
- Expression to be evaluated for Candidatepublic boolean isDimAttributeEvaluable(String dim) throws LensException
Candidate
isDimAttributeEvaluable
in interface Candidate
dim
- dim attributeLensException
- propageted exceptionpublic Candidate copy() throws LensException
Candidate
copy
in interface Candidate
LensException
- propagated exceptionpublic boolean isPhraseAnswerable(org.apache.lens.cube.parse.QueriedPhraseContext phrase)
Candidate
isPhraseAnswerable
in interface Candidate
phrase
- Phrase to checkpublic Optional<Date> getColumnStartTime(String column)
Candidate
getColumnStartTime
in interface Candidate
column
- column namepublic Optional<Date> getColumnEndTime(String column)
Candidate
getColumnEndTime
in interface Candidate
column
- column namepublic void addAnswerableMeasurePhraseIndices(int index)
Candidate
addAnswerableMeasurePhraseIndices
in interface Candidate
index
- index to mark as answerable@Generated(value="lombok") public CubeQueryContext getCubeQueryContext()
Candidate
getCubeQueryContext
in interface Candidate
@Generated(value="lombok") public Set<Integer> getAnswerableMeasurePhraseIndices()
Candidate
getAnswerableMeasurePhraseIndices
in interface Candidate
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.