本文整理汇总了Java中org.apache.hadoop.hdfs.util.PersistentLongFile.readFile方法的典型用法代码示例。如果您正苦于以下问题:Java PersistentLongFile.readFile方法的具体用法?Java PersistentLongFile.readFile怎么用?Java PersistentLongFile.readFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hdfs.util.PersistentLongFile
的用法示例。
在下文中一共展示了PersistentLongFile.readFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readTransactionIdFile
import org.apache.hadoop.hdfs.util.PersistentLongFile; //导入方法依赖的package包/类
/**
* Determine the last transaction ID noted in this storage directory.
* This txid is stored in a special seen_txid file since it might not
* correspond to the latest image or edit log. For example, an image-only
* directory will have this txid incremented when edits logs roll, even
* though the edits logs are in a different directory.
*
* @param sd StorageDirectory to check
* @return If file exists and can be read, last recorded txid. If not, 0L.
* @throws IOException On errors processing file pointed to by sd
*/
static long readTransactionIdFile(StorageDirectory sd) throws IOException {
File txidFile = getStorageFile(sd, NameNodeFile.SEEN_TXID);
return PersistentLongFile.readFile(txidFile, 0);
}