use of org.apache.hadoop.hbase.master.MasterFileSystem in project hbase by apache.
the class TestHColumnDescriptorDefaultVersions method verifyHColumnDescriptor.
private void verifyHColumnDescriptor(int expected, final TableName tableName, final byte[]... families) throws IOException {
Admin admin = TEST_UTIL.getAdmin();
// Verify descriptor from master
HTableDescriptor htd = admin.getTableDescriptor(tableName);
HColumnDescriptor[] hcds = htd.getColumnFamilies();
verifyHColumnDescriptor(expected, hcds, tableName, families);
// Verify descriptor from HDFS
MasterFileSystem mfs = TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterFileSystem();
Path tableDir = FSUtils.getTableDir(mfs.getRootDir(), tableName);
HTableDescriptor td = FSTableDescriptors.getTableDescriptorFromFs(mfs.getFileSystem(), tableDir);
hcds = td.getColumnFamilies();
verifyHColumnDescriptor(expected, hcds, tableName, families);
}
use of org.apache.hadoop.hbase.master.MasterFileSystem in project hbase by apache.
the class TestAsyncTableAdminApi method verifyTableDescriptor.
private void verifyTableDescriptor(final TableName tableName, final byte[]... families) throws IOException {
Admin admin = TEST_UTIL.getAdmin();
// Verify descriptor from master
HTableDescriptor htd = admin.getTableDescriptor(tableName);
verifyTableDescriptor(htd, tableName, families);
// Verify descriptor from HDFS
MasterFileSystem mfs = TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterFileSystem();
Path tableDir = FSUtils.getTableDir(mfs.getRootDir(), tableName);
HTableDescriptor td = FSTableDescriptors.getTableDescriptorFromFs(mfs.getFileSystem(), tableDir);
verifyTableDescriptor(td, tableName, families);
}
use of org.apache.hadoop.hbase.master.MasterFileSystem in project hbase by apache.
the class SnapshotTestingUtils method confirmSnapshotValid.
public static void confirmSnapshotValid(HBaseTestingUtility testUtil, HBaseProtos.SnapshotDescription snapshotDescriptor, TableName tableName, byte[] family) throws IOException {
MasterFileSystem mfs = testUtil.getHBaseCluster().getMaster().getMasterFileSystem();
confirmSnapshotValid(snapshotDescriptor, tableName, family, mfs.getRootDir(), testUtil.getAdmin(), mfs.getFileSystem());
}
use of org.apache.hadoop.hbase.master.MasterFileSystem in project hbase by apache.
the class TestTableDescriptorModificationFromClient method verifyTableDescriptor.
private void verifyTableDescriptor(final TableName tableName, final byte[]... families) throws IOException {
Admin admin = TEST_UTIL.getAdmin();
// Verify descriptor from master
HTableDescriptor htd = admin.getTableDescriptor(tableName);
verifyTableDescriptor(htd, tableName, families);
// Verify descriptor from HDFS
MasterFileSystem mfs = TEST_UTIL.getMiniHBaseCluster().getMaster().getMasterFileSystem();
Path tableDir = FSUtils.getTableDir(mfs.getRootDir(), tableName);
HTableDescriptor td = FSTableDescriptors.getTableDescriptorFromFs(mfs.getFileSystem(), tableDir);
verifyTableDescriptor(td, tableName, families);
}
use of org.apache.hadoop.hbase.master.MasterFileSystem in project hbase by apache.
the class SplitTableRegionProcedure method createDaughterRegions.
/**
* Create daughter regions
* @param env MasterProcedureEnv
* @throws IOException
*/
@VisibleForTesting
public void createDaughterRegions(final MasterProcedureEnv env) throws IOException {
final MasterFileSystem mfs = env.getMasterServices().getMasterFileSystem();
final Path tabledir = FSUtils.getTableDir(mfs.getRootDir(), parentHRI.getTable());
final FileSystem fs = mfs.getFileSystem();
HRegionFileSystem regionFs = HRegionFileSystem.openRegionFromFileSystem(env.getMasterConfiguration(), fs, tabledir, parentHRI, false);
regionFs.createSplitsDir();
Pair<Integer, Integer> expectedReferences = splitStoreFiles(env, regionFs);
assertReferenceFileCount(fs, expectedReferences.getFirst(), regionFs.getSplitsDir(daughter_1_HRI));
//Move the files from the temporary .splits to the final /table/region directory
regionFs.commitDaughterRegion(daughter_1_HRI);
assertReferenceFileCount(fs, expectedReferences.getFirst(), new Path(tabledir, daughter_1_HRI.getEncodedName()));
assertReferenceFileCount(fs, expectedReferences.getSecond(), regionFs.getSplitsDir(daughter_2_HRI));
regionFs.commitDaughterRegion(daughter_2_HRI);
assertReferenceFileCount(fs, expectedReferences.getSecond(), new Path(tabledir, daughter_2_HRI.getEncodedName()));
}
Aggregations