当前位置: 首页>>代码示例>>Java>>正文


Java QueryUtil类代码示例

本文整理汇总了Java中org.apache.phoenix.util.QueryUtil的典型用法代码示例。如果您正苦于以下问题:Java QueryUtil类的具体用法?Java QueryUtil怎么用?Java QueryUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


QueryUtil类属于org.apache.phoenix.util包,在下文中一共展示了QueryUtil类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConnection

import org.apache.phoenix.util.QueryUtil; //导入依赖的package包/类
public static Connection getConnection(final Table table) throws SQLException {
Map<String, String> tableParameterMap = table.getParameters();

String zookeeperQuorum = tableParameterMap.get(PhoenixStorageHandlerConstants.ZOOKEEPER_QUORUM);
zookeeperQuorum = zookeeperQuorum == null ? PhoenixStorageHandlerConstants.DEFAULT_ZOOKEEPER_QUORUM : zookeeperQuorum;

String clientPortString = tableParameterMap.get(PhoenixStorageHandlerConstants.ZOOKEEPER_PORT);
int clientPort = clientPortString == null ? PhoenixStorageHandlerConstants.DEFAULT_ZOOKEEPER_PORT : Integer.parseInt(clientPortString);

String zNodeParent = tableParameterMap.get(PhoenixStorageHandlerConstants.ZOOKEEPER_PARENT);
zNodeParent = zNodeParent == null ? PhoenixStorageHandlerConstants.DEFAULT_ZOOKEEPER_PARENT : zNodeParent;

return DriverManager.getConnection(QueryUtil.getUrl(zookeeperQuorum, clientPort, zNodeParent));
  }
 
开发者ID:mini666,项目名称:hive-phoenix-handler,代码行数:15,代码来源:PhoenixConnectionUtil.java

示例2: initialize

import org.apache.phoenix.util.QueryUtil; //导入依赖的package包/类
private void initialize(Configuration config, Properties properties) throws SQLException {
	this.config = config;
       tableName = config.get(PhoenixStorageHandlerConstants.PHOENIX_TABLE_NAME);
       
       // Disable WAL
       String walConfigName = tableName.toLowerCase() + PhoenixStorageHandlerConstants.DISABLE_WAL;
       boolean disableWal = config.getBoolean(walConfigName, false);
       if (disableWal) {
       	if (LOG.isDebugEnabled()) {
       		LOG.debug("<<<<<<<<<< " + walConfigName + " is true. batch.mode will be set true. >>>>>>>>>>");
       	}
       	
       	properties.setProperty(PhoenixStorageHandlerConstants.BATCH_MODE, "true");
       }
       
       this.conn = PhoenixConnectionUtil.getInputConnection(config, properties);
       
       if (disableWal) {
       	metaDataClient = new MetaDataClient((PhoenixConnection)conn);
       	
       	if (!PhoenixUtil.isDisabledWal(metaDataClient, tableName)) {
       		// execute alter tablel statement if disable_wal is not true.
       		try {
       			PhoenixUtil.alterTableForWalDisable(conn, tableName, true);
       		} catch (ConcurrentTableMutationException e) {
       			if (LOG.isWarnEnabled()) {
       				LOG.warn("<<<<<<<<<< another mapper or task processing wal disable >>>>>>>>>>");
       			}
       		}
       		
       		if (LOG.isDebugEnabled()) {
       			LOG.debug("<<<<<<<<<< " + tableName + "s wal disabled. >>>>>>>>>>");
       		}
       		
       		// restore original value of disable_wal at the end.
       		restoreWalMode = true;
       	}
       }
       
       this.batchSize = PhoenixConfigurationUtil.getBatchSize(config);
       
       if (LOG.isDebugEnabled()) {
       	LOG.debug("<<<<<<<<<< batch-size : " + batchSize + " >>>>>>>>>>");
       }
       
       String upsertQuery = QueryUtil.constructUpsertStatement(tableName, PhoenixUtil.getColumnInfoList(conn, tableName));
       
       if (LOG.isDebugEnabled()) {
       	LOG.debug("<<<<<<<<<< upsert-query : " + upsertQuery + " >>>>>>>>>>");
       }
       this.pstmt = this.conn.prepareStatement(upsertQuery);
}
 
开发者ID:mini666,项目名称:hive-phoenix-handler,代码行数:53,代码来源:PhoenixRecordWriter.java

示例3: getConnection

import org.apache.phoenix.util.QueryUtil; //导入依赖的package包/类
public static Connection getConnection(String zookeeperHost, int zookeeperPort, Properties properties) throws SQLException {
    final String url = QueryUtil.getUrl(zookeeperHost, zookeeperPort);
    Connection connection = DriverManager.getConnection(url, properties);
    return connection;
}
 
开发者ID:mravi,项目名称:pro-phoenix,代码行数:6,代码来源:ConnectionUtil.java


注:本文中的org.apache.phoenix.util.QueryUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。