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


Java PoolType类代码示例

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


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

示例1: HTablePool

import org.apache.hadoop.hbase.util.PoolMap.PoolType; //导入依赖的package包/类
/**
 * Constructor to set maximum versions and use the specified configuration,
 * table factory and pool type. The HTablePool supports the
 * {@link PoolType#Reusable} and {@link PoolType#ThreadLocal}. If the pool
 * type is null or not one of those two values, then it will default to
 * {@link PoolType#Reusable}.
 *
 * @param config
 *          configuration
 * @param maxSize
 *          maximum number of references to keep for each table
 * @param tableFactory
 *          table factory
 * @param poolType
 *          pool type which is one of {@link PoolType#Reusable} or
 *          {@link PoolType#ThreadLocal}
 */
public HTablePool(final Configuration config, final int maxSize,
    final HTableInterfaceFactory tableFactory, PoolType poolType) {
  // Make a new configuration instance so I can safely cleanup when
  // done with the pool.
  this.config = config == null ? HBaseConfiguration.create() : config;
  this.maxSize = maxSize;
  this.tableFactory = tableFactory == null ? new HTableFactory()
      : tableFactory;
  if (poolType == null) {
    this.poolType = PoolType.Reusable;
  } else {
    switch (poolType) {
    case Reusable:
    case ThreadLocal:
      this.poolType = poolType;
      break;
    default:
      this.poolType = PoolType.Reusable;
      break;
    }
  }
  this.tables = new PoolMap<String, HTableInterface>(this.poolType,
      this.maxSize);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:42,代码来源:HTablePool.java

示例2: HTablePool

import org.apache.hadoop.hbase.util.PoolMap.PoolType; //导入依赖的package包/类
/**
 * Constructor to set maximum versions and use the specified configuration,
 * table factory and pool type. The HTablePool supports the
 * {@link PoolType#Reusable} and {@link PoolType#ThreadLocal}. If the pool
 * type is null or not one of those two values, then it will default to
 * {@link PoolType#Reusable}.
 * 
 * @param config
 *          configuration
 * @param maxSize
 *          maximum number of references to keep for each table
 * @param tableFactory
 *          table factory
 * @param poolType
 *          pool type which is one of {@link PoolType#Reusable} or
 *          {@link PoolType#ThreadLocal}
 */
public HTablePool(final Configuration config, final int maxSize,
    final HTableInterfaceFactory tableFactory, PoolType poolType) {
  // Make a new configuration instance so I can safely cleanup when
  // done with the pool.
  this.config = config == null ? HBaseConfiguration.create() : config;
  this.maxSize = maxSize;
  this.tableFactory = tableFactory == null ? new HTableFactory()
      : tableFactory;
  if (poolType == null) {
    this.poolType = PoolType.Reusable;
  } else {
    switch (poolType) {
    case Reusable:
    case ThreadLocal:
      this.poolType = poolType;
      break;
    default:
      this.poolType = PoolType.Reusable;
      break;
    }
  }
  this.tables = new PoolMap<String, HTableInterface>(this.poolType,
      this.maxSize);
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:42,代码来源:HTablePool.java

示例3: HTablePool

import org.apache.hadoop.hbase.util.PoolMap.PoolType; //导入依赖的package包/类
/**
 * Constructor to set maximum versions and use the specified configuration,
 * table factory and pool type. The HTablePool supports the
 * {@link PoolType#Reusable} and {@link PoolType#ThreadLocal}. If the pool
 * type is null or not one of those two values, then it will default to
 * {@link PoolType#Reusable}.
 * 
 * @param config
 *          configuration
 * @param maxSize
 *          maximum number of references to keep for each table
 * @param tableFactory
 *          table factory
 * @param poolType
 *          pool type which is one of {@link PoolType#Reusable} or
 *          {@link PoolType#ThreadLocal}
 */
public HTablePool(final Configuration config, final int maxSize,
    final HTableInterfaceFactory tableFactory, PoolType poolType) {
  // Make a new configuration instance so I can safely cleanup when
  // done with the pool.
  this.config = config == null ? new Configuration() : config;
  this.maxSize = maxSize;
  this.tableFactory = tableFactory == null ? new HTableFactory()
      : tableFactory;
  if (poolType == null) {
    this.poolType = PoolType.Reusable;
  } else {
    switch (poolType) {
    case Reusable:
    case ThreadLocal:
      this.poolType = poolType;
      break;
    default:
      this.poolType = PoolType.Reusable;
      break;
    }
  }
  this.tables = new PoolMap<String, HTableInterface>(this.poolType,
      this.maxSize);
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:42,代码来源:HTablePool.java

示例4: HaeinsaTablePool

import org.apache.hadoop.hbase.util.PoolMap.PoolType; //导入依赖的package包/类
/**
 * Constructor to set maximum versions and use the specified configuration,
 * table factory and pool type. The HTablePool supports the
 * {@link PoolType#Reusable} and {@link PoolType#ThreadLocal}. If the pool
 * type is null or not one of those two values, then it will default to
 * {@link PoolType#Reusable}.
 *
 * @param config configuration
 * @param maxSize maximum number of references to keep for each table
 * @param tableFactory table factory
 * @param poolType pool type which is one of {@link PoolType#Reusable} or
 * {@link PoolType#ThreadLocal}
 */
public HaeinsaTablePool(final Configuration config, final int maxSize,
                        final HaeinsaTableIfaceFactory tableFactory, PoolType poolType) {
    // Make a new configuration instance so I can safely cleanup when
    // done with the pool.
    this.config = config == null ? new Configuration() : config;
    this.maxSize = maxSize;
    this.tableFactory = tableFactory == null ? new DefaultHaeinsaTableIfaceFactory(new HTableFactory()) : tableFactory;
    if (poolType == null) {
        this.poolType = PoolType.Reusable;
    } else {
        switch (poolType) {
        case Reusable:
        case ThreadLocal: {
            this.poolType = poolType;
            break;
        }
        default: {
            this.poolType = PoolType.Reusable;
            break;
        }
        }
    }
    this.tables = new PoolMap<String, HaeinsaTableIfaceInternal>(this.poolType, this.maxSize);
}
 
开发者ID:VCNC,项目名称:haeinsa,代码行数:38,代码来源:HaeinsaTablePool.java

示例5: HaeinsaTestingCluster

import org.apache.hadoop.hbase.util.PoolMap.PoolType; //导入依赖的package包/类
private HaeinsaTestingCluster() throws Exception {
    Configuration conf = HBaseConfiguration.create();
    HBaseTestingUtility utility = new HBaseTestingUtility(conf);
    utility.cleanupTestDir();
    cluster = utility.startMiniCluster();
    configuration = cluster.getConfiguration();

    threadPool = Executors.newCachedThreadPool();
    haeinsaTablePool = TestingUtility.createHaeinsaTablePool(configuration, threadPool);
    hbaseTablePool = new HTablePool(configuration, 128, PoolType.Reusable);
    transactionManager = new HaeinsaTransactionManager(haeinsaTablePool);
    createdTableNames = Sets.newHashSet();
}
 
开发者ID:VCNC,项目名称:haeinsa,代码行数:14,代码来源:HaeinsaTestingCluster.java

示例6: getPoolType

import org.apache.hadoop.hbase.util.PoolMap.PoolType; //导入依赖的package包/类
@Override
protected PoolType getPoolType() {
  return PoolType.Reusable;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:TestHTablePool.java

示例7: getPoolType

import org.apache.hadoop.hbase.util.PoolMap.PoolType; //导入依赖的package包/类
@Override
protected PoolType getPoolType() {
  return PoolType.RoundRobin;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:TestPoolMap.java

示例8: getPoolType

import org.apache.hadoop.hbase.util.PoolMap.PoolType; //导入依赖的package包/类
@Override
protected PoolType getPoolType() {
	return PoolType.Reusable;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:5,代码来源:TestHTablePool.java


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