public class StorageCandidate extends Object implements Candidate, CandidateTable
| Constructor and Description |
|---|
StorageCandidate(CubeInterface cube,
FactTable fact,
String storageName,
CubeQueryContext cubeQueryContext) |
StorageCandidate(StorageCandidate sc) |
| 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
|
StorageCandidate |
copy()
Clones this candidate
|
Set<Integer> |
decideMeasurePhrasesToAnswer(Set<Integer> measureIndices) |
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.
|
Candidate |
explode()
Explode this candidate into another candidate.
|
String |
getAliasForTable(String alias) |
Set<Integer> |
getAnswerableMeasurePhraseIndices()
Gets the index positions of answerable measure phrases in CubeQueryContext#selectPhrases
|
AbstractCubeTable |
getBaseTable()
Get base table of the candidate table
|
Collection<Candidate> |
getChildren()
Returns child candidates of this candidate if any.
|
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() |
CubeInterface |
getCube()
Utility method to return cube of its cube query context
|
CubeQueryContext |
getCubeQueryContext()
A candidate always works along with its cube query context.
|
Map<String,Map<String,Float>> |
getDataCompletenessMap()
This map holds Tags (A tag refers to one or more measures) that have incomplete (below configured threshold) data.
|
Date |
getEndTime()
End Time for this candidate (calculated based on schema)
|
FactTable |
getFact()
Participating fact, storage and dimensions for this StorageCandidate
|
String |
getFromString() |
String |
getName()
Name of this storage candidate = storageName_factName
|
Set<String> |
getNonExistingPartitions()
Non existing partitions
|
int |
getNumQueriedParts() |
Set<FactPartition> |
getParticipatingPartitions()
Returns the set of fact partitions that will participate in this candidate.
|
TreeSet<UpdatePeriod> |
getParticipatingUpdatePeriods()
These are the update periods that finally participate in partitions.
|
Set<Dimension> |
getQueriedDims() |
Map<TimeRange,String> |
getRangeToExtraWhereFallBack() |
Map<TimeRange,Set<FactPartition>> |
getRangeToPartitions() |
String |
getResolvedName() |
Date |
getStartTime()
Start Time for this candidate (calculated based on schema)
|
String |
getStorageName() |
String |
getStorageString(String alias)
Get storage string of the base table alias passed
|
String |
getStorageTable()
Get storage table corresponding to this candidate
|
AbstractCubeTable |
getTable()
Get candidate table
|
Map<String,CandidateTablePruneCause.SkipUpdatePeriodCode> |
getUpdatePeriodRejectionCause() |
TreeSet<UpdatePeriod> |
getValidUpdatePeriods()
Valid update periods populated by Phase 1.
|
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 |
isStorageTblsAtUpdatePeriodLevel()
This will be true if this storage candidate has multiple storage tables (one per update period)
https://issues.apache.org/jira/browse/LENS-1386
|
boolean |
isTimeRangeCoverable(TimeRange timeRange)
Is time range coverable based on valid update periods of this storage candidate
|
void |
setFromString(String fromString) |
void |
setName(String name)
Name of this storage candidate = storageName_factName
|
void |
setResolvedName(String resolvedName)
This is the storage table specific name.
|
void |
setUpdatePeriodRejectionCause(Map<String,CandidateTablePruneCause.SkipUpdatePeriodCode> updatePeriodRejectionCause) |
Collection<StorageCandidate> |
splitAtUpdatePeriodLevelIfReq()
Splits the Storage Candidates into multiple Storage Candidates if storage candidate has multiple
storage tables (one per update period)
|
StorageCandidateHQLContext |
toQueryWriterContext(Map<Dimension,CandidateDim> dimsToQuery,
CubeQueryContext rootCubeQueryContext)
Get query writer context from the candidate.
|
String |
toString() |
coveredPhrases, getChildrenCount, getConf, getCubeMetastoreClient, hasColumn, isColumnPresentAndValidForRange, isColumnValidForRange, isCompletelyValidForTimeRanges, isPartiallyValidForTimeRange, isPartiallyValidForTimeRanges, updateStorageCandidateQueriablePhraseIndicespublic StorageCandidate(StorageCandidate sc) throws LensException
LensExceptionpublic StorageCandidate(CubeInterface cube, FactTable fact, String storageName, CubeQueryContext cubeQueryContext) throws LensException
LensExceptionpublic void addAnswerableMeasurePhraseIndices(int index)
CandidateaddAnswerableMeasurePhraseIndices in interface Candidateindex - index to mark as answerablepublic Candidate explode() throws LensException
Candidateexplode in interface CandidateLensExceptionpublic String getStorageString(String alias)
CandidateTablegetStorageString in interface CandidateTablepublic AbstractCubeTable getBaseTable()
CandidateTablegetBaseTable in interface CandidateTablepublic StorageCandidate copy() throws LensException
Candidatecopy in interface CandidateLensException - propagated exceptionpublic boolean isPhraseAnswerable(org.apache.lens.cube.parse.QueriedPhraseContext phrase)
throws LensException
CandidateisPhraseAnswerable in interface Candidatephrase - Phrase to checkLensException - propagated exceptionpublic AbstractCubeTable getTable()
CandidateTablegetTable in interface CandidateTablepublic Optional<Date> getColumnStartTime(String column)
CandidategetColumnStartTime in interface Candidatecolumn - column namepublic Optional<Date> getColumnEndTime(String column)
CandidategetColumnEndTime in interface Candidatecolumn - column namepublic Collection<String> getColumns()
CandidategetColumns in interface CandidategetColumns in interface CandidateTablepublic OptionalDouble getCost()
public boolean contains(Candidate candidate)
Candidatepublic Collection<Candidate> getChildren()
CandidategetChildren in interface Candidatepublic boolean evaluateCompleteness(TimeRange timeRange, TimeRange queriedTimeRange, boolean failOnPartialData) throws LensException
CandidateCandidate.getParticipatingPartitions().evaluateCompleteness in interface CandidatetimeRange - : 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 partiallyLensExceptionpublic Set<FactPartition> getParticipatingPartitions()
CandidateCandidate.evaluateCompleteness(TimeRange, TimeRange, boolean)getParticipatingPartitions in interface CandidategetParticipatingPartitions in interface CandidateTablepublic boolean isExpressionEvaluable(org.apache.lens.cube.parse.ExpressionResolver.ExpressionContext expr)
CandidateisExpressionEvaluable in interface Candidateexpr - Expression to be evaluated for Candidatepublic boolean isExpressionEvaluable(String expr)
CandidateisExpressionEvaluable in interface Candidateexpr - Expression to be evaluated for Candidatepublic boolean isDimAttributeEvaluable(String dim) throws LensException
CandidateisDimAttributeEvaluable in interface Candidatedim - dim attributeLensException - propageted exceptionpublic boolean isTimeRangeCoverable(TimeRange timeRange) throws LensException
isTimeRangeCoverable in interface CandidatetimeRange - LensExceptionpublic String getResolvedName()
public Collection<StorageCandidate> splitAtUpdatePeriodLevelIfReq() throws LensException
LensExceptionpublic StorageCandidateHQLContext toQueryWriterContext(Map<Dimension,CandidateDim> dimsToQuery, CubeQueryContext rootCubeQueryContext) throws LensException
CandidatetoQueryWriterContext in interface CandidatedimsToQuery - Dimensions and corresponding picked CandidateDim for queryrootCubeQueryContext - Root query context.LensException - exception to be propagatedpublic Set<Integer> decideMeasurePhrasesToAnswer(Set<Integer> measureIndices)
decideMeasurePhrasesToAnswer in interface Candidate@Generated(value="lombok") public CubeQueryContext getCubeQueryContext()
CandidategetCubeQueryContext in interface Candidate@Generated(value="lombok") public String getName()
@Generated(value="lombok") public void setName(String name)
@Generated(value="lombok") public void setResolvedName(String resolvedName)
@Generated(value="lombok") public TreeSet<UpdatePeriod> getValidUpdatePeriods()
@Generated(value="lombok") public TreeSet<UpdatePeriod> getParticipatingUpdatePeriods()
getParticipatingPartitions()@Generated(value="lombok") public Map<String,CandidateTablePruneCause.SkipUpdatePeriodCode> getUpdatePeriodRejectionCause()
@Generated(value="lombok") public void setUpdatePeriodRejectionCause(Map<String,CandidateTablePruneCause.SkipUpdatePeriodCode> updatePeriodRejectionCause)
@Generated(value="lombok") public Set<Dimension> getQueriedDims()
@Generated(value="lombok") public Map<String,Map<String,Float>> getDataCompletenessMap()
@Generated(value="lombok") public FactTable getFact()
@Generated(value="lombok") public String getStorageName()
@Generated(value="lombok") public String getStorageTable()
CandidateTablegetStorageTable in interface CandidateTable@Generated(value="lombok") public Map<TimeRange,Set<FactPartition>> getRangeToPartitions()
@Generated(value="lombok") public Map<TimeRange,String> getRangeToExtraWhereFallBack()
@Generated(value="lombok") public Set<Integer> getAnswerableMeasurePhraseIndices()
CandidategetAnswerableMeasurePhraseIndices in interface Candidate@Generated(value="lombok") public String getFromString()
@Generated(value="lombok") public void setFromString(String fromString)
@Generated(value="lombok") public CubeInterface getCube()
Candidate@Generated(value="lombok") public Date getStartTime()
CandidategetStartTime in interface Candidate@Generated(value="lombok") public Date getEndTime()
CandidategetEndTime in interface Candidate@Generated(value="lombok") public Set<String> getNonExistingPartitions()
@Generated(value="lombok") public boolean isStorageTblsAtUpdatePeriodLevel()
@Generated(value="lombok") public int getNumQueriedParts()
Copyright © 2014–2018 Apache Software Foundation. All rights reserved.