org.apache.lens.server.util
Class UtilityMethods

java.lang.Object
  extended by org.apache.lens.server.util.UtilityMethods

public final class UtilityMethods
extends Object

The Class UtilityMethods.


Method Summary
static boolean anyNull(Object... args)
          Any null.
static String confToString(org.apache.hadoop.conf.Configuration conf)
          Conf to string.
static org.apache.commons.dbcp.BasicDataSource getDataSourceFromConf(org.apache.hadoop.conf.Configuration conf)
          Gets the data source from conf.
static
<K,V> void
mergeMaps(Map<K,V> into, Map<K,V> from, boolean override)
          Merge maps.
static String[] queryDatabase(DataSource ds, String querySql, boolean allowNull, Object... args)
          Query database.
static String removeDomain(String username)
          Removes the domain.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mergeMaps

public static <K,V> void mergeMaps(Map<K,V> into,
                                   Map<K,V> from,
                                   boolean override)
Merge maps.

Type Parameters:
K - the key type
V - the value type
Parameters:
into - the into
from - the from
override - the override

removeDomain

public static String removeDomain(String username)
Removes the domain.

Parameters:
username - the username
Returns:
the string

anyNull

public static boolean anyNull(Object... args)
Any null.

Parameters:
args - the args
Returns:
true, if successful

queryDatabase

public static String[] queryDatabase(DataSource ds,
                                     String querySql,
                                     boolean allowNull,
                                     Object... args)
                              throws SQLException
Query database.

Parameters:
ds - the ds
querySql - the query sql
allowNull - the allow null
args - the args
Returns:
the string[]
Throws:
SQLException - the SQL exception

getDataSourceFromConf

public static org.apache.commons.dbcp.BasicDataSource getDataSourceFromConf(org.apache.hadoop.conf.Configuration conf)
Gets the data source from conf.

Parameters:
conf - the conf
Returns:
the data source from conf

confToString

public static String confToString(org.apache.hadoop.conf.Configuration conf)
Conf to string.

Parameters:
conf - the conf
Returns:
the string


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.