Java 类org.apache.hadoop.hbase.security.visibility.ScanLabelGenerator 实例源码

项目:ditb    文件:TestImportTSVWithVisibilityLabels.java   
@BeforeClass
public static void provisionCluster() throws Exception {
  conf = util.getConfiguration();
  SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" });
  conf.set("hbase.superuser", "admin,"+User.getCurrent().getName());
  conf.setInt("hfile.format.version", 3);
  conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS, SimpleScanLabelGenerator.class,
      ScanLabelGenerator.class);
  util.setJobWithoutMRCluster();
  util.startMiniCluster();
  // Wait for the labels table to become available
  util.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
}
项目:pbase    文件:TestImportTSVWithVisibilityLabels.java   
@BeforeClass
public static void provisionCluster() throws Exception {
  conf = util.getConfiguration();
  SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" });
  conf.set("hbase.superuser", "admin,"+User.getCurrent().getName());
  conf.setInt("hfile.format.version", 3);
  conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS, SimpleScanLabelGenerator.class,
      ScanLabelGenerator.class);
  util.startMiniCluster();
  // Wait for the labels table to become available
  util.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  Admin admin = new HBaseAdmin(util.getConfiguration());
  util.startMiniMapReduceCluster();
}
项目:HIndex    文件:TestThriftHBaseServiceHandlerWithLabels.java   
@BeforeClass
public static void beforeClass() throws Exception {
  SUPERUSER = User.createUserForTesting(conf, "admin",
      new String[] { "supergroup" });
  conf = UTIL.getConfiguration();
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS,
      SimpleScanLabelGenerator.class, ScanLabelGenerator.class);
  conf.set("hbase.superuser", SUPERUSER.getShortName());
  conf.set("hbase.coprocessor.master.classes",
      VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes",
      VisibilityController.class.getName());
  conf.setInt("hfile.format.version", 3);
  UTIL.startMiniCluster(1);
  // Wait for the labels table to become available
  UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
  HTableDescriptor tableDescriptor = new HTableDescriptor(
      TableName.valueOf(tableAname));
  for (HColumnDescriptor family : families) {
    tableDescriptor.addFamily(family);
  }
  admin.createTable(tableDescriptor);
  setAuths();
}
项目:HIndex    文件:TestImportTSVWithVisibilityLabels.java   
@BeforeClass
public static void provisionCluster() throws Exception {
  conf = util.getConfiguration();
  SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" });
  conf.set("hbase.superuser", "admin,"+User.getCurrent().getName());
  conf.setInt("hfile.format.version", 3);
  conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS, SimpleScanLabelGenerator.class,
      ScanLabelGenerator.class);
  util.startMiniCluster();
  // Wait for the labels table to become available
  util.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  HBaseAdmin admin = new HBaseAdmin(util.getConfiguration());
  util.startMiniMapReduceCluster();
}
项目:hbase    文件:TestThriftHBaseServiceHandlerWithLabels.java   
@BeforeClass
public static void beforeClass() throws Exception {
  SUPERUSER = User.createUserForTesting(conf, "admin",
      new String[] { "supergroup" });
  conf = UTIL.getConfiguration();
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS,
      SimpleScanLabelGenerator.class, ScanLabelGenerator.class);
  conf.set("hbase.superuser", SUPERUSER.getShortName());
  VisibilityTestUtil.enableVisiblityLabels(conf);
  UTIL.startMiniCluster(1);
  // Wait for the labels table to become available
  UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  Admin admin = UTIL.getAdmin();
  HTableDescriptor tableDescriptor = new HTableDescriptor(
      TableName.valueOf(tableAname));
  for (HColumnDescriptor family : families) {
    tableDescriptor.addFamily(family);
  }
  admin.createTable(tableDescriptor);
  admin.close();
  setAuths();
}
项目:PyroDB    文件:TestThriftHBaseServiceHandlerWithLabels.java   
@BeforeClass
public static void beforeClass() throws Exception {
  SUPERUSER = User.createUserForTesting(conf, "admin",
      new String[] { "supergroup" });
  conf = UTIL.getConfiguration();
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS,
      SimpleScanLabelGenerator.class, ScanLabelGenerator.class);
  conf.set("hbase.superuser", SUPERUSER.getShortName());
  conf.set("hbase.coprocessor.master.classes",
      VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes",
      VisibilityController.class.getName());
  conf.setInt("hfile.format.version", 3);
  UTIL.startMiniCluster(1);
  // Wait for the labels table to become available
  UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  HBaseAdmin admin = new HBaseAdmin(UTIL.getConfiguration());
  HTableDescriptor tableDescriptor = new HTableDescriptor(
      TableName.valueOf(tableAname));
  for (HColumnDescriptor family : families) {
    tableDescriptor.addFamily(family);
  }
  admin.createTable(tableDescriptor);
  setAuths();
}
项目:PyroDB    文件:TestImportTSVWithVisibilityLabels.java   
@BeforeClass
public static void provisionCluster() throws Exception {
  conf = util.getConfiguration();
  SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" });
  conf.set("hbase.superuser", "admin,"+User.getCurrent().getName());
  conf.setInt("hfile.format.version", 3);
  conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS, SimpleScanLabelGenerator.class,
      ScanLabelGenerator.class);
  util.startMiniCluster();
  // Wait for the labels table to become available
  util.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  HBaseAdmin admin = new HBaseAdmin(util.getConfiguration());
  util.startMiniMapReduceCluster();
}
项目:ditb    文件:TestThriftHBaseServiceHandlerWithLabels.java   
@BeforeClass
public static void beforeClass() throws Exception {
  SUPERUSER = User.createUserForTesting(conf, "admin",
      new String[] { "supergroup" });
  conf = UTIL.getConfiguration();
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS,
      SimpleScanLabelGenerator.class, ScanLabelGenerator.class);
  conf.set("hbase.superuser", SUPERUSER.getShortName());
  conf.set("hbase.coprocessor.master.classes",
      VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes",
      VisibilityController.class.getName());
  conf.setInt("hfile.format.version", 3);
  UTIL.startMiniCluster(1);
  // Wait for the labels table to become available
  UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  Admin admin = new HBaseAdmin(UTIL.getConfiguration());
  HTableDescriptor tableDescriptor = new HTableDescriptor(
      TableName.valueOf(tableAname));
  for (HColumnDescriptor family : families) {
    tableDescriptor.addFamily(family);
  }
  admin.createTable(tableDescriptor);
  admin.close();
  setAuths();
}
项目:ditb    文件:TestScannersWithLabels.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  SUPERUSER = User.createUserForTesting(conf, "admin",
      new String[] { "supergroup" });
  conf = TEST_UTIL.getConfiguration();
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS,
      SimpleScanLabelGenerator.class, ScanLabelGenerator.class);
  conf.setInt("hfile.format.version", 3);
  conf.set("hbase.superuser", SUPERUSER.getShortName());
  conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
  TEST_UTIL.startMiniCluster(1);
  // Wait for the labels table to become available
  TEST_UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  setAuths();
  REST_TEST_UTIL.startServletContainer(conf);
  client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort()));
  context = JAXBContext.newInstance(CellModel.class, CellSetModel.class, RowModel.class,
      ScannerModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  Admin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  insertData(TABLE, COLUMN_1, 1.0);
  insertData(TABLE, COLUMN_2, 0.5);
}
项目:Gaffer    文件:MiniHBaseStore.java   
private Configuration setupConf() throws IOException {
    final Configuration conf = HBaseConfiguration.create();
    VisibilityTestUtil.enableVisiblityLabels(conf);
    conf.set(Superusers.SUPERUSER_CONF_KEY, ADMIN_USERNAME);
    conf.setInt(HFile.FORMAT_VERSION_KEY, HFile.MIN_FORMAT_VERSION_WITH_TAGS);
    conf.set(JTConfig.JT_IPC_ADDRESS, JTConfig.LOCAL_FRAMEWORK_NAME);
    conf.set(CommonConfigurationKeysPublic.FS_DEFAULT_NAME_KEY, CommonConfigurationKeysPublic.FS_DEFAULT_NAME_DEFAULT);
    conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS, SimpleScanLabelGenerator.class,
            ScanLabelGenerator.class);
    conf.set(HConstants.REPLICATION_CODEC_CONF_KEY, KeyValueCodecWithTags.class.getName());
    return conf;
}
项目:HIndex    文件:TestScannersWithLabels.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  SUPERUSER = User.createUserForTesting(conf, "admin",
      new String[] { "supergroup" });
  conf = TEST_UTIL.getConfiguration();
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS,
      SimpleScanLabelGenerator.class, ScanLabelGenerator.class);
  conf.setInt("hfile.format.version", 3);
  conf.set("hbase.superuser", SUPERUSER.getShortName());
  conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
  TEST_UTIL.startMiniCluster(1);
  // Wait for the labels table to become available
  TEST_UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  setAuths();
  REST_TEST_UTIL.startServletContainer(conf);
  client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort()));
  context = JAXBContext.newInstance(CellModel.class, CellSetModel.class, RowModel.class,
      ScannerModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  insertData(TABLE, COLUMN_1, 1.0);
  insertData(TABLE, COLUMN_2, 0.5);
}
项目:hbase    文件:TestImportTSVWithVisibilityLabels.java   
@BeforeClass
public static void provisionCluster() throws Exception {
  conf = util.getConfiguration();
  SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" });
  conf.set("hbase.superuser", "admin,"+User.getCurrent().getName());
  VisibilityTestUtil.enableVisiblityLabels(conf);
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS, SimpleScanLabelGenerator.class,
      ScanLabelGenerator.class);
  util.startMiniCluster();
  // Wait for the labels table to become available
  util.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
}
项目:hbase    文件:TestScannersWithLabels.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  SUPERUSER = User.createUserForTesting(conf, "admin",
      new String[] { "supergroup" });
  conf = TEST_UTIL.getConfiguration();
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS,
      SimpleScanLabelGenerator.class, ScanLabelGenerator.class);
  conf.set("hbase.superuser", SUPERUSER.getShortName());
  VisibilityTestUtil.enableVisiblityLabels(conf);
  TEST_UTIL.startMiniCluster(1);
  // Wait for the labels table to become available
  TEST_UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  setAuths();
  REST_TEST_UTIL.startServletContainer(conf);
  client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort()));
  context = JAXBContext.newInstance(CellModel.class, CellSetModel.class, RowModel.class,
      ScannerModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  Admin admin = TEST_UTIL.getAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TABLE);
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  insertData(TABLE, COLUMN_1, 1.0);
  insertData(TABLE, COLUMN_2, 0.5);
}
项目:PyroDB    文件:TestScannersWithLabels.java   
@BeforeClass
public static void setUpBeforeClass() throws Exception {
  SUPERUSER = User.createUserForTesting(conf, "admin",
      new String[] { "supergroup" });
  conf = TEST_UTIL.getConfiguration();
  conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS,
      SimpleScanLabelGenerator.class, ScanLabelGenerator.class);
  conf.setInt("hfile.format.version", 3);
  conf.set("hbase.superuser", SUPERUSER.getShortName());
  conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
  conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
  TEST_UTIL.startMiniCluster(1);
  // Wait for the labels table to become available
  TEST_UTIL.waitTableEnabled(VisibilityConstants.LABELS_TABLE_NAME.getName(), 50000);
  createLabels();
  setAuths();
  REST_TEST_UTIL.startServletContainer(conf);
  client = new Client(new Cluster().add("localhost", REST_TEST_UTIL.getServletPort()));
  context = JAXBContext.newInstance(CellModel.class, CellSetModel.class, RowModel.class,
      ScannerModel.class);
  marshaller = context.createMarshaller();
  unmarshaller = context.createUnmarshaller();
  HBaseAdmin admin = TEST_UTIL.getHBaseAdmin();
  if (admin.tableExists(TABLE)) {
    return;
  }
  HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(TABLE));
  htd.addFamily(new HColumnDescriptor(CFA));
  htd.addFamily(new HColumnDescriptor(CFB));
  admin.createTable(htd);
  insertData(TABLE, COLUMN_1, 1.0);
  insertData(TABLE, COLUMN_2, 0.5);
}