Search in sources :

Example 1 with LocalSnapshotPbMeta

use of com.alipay.sofa.jraft.entity.LocalStorageOutter.LocalSnapshotPbMeta in project sofa-jraft by sofastack.

the class LocalSnapshotMetaTable method loadFromFile.

/**
 * Load metadata infos from a file by path.
 */
public boolean loadFromFile(String path) throws IOException {
    ProtoBufFile pbFile = new ProtoBufFile(path);
    LocalSnapshotPbMeta pbMeta = pbFile.load();
    if (pbMeta == null) {
        LOG.error("Fail to load meta from {}.", path);
        return false;
    }
    return loadFromPbMeta(pbMeta);
}
Also used : LocalSnapshotPbMeta(com.alipay.sofa.jraft.entity.LocalStorageOutter.LocalSnapshotPbMeta) ProtoBufFile(com.alipay.sofa.jraft.storage.io.ProtoBufFile)

Aggregations

LocalSnapshotPbMeta (com.alipay.sofa.jraft.entity.LocalStorageOutter.LocalSnapshotPbMeta)1 ProtoBufFile (com.alipay.sofa.jraft.storage.io.ProtoBufFile)1