本文整理汇总了Java中org.apache.hadoop.hbase.TableInfoMissingException类的典型用法代码示例。如果您正苦于以下问题:Java TableInfoMissingException类的具体用法?Java TableInfoMissingException怎么用?Java TableInfoMissingException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableInfoMissingException类属于org.apache.hadoop.hbase包,在下文中一共展示了TableInfoMissingException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTableDescriptorFromFs
import org.apache.hadoop.hbase.TableInfoMissingException; //导入依赖的package包/类
/**
* Returns the latest table descriptor for the table located at the given directory
* directly from the file system if it exists.
* @throws TableInfoMissingException if there is no descriptor
*/
public static HTableDescriptor getTableDescriptorFromFs(FileSystem fs, Path tableDir)
throws IOException {
FileStatus status = getTableInfoPath(fs, tableDir);
if (status == null) {
throw new TableInfoMissingException("No table descriptor file under " + tableDir);
}
FSDataInputStream fsDataInputStream = fs.open(status.getPath());
HTableDescriptor hTableDescriptor = null;
try {
hTableDescriptor = new HTableDescriptor();
hTableDescriptor.readFields(fsDataInputStream);
} finally {
fsDataInputStream.close();
}
return hTableDescriptor;
}
示例2: getTableDescriptorModtime
import org.apache.hadoop.hbase.TableInfoMissingException; //导入依赖的package包/类
static TableDescriptorModtime getTableDescriptorModtime(FileSystem fs, Path tableDir)
throws NullPointerException, IOException {
if (tableDir == null) throw new NullPointerException();
FileStatus status = getTableInfoPath(fs, tableDir);
if (status == null) {
throw new TableInfoMissingException("No .tableinfo file under "
+ tableDir.toUri());
}
FSDataInputStream fsDataInputStream = fs.open(status.getPath());
HTableDescriptor hTableDescriptor = null;
try {
hTableDescriptor = new HTableDescriptor();
hTableDescriptor.readFields(fsDataInputStream);
} finally {
fsDataInputStream.close();
}
return new TableDescriptorModtime(status.getModificationTime(), hTableDescriptor);
}
示例3: getTableDescriptorFromFs
import org.apache.hadoop.hbase.TableInfoMissingException; //导入依赖的package包/类
/**
* Returns the latest table descriptor for the table located at the given directory
* directly from the file system if it exists.
* @throws TableInfoMissingException if there is no descriptor
*/
public static HTableDescriptor getTableDescriptorFromFs(FileSystem fs, Path tableDir,
boolean rewritePb)
throws IOException {
FileStatus status = getTableInfoPath(fs, tableDir, false);
if (status == null) {
throw new TableInfoMissingException("No table descriptor file under " + tableDir);
}
return readTableDescriptor(fs, status, rewritePb);
}
示例4: getTableDescriptorFromFs
import org.apache.hadoop.hbase.TableInfoMissingException; //导入依赖的package包/类
/**
* Returns the latest table descriptor for the table located at the given directory
* directly from the file system if it exists.
* @throws TableInfoMissingException if there is no descriptor
*/
public static HTableDescriptor getTableDescriptorFromFs(FileSystem fs, Path tableDir)
throws IOException {
FileStatus status = getTableInfoPath(fs, tableDir, false);
if (status == null) {
throw new TableInfoMissingException("No table descriptor file under " + tableDir);
}
return readTableDescriptor(fs, status, false);
}
示例5: getTableDescriptorFromFs
import org.apache.hadoop.hbase.TableInfoMissingException; //导入依赖的package包/类
/**
* Returns the latest table descriptor for the table located at the given directory
* directly from the file system if it exists.
* @throws TableInfoMissingException if there is no descriptor
*/
public static TableDescriptor getTableDescriptorFromFs(FileSystem fs, Path tableDir)
throws IOException {
FileStatus status = getTableInfoPath(fs, tableDir, false);
if (status == null) {
throw new TableInfoMissingException("No table descriptor file under " + tableDir);
}
return readTableDescriptor(fs, status);
}
示例6: getTableDescriptorModtime
import org.apache.hadoop.hbase.TableInfoMissingException; //导入依赖的package包/类
static TableDescriptorModtime getTableDescriptorModtime(FileSystem fs, Path tableDir)
throws NullPointerException, IOException {
if (tableDir == null) throw new NullPointerException();
FileStatus status = getTableInfoPath(fs, tableDir);
if (status == null) {
throw new TableInfoMissingException("No .tableinfo file under "
+ tableDir.toUri());
}
int len = Ints.checkedCast(status.getLen());
byte [] content = new byte[len];
FSDataInputStream fsDataInputStream = fs.open(status.getPath());
try {
fsDataInputStream.readFully(content);
} finally {
fsDataInputStream.close();
}
HTableDescriptor htd = null;
try {
htd = HTableDescriptor.parseFrom(content);
} catch (DeserializationException e) {
throw new IOException("content=" + Bytes.toShort(content), e);
}
if (!ProtobufUtil.isPBMagicPrefix(content)) {
// Convert the file over to be pb before leaving here.
createTableDescriptor(fs, tableDir.getParent(), htd, true);
}
return new TableDescriptorModtime(status.getModificationTime(), htd);
}