public class JoinableClause extends Object implements ReferenceCountedObject
Created from PreJoinableClause
.
Constructor and Description |
---|
JoinableClause(String prefix,
Joinable joinable,
JoinType joinType,
JoinConditionAnalysis condition) |
Modifier and Type | Method and Description |
---|---|
Optional<Closeable> |
acquireReferences()
This method is expected to increment a reference count and provide a
Closeable that decrements the
reference count when closed. |
boolean |
equals(Object o) |
List<String> |
getAvailableColumnsPrefixed()
Returns a list of columns from the underlying
Joinable.getAvailableColumns() method, with our
prefix (getPrefix() ) prepended. |
JoinConditionAnalysis |
getCondition()
The join condition.
|
Joinable |
getJoinable()
The right-hand Joinable.
|
JoinType |
getJoinType()
The type of join: LEFT, RIGHT, INNER, or FULL.
|
String |
getPrefix()
The prefix to apply to all columns from the Joinable.
|
int |
hashCode() |
boolean |
includesColumn(String columnName)
Returns whether "columnName" can be retrieved from the
Joinable represented by this clause (i.e., whether
it starts with prefix and has at least one other character beyond that). |
String |
toString() |
String |
unprefix(String columnName)
Removes our prefix from "columnName".
|
public JoinableClause(String prefix, Joinable joinable, JoinType joinType, JoinConditionAnalysis condition)
public String getPrefix()
JoinMatcher.getColumnSelectorFactory()
. Any other
columns should be returned from the left-hand side of the join.
The prefix can be any string, as long as it is nonempty and not itself a prefix of the reserved column name
__time
.public Joinable getJoinable()
public JoinType getJoinType()
public JoinConditionAnalysis getCondition()
public List<String> getAvailableColumnsPrefixed()
Joinable.getAvailableColumns()
method, with our
prefix (getPrefix()
) prepended.public boolean includesColumn(String columnName)
Joinable
represented by this clause (i.e., whether
it starts with prefix
and has at least one other character beyond that).public String unprefix(String columnName)
includesColumn(java.lang.String)
would have returned true
on this column name.public Optional<Closeable> acquireReferences()
ReferenceCountedObject
Closeable
that decrements the
reference count when closed. This is likely just a wrapper around
ReferenceCountingCloseableObject.incrementReferenceAndDecrementOnceCloseable()
, but may also include any
other associated references which should be incremented when this method is called, and decremented/released by the
closeable.
IMPORTANT NOTE: to fulfill the contract of this method, implementors must return a closeable to indicate that the
reference can be acquired, even if there is nothing to close. Implementors should avoid allowing this method or the
Closeable
it creates to throw exceptions.
For callers: if this method returns non-empty, IT MUST BE CLOSED, else reference counts can potentially leak.acquireReferences
in interface ReferenceCountedObject
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.