YARN-6658. Remove columnFor() methods of Columns in HBaseTimeline backend (Haibo Chen via Varun Saxena)
This commit is contained in:
parent
a8f082a180
commit
f6a51dce18
|
@ -105,52 +105,4 @@ public enum ApplicationColumn implements Column<ApplicationTable> {
|
|||
return column.getValueConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link ApplicationColumn} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(x) == columnFor(y)} if
|
||||
* and only if {@code x.equals(y)} or {@code (x == y == null)}.
|
||||
*
|
||||
* @param columnQualifier Name of the column to retrieve
|
||||
* @return the corresponding {@link ApplicationColumn} or null
|
||||
*/
|
||||
public static final ApplicationColumn columnFor(String columnQualifier) {
|
||||
|
||||
// Match column based on value, assume column family matches.
|
||||
for (ApplicationColumn ac : ApplicationColumn.values()) {
|
||||
// Find a match based only on name.
|
||||
if (ac.getColumnQualifier().equals(columnQualifier)) {
|
||||
return ac;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link ApplicationColumn} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(a,x) == columnFor(b,y)}
|
||||
* if and only if {@code a.equals(b) & x.equals(y)} or
|
||||
* {@code (x == y == null)}
|
||||
*
|
||||
* @param columnFamily The columnFamily for which to retrieve the column.
|
||||
* @param name Name of the column to retrieve
|
||||
* @return the corresponding {@link ApplicationColumn} or null if both
|
||||
* arguments don't match.
|
||||
*/
|
||||
public static final ApplicationColumn columnFor(
|
||||
ApplicationColumnFamily columnFamily, String name) {
|
||||
|
||||
for (ApplicationColumn ac : ApplicationColumn.values()) {
|
||||
// Find a match based column family and on name.
|
||||
if (ac.columnFamily.equals(columnFamily)
|
||||
&& ac.getColumnQualifier().equals(name)) {
|
||||
return ac;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -233,56 +233,4 @@ public enum ApplicationColumnPrefix implements ColumnPrefix<ApplicationTable> {
|
|||
keyConverter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link ApplicationColumnPrefix} given a name, or null if there
|
||||
* is no match. The following holds true: {@code columnFor(x) == columnFor(y)}
|
||||
* if and only if {@code x.equals(y)} or {@code (x == y == null)}
|
||||
*
|
||||
* @param columnPrefix Name of the column to retrieve
|
||||
* @return the corresponding {@link ApplicationColumnPrefix} or null
|
||||
*/
|
||||
public static final ApplicationColumnPrefix columnFor(String columnPrefix) {
|
||||
|
||||
// Match column based on value, assume column family matches.
|
||||
for (ApplicationColumnPrefix acp : ApplicationColumnPrefix.values()) {
|
||||
// Find a match based only on name.
|
||||
if (acp.getColumnPrefix().equals(columnPrefix)) {
|
||||
return acp;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link ApplicationColumnPrefix} given a name, or null if there
|
||||
* is no match. The following holds true:
|
||||
* {@code columnFor(a,x) == columnFor(b,y)} if and only if
|
||||
* {@code (x == y == null)} or {@code a.equals(b) & x.equals(y)}
|
||||
*
|
||||
* @param columnFamily The columnFamily for which to retrieve the column.
|
||||
* @param columnPrefix Name of the column to retrieve
|
||||
* @return the corresponding {@link ApplicationColumnPrefix} or null if both
|
||||
* arguments don't match.
|
||||
*/
|
||||
public static final ApplicationColumnPrefix columnFor(
|
||||
ApplicationColumnFamily columnFamily, String columnPrefix) {
|
||||
|
||||
// TODO: needs unit test to confirm and need to update javadoc to explain
|
||||
// null prefix case.
|
||||
|
||||
for (ApplicationColumnPrefix acp : ApplicationColumnPrefix.values()) {
|
||||
// Find a match based column family and on name.
|
||||
if (acp.columnFamily.equals(columnFamily)
|
||||
&& (((columnPrefix == null) && (acp.getColumnPrefix() == null)) ||
|
||||
(acp.getColumnPrefix().equals(columnPrefix)))) {
|
||||
return acp;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -98,51 +98,4 @@ public enum AppToFlowColumn implements Column<AppToFlowTable> {
|
|||
return column.readResult(result, columnQualifierBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link AppToFlowColumn} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(x) == columnFor(y)} if
|
||||
* and only if {@code x.equals(y)} or {@code (x == y == null)}
|
||||
*
|
||||
* @param columnQualifier Name of the column to retrieve
|
||||
* @return the corresponding {@link AppToFlowColumn} or null
|
||||
*/
|
||||
public static final AppToFlowColumn columnFor(String columnQualifier) {
|
||||
|
||||
// Match column based on value, assume column family matches.
|
||||
for (AppToFlowColumn ec : AppToFlowColumn.values()) {
|
||||
// Find a match based only on name.
|
||||
if (ec.getColumnQualifier().equals(columnQualifier)) {
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link AppToFlowColumn} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(a,x) == columnFor(b,y)}
|
||||
* if and only if {@code a.equals(b) & x.equals(y)} or
|
||||
* {@code (x == y == null)}
|
||||
*
|
||||
* @param columnFamily The columnFamily for which to retrieve the column.
|
||||
* @param name Name of the column to retrieve
|
||||
* @return the corresponding {@link AppToFlowColumn} or null if both arguments
|
||||
* don't match.
|
||||
*/
|
||||
public static final AppToFlowColumn columnFor(
|
||||
AppToFlowColumnFamily columnFamily, String name) {
|
||||
|
||||
for (AppToFlowColumn ec : AppToFlowColumn.values()) {
|
||||
// Find a match based column family and on name.
|
||||
if (ec.columnFamily.equals(columnFamily)
|
||||
&& ec.getColumnQualifier().equals(name)) {
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,28 +94,6 @@ public enum EntityColumn implements Column<EntityTable> {
|
|||
return column.readResult(result, columnQualifierBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link EntityColumn} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(x) == columnFor(y)} if
|
||||
* and only if {@code x.equals(y)} or {@code (x == y == null)}
|
||||
*
|
||||
* @param columnQualifier Name of the column to retrieve
|
||||
* @return the corresponding {@link EntityColumn} or null
|
||||
*/
|
||||
public static final EntityColumn columnFor(String columnQualifier) {
|
||||
|
||||
// Match column based on value, assume column family matches.
|
||||
for (EntityColumn ec : EntityColumn.values()) {
|
||||
// Find a match based only on name.
|
||||
if (ec.getColumnQualifier().equals(columnQualifier)) {
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getColumnQualifierBytes() {
|
||||
return columnQualifierBytes.clone();
|
||||
|
@ -131,30 +109,4 @@ public enum EntityColumn implements Column<EntityTable> {
|
|||
return column.getValueConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link EntityColumn} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(a,x) == columnFor(b,y)}
|
||||
* if and only if {@code a.equals(b) & x.equals(y)} or
|
||||
* {@code (x == y == null)}
|
||||
*
|
||||
* @param columnFamily The columnFamily for which to retrieve the column.
|
||||
* @param name Name of the column to retrieve
|
||||
* @return the corresponding {@link EntityColumn} or null if both arguments
|
||||
* don't match.
|
||||
*/
|
||||
public static final EntityColumn columnFor(EntityColumnFamily columnFamily,
|
||||
String name) {
|
||||
|
||||
for (EntityColumn ec : EntityColumn.values()) {
|
||||
// Find a match based column family and on name.
|
||||
if (ec.columnFamily.equals(columnFamily)
|
||||
&& ec.getColumnQualifier().equals(name)) {
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -246,55 +246,4 @@ public enum EntityColumnPrefix implements ColumnPrefix<EntityTable> {
|
|||
keyConverter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link EntityColumnPrefix} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(x) == columnFor(y)} if
|
||||
* and only if {@code x.equals(y)} or {@code (x == y == null)}
|
||||
*
|
||||
* @param columnPrefix Name of the column to retrieve
|
||||
* @return the corresponding {@link EntityColumnPrefix} or null
|
||||
*/
|
||||
public static final EntityColumnPrefix columnFor(String columnPrefix) {
|
||||
|
||||
// Match column based on value, assume column family matches.
|
||||
for (EntityColumnPrefix ecp : EntityColumnPrefix.values()) {
|
||||
// Find a match based only on name.
|
||||
if (ecp.getColumnPrefix().equals(columnPrefix)) {
|
||||
return ecp;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link EntityColumnPrefix} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(a,x) == columnFor(b,y)}
|
||||
* if and only if {@code (x == y == null)} or
|
||||
* {@code a.equals(b) & x.equals(y)}
|
||||
*
|
||||
* @param columnFamily The columnFamily for which to retrieve the column.
|
||||
* @param columnPrefix Name of the column to retrieve
|
||||
* @return the corresponding {@link EntityColumnPrefix} or null if both
|
||||
* arguments don't match.
|
||||
*/
|
||||
public static final EntityColumnPrefix columnFor(
|
||||
EntityColumnFamily columnFamily, String columnPrefix) {
|
||||
|
||||
// TODO: needs unit test to confirm and need to update javadoc to explain
|
||||
// null prefix case.
|
||||
|
||||
for (EntityColumnPrefix ecp : EntityColumnPrefix.values()) {
|
||||
// Find a match based column family and on name.
|
||||
if (ecp.columnFamily.equals(columnFamily)
|
||||
&& (((columnPrefix == null) && (ecp.getColumnPrefix() == null)) ||
|
||||
(ecp.getColumnPrefix().equals(columnPrefix)))) {
|
||||
return ecp;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -191,62 +191,6 @@ public enum FlowActivityColumnPrefix
|
|||
keyConverter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link FlowActivityColumnPrefix} given a name, or null if there
|
||||
* is no match. The following holds true: {@code columnFor(x) == columnFor(y)}
|
||||
* if and only if {@code x.equals(y)} or {@code (x == y == null)}
|
||||
*
|
||||
* @param columnPrefix
|
||||
* Name of the column to retrieve
|
||||
* @return the corresponding {@link FlowActivityColumnPrefix} or null
|
||||
*/
|
||||
public static final FlowActivityColumnPrefix columnFor(String columnPrefix) {
|
||||
|
||||
// Match column based on value, assume column family matches.
|
||||
for (FlowActivityColumnPrefix flowActivityColPrefix :
|
||||
FlowActivityColumnPrefix.values()) {
|
||||
// Find a match based only on name.
|
||||
if (flowActivityColPrefix.getColumnPrefix().equals(columnPrefix)) {
|
||||
return flowActivityColPrefix;
|
||||
}
|
||||
}
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link FlowActivityColumnPrefix} given a name, or null if there
|
||||
* is no match. The following holds true:
|
||||
* {@code columnFor(a,x) == columnFor(b,y)} if and only if
|
||||
* {@code (x == y == null)} or {@code a.equals(b) & x.equals(y)}
|
||||
*
|
||||
* @param columnFamily
|
||||
* The columnFamily for which to retrieve the column.
|
||||
* @param columnPrefix
|
||||
* Name of the column to retrieve
|
||||
* @return the corresponding {@link FlowActivityColumnPrefix} or null if both
|
||||
* arguments don't match.
|
||||
*/
|
||||
public static final FlowActivityColumnPrefix columnFor(
|
||||
FlowActivityColumnFamily columnFamily, String columnPrefix) {
|
||||
|
||||
// TODO: needs unit test to confirm and need to update javadoc to explain
|
||||
// null prefix case.
|
||||
|
||||
for (FlowActivityColumnPrefix flowActivityColumnPrefix :
|
||||
FlowActivityColumnPrefix.values()) {
|
||||
// Find a match based column family and on name.
|
||||
if (flowActivityColumnPrefix.columnFamily.equals(columnFamily)
|
||||
&& (((columnPrefix == null) && (flowActivityColumnPrefix
|
||||
.getColumnPrefix() == null)) || (flowActivityColumnPrefix
|
||||
.getColumnPrefix().equals(columnPrefix)))) {
|
||||
return flowActivityColumnPrefix;
|
||||
}
|
||||
}
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -123,60 +123,9 @@ public enum FlowRunColumn implements Column<FlowRunTable> {
|
|||
return column.readResult(result, columnQualifierBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link FlowRunColumn} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(x) == columnFor(y)} if
|
||||
* and only if {@code x.equals(y)} or {@code (x == y == null)}
|
||||
*
|
||||
* @param columnQualifier
|
||||
* Name of the column to retrieve
|
||||
* @return the corresponding {@link FlowRunColumn} or null
|
||||
*/
|
||||
public static final FlowRunColumn columnFor(String columnQualifier) {
|
||||
|
||||
// Match column based on value, assume column family matches.
|
||||
for (FlowRunColumn ec : FlowRunColumn.values()) {
|
||||
// Find a match based only on name.
|
||||
if (ec.getColumnQualifier().equals(columnQualifier)) {
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueConverter getValueConverter() {
|
||||
return column.getValueConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link FlowRunColumn} given a name, or null if there is no
|
||||
* match. The following holds true: {@code columnFor(a,x) == columnFor(b,y)}
|
||||
* if and only if {@code a.equals(b) & x.equals(y)} or
|
||||
* {@code (x == y == null)}
|
||||
*
|
||||
* @param columnFamily
|
||||
* The columnFamily for which to retrieve the column.
|
||||
* @param name
|
||||
* Name of the column to retrieve
|
||||
* @return the corresponding {@link FlowRunColumn} or null if both arguments
|
||||
* don't match.
|
||||
*/
|
||||
public static final FlowRunColumn columnFor(FlowRunColumnFamily columnFamily,
|
||||
String name) {
|
||||
|
||||
for (FlowRunColumn ec : FlowRunColumn.values()) {
|
||||
// Find a match based column family and on name.
|
||||
if (ec.columnFamily.equals(columnFamily)
|
||||
&& ec.getColumnQualifier().equals(name)) {
|
||||
return ec;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -209,60 +209,9 @@ public enum FlowRunColumnPrefix implements ColumnPrefix<FlowRunTable> {
|
|||
keyConverter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link FlowRunColumnPrefix} given a name, or null if there is
|
||||
* no match. The following holds true: {@code columnFor(x) == columnFor(y)} if
|
||||
* and only if {@code x.equals(y)} or {@code (x == y == null)}
|
||||
*
|
||||
* @param columnPrefix Name of the column to retrieve
|
||||
* @return the corresponding {@link FlowRunColumnPrefix} or null
|
||||
*/
|
||||
public static final FlowRunColumnPrefix columnFor(String columnPrefix) {
|
||||
|
||||
// Match column based on value, assume column family matches.
|
||||
for (FlowRunColumnPrefix frcp : FlowRunColumnPrefix.values()) {
|
||||
// Find a match based only on name.
|
||||
if (frcp.getColumnPrefix().equals(columnPrefix)) {
|
||||
return frcp;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueConverter getValueConverter() {
|
||||
return column.getValueConverter();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an {@link FlowRunColumnPrefix} given a name, or null if there is
|
||||
* no match. The following holds true:
|
||||
* {@code columnFor(a,x) == columnFor(b,y)} if and only if
|
||||
* {@code (x == y == null)} or {@code a.equals(b) & x.equals(y)}
|
||||
*
|
||||
* @param columnFamily The columnFamily for which to retrieve the column.
|
||||
* @param columnPrefix Name of the column to retrieve
|
||||
* @return the corresponding {@link FlowRunColumnPrefix} or null if both
|
||||
* arguments don't match.
|
||||
*/
|
||||
public static final FlowRunColumnPrefix columnFor(
|
||||
FlowRunColumnFamily columnFamily, String columnPrefix) {
|
||||
|
||||
// TODO: needs unit test to confirm and need to update javadoc to explain
|
||||
// null prefix case.
|
||||
|
||||
for (FlowRunColumnPrefix frcp : FlowRunColumnPrefix.values()) {
|
||||
// Find a match based column family and on name.
|
||||
if (frcp.columnFamily.equals(columnFamily)
|
||||
&& (((columnPrefix == null) && (frcp.getColumnPrefix() == null)) ||
|
||||
(frcp.getColumnPrefix().equals(columnPrefix)))) {
|
||||
return frcp;
|
||||
}
|
||||
}
|
||||
|
||||
// Default to null
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue