Java 类org.apache.hadoop.hbase.util.PoolMap.PoolType 实例源码

项目:ditb    文件:HTablePool.java   
/**
 * 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);
}
项目:LCIndex-HBase-0.94.16    文件:HTablePool.java   
/**
 * 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);
}
项目:pbase    文件:HTablePool.java   
/**
 * 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);
}
项目:HIndex    文件:HTablePool.java   
/**
 * 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);
}
项目:IRIndex    文件:HTablePool.java   
/**
 * 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);
}
项目:RStore    文件:HTablePool.java   
/**
 * 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);
}
项目:PyroDB    文件:HTablePool.java   
/**
 * 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);
}
项目:c5    文件:HTablePool.java   
/**
 * 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);
}
项目:haeinsa    文件:HaeinsaTablePool.java   
/**
 * 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);
}
项目:HBase-Research    文件:HTablePool.java   
/**
 * 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);
}
项目:hbase-0.94.8-qod    文件:HTablePool.java   
/**
 * 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);
}
项目:hbase-0.94.8-qod    文件:HTablePool.java   
/**
 * 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);
}
项目:DominoHBase    文件:HTablePool.java   
/**
 * 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);
}
项目:hindex    文件:HTablePool.java   
/**
 * 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);
}
项目:haeinsa    文件:HaeinsaTestingCluster.java   
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();
}
项目:ditb    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
  return PoolType.Reusable;
}
项目:ditb    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
  return PoolType.ThreadLocal;
}
项目:ditb    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.RoundRobin;
}
项目:ditb    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.ThreadLocal;
}
项目:ditb    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.Reusable;
}
项目:LCIndex-HBase-0.94.16    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
    return PoolType.Reusable;
}
项目:LCIndex-HBase-0.94.16    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
    return PoolType.ThreadLocal;
}
项目:LCIndex-HBase-0.94.16    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.RoundRobin;
}
项目:LCIndex-HBase-0.94.16    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.ThreadLocal;
}
项目:LCIndex-HBase-0.94.16    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.Reusable;
}
项目:pbase    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
  return PoolType.Reusable;
}
项目:pbase    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
  return PoolType.ThreadLocal;
}
项目:pbase    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.RoundRobin;
}
项目:pbase    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.ThreadLocal;
}
项目:pbase    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.Reusable;
}
项目:HIndex    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
    return PoolType.Reusable;
}
项目:HIndex    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
    return PoolType.ThreadLocal;
}
项目:HIndex    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.RoundRobin;
}
项目:HIndex    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.ThreadLocal;
}
项目:HIndex    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.Reusable;
}
项目:IRIndex    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
    return PoolType.Reusable;
}
项目:IRIndex    文件:TestHTablePool.java   
@Override
protected PoolType getPoolType() {
    return PoolType.ThreadLocal;
}
项目:IRIndex    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.RoundRobin;
}
项目:IRIndex    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.ThreadLocal;
}
项目:IRIndex    文件:TestPoolMap.java   
@Override
protected PoolType getPoolType() {
  return PoolType.Reusable;
}