Java 类org.apache.hadoop.hbase.index.coprocessor.master.IndexMasterObserver 实例源码

项目:HIndex    文件:TestScanWhenTTLExpired.java   
@BeforeClass
public static void before() throws Exception {
  Configuration conf = TESTING_UTIL.getConfiguration();
  conf.setInt("hbase.balancer.period", 60000);
  // Needed because some tests have splits happening on RS that are killed
  // We don't want to wait 3min for the master to figure it out
  conf.setInt("hbase.master.assignment.timeoutmonitor.timeout", 4000);
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setInt("hbase.hstore.compactionThreshold",5);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  TESTING_UTIL.startMiniCluster(NB_SERVERS);

}
项目:hindex    文件:TestACLWithIndexTable.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  SecureTestUtil.enableSecurity(conf);
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, AccessController.class.getName() + ","
      + IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, AccessController.class.getName() + ","
      + SecureBulkLoadEndpoint.class.getName() + "," + IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.REGIONSERVER_COPROCESSOR_CONF_KEY, AccessController.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setInt("hbase.regionserver.lease.period", 10 * 60 * 1000);
  conf.setInt("hbase.rpc.timeout", 10 * 60 * 1000);
  conf.setBoolean("hbase.use.secondary.index", true);
  TEST_UTIL.startMiniCluster(2);

  TEST_UTIL.waitTableAvailable(AccessControlLists.ACL_TABLE_NAME, 5000);
  // create a set of test users
  SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" });
  TEST_USER = User.createUserForTesting(conf, "testUser", new String[0]);
}
项目:hindex    文件:IndexUtils.java   
/**
 * Reads the indexed table description directly from the file.
 * @param tableName Table name
 * @param conf HBase Configuration
 * @return HTableDescriptor
 * @throws IOException
 */
public static HTableDescriptor readIndexedHTableDescriptor(String tableName, Configuration conf)
    throws IOException {
  IndexedHTableDescriptor indexedHTabDescriptor = new IndexedHTableDescriptor();
  FSDataInputStream fsDataInputStream = null;
  try {
    FileSystem fs = FSUtils.getCurrentFileSystem(conf);
    Path rootPath = FSUtils.getRootDir(conf);
    Path path = FSUtils.getTablePath(rootPath, tableName);
    FileStatus status = IndexMasterObserver.getTableInfoPath(fs, path);
    if (null == status) {
      throw new IOException(tableName + " status is null");
    }
    fsDataInputStream = fs.open(status.getPath());
    indexedHTabDescriptor.readFields(fsDataInputStream);
    return indexedHTabDescriptor;
  } catch (EOFException e) {
    return new HTableDescriptor(indexedHTabDescriptor);
  } catch (IOException i) {
    throw i;
  } finally {
    if (fsDataInputStream != null) {
      fsDataInputStream.close();
    }
  }
}
项目:HIndex    文件:TestValuePartitionInScan.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.hregion.scan.loadColumnFamiliesOnDemand", false);
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  UTIL.startMiniCluster(1);
  admin = new IndexAdmin(conf);
}
项目:HIndex    文件:TestSecIndexColocator.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  UTIL.startMiniCluster(2);
  admin = new IndexAdmin(conf);
}
项目:HIndex    文件:TestSecIndexLoadBalancer.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  final int NUM_MASTERS = 1;
  final int NUM_RS = 4;
  Configuration conf = UTIL.getConfiguration();
  conf.setBoolean(HConstants.REGIONSERVER_INFO_PORT_AUTO,true);
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  UTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
  admin = new IndexAdmin(UTIL.getConfiguration());
}
项目:HIndex    文件:TestIndexMapReduceUtil.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  UTIL.startMiniCluster(1);
}
项目:HIndex    文件:TestForComplexIssues.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, LocalIndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
}
项目:HIndex    文件:TestAcidGuaranteesForIndex.java   
public TestAcidGuaranteesForIndex() {
  // Set small flush size for minicluster so we exercise reseeking scanners
  Configuration conf = HBaseConfiguration.create();
  conf.set(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, String.valueOf(128 * 1024));
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  util = new HBaseTestingUtility(conf);
}
项目:HIndex    文件:TestIndexPutsWithRegionServerRestart.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, MockIndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  UTIL.startMiniCluster(1);
  admin = new IndexAdmin(conf);

}
项目:HIndex    文件:TestIndexRegionObserver.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, MockIndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  conf.setInt("hbase.hstore.compactionThreshold",5);
  UTIL.startMiniCluster(1);
  admin = new IndexAdmin(conf);
}
项目:HIndex    文件:TestIndexRegionObserverForScan.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  UTIL.startMiniCluster(1);
  admin = new IndexAdmin(conf);
}
项目:HIndex    文件:TestMultipleIndicesInScan.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  UTIL.startMiniCluster(1);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  admin = new IndexAdmin(conf);
}
项目:HIndex    文件:TestIndexHalfStoreFileReader.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  UTIL.startMiniCluster(1);
  admin = new IndexAdmin(conf);
}
项目:HIndex    文件:TestIndexHalfStoreFileReaderWithEncoding.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.set("index.data.block.encoding.algo", "PREFIX");
  conf.setClass(HConstants.HBASE_MASTER_LOADBALANCER_CLASS, SecIndexLoadBalancer.class,
    LoadBalancer.class);
  UTIL.startMiniCluster(1);
}
项目:hindex    文件:TestValuePartitionInScan.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setInt("hbase.regionserver.lease.period", 10 * 60 * 1000);
  conf.setInt("hbase.rpc.timeout", 10 * 60 * 1000);
  UTIL.startMiniCluster(1);
}
项目:hindex    文件:TestSecIndexColocator.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  UTIL.startMiniCluster(2);
}
项目:hindex    文件:TestSecIndexLoadBalancer.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  final int NUM_MASTERS = 1;
  final int NUM_RS = 4;
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  UTIL.startMiniCluster(NUM_MASTERS, NUM_RS);
}
项目:hindex    文件:TestIndexMapReduceUtil.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  UTIL.startMiniCluster(1);
}
项目:hindex    文件:TestForComplexIssues.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, LocalIndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);

}
项目:hindex    文件:TestAcidGuaranteesForIndex.java   
public TestAcidGuaranteesForIndex() {
  // Set small flush size for minicluster so we exercise reseeking scanners
  Configuration conf = HBaseConfiguration.create();
  conf.set(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, String.valueOf(128 * 1024));
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  util = new HBaseTestingUtility(conf);
}
项目:hindex    文件:TestIndexPutsWithRegionServerRestart.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, MockIndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  UTIL.startMiniCluster(1);
}
项目:hindex    文件:TestScanWhenTTLExpired.java   
@BeforeClass
public static void before() throws Exception {
  Configuration conf = TESTING_UTIL.getConfiguration();
  conf.setInt("hbase.balancer.period", 60000);
  // Needed because some tests have splits happening on RS that are killed
  // We don't want to wait 3min for the master to figure it out
  conf.setInt("hbase.master.assignment.timeoutmonitor.timeout", 4000);
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  TESTING_UTIL.startMiniCluster(NB_SERVERS);
}
项目:hindex    文件:TestIndexRegionObserver.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, MockIndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  UTIL.startMiniCluster(1);
}
项目:hindex    文件:TestIndexRegionObserverForScan.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  UTIL.startMiniCluster(1);
}
项目:hindex    文件:TestMultipleIndicesInScan.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setInt("hbase.regionserver.lease.period", 10 * 60 * 1000);
  conf.setInt("hbase.rpc.timeout", 10 * 60 * 1000);
  UTIL.startMiniCluster(1);
}
项目:hindex    文件:TestIndexHalfStoreFileReader.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  UTIL.startMiniCluster(1);
}
项目:hindex    文件:TestIndexHalfStoreFileReaderWithEncoding.java   
@BeforeClass
public static void setupBeforeClass() throws Exception {
  Configuration conf = UTIL.getConfiguration();
  conf.set(CoprocessorHost.MASTER_COPROCESSOR_CONF_KEY, IndexMasterObserver.class.getName());
  conf.set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, IndexRegionObserver.class.getName());
  conf.set(CoprocessorHost.WAL_COPROCESSOR_CONF_KEY, IndexWALObserver.class.getName());
  conf.setBoolean("hbase.use.secondary.index", true);
  conf.set("index.data.block.encoding.algo", "PREFIX");
  UTIL.startMiniCluster(1);
}