mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
ae684f3993
Summary: This is fairly mechanical diff that finalizes split of Hash into ObjectId and Hash20. More specifically this diff does two things: * Replaces `Hash` with `Hash20` * Removes alias `using Hash = Hash20` Reviewed By: chadaustin Differential Revision: D31324202 fbshipit-source-id: 780b6d2a422ddf6d0f3cfc91e3e70ad10ebaa8b4
66 lines
1.5 KiB
C++
66 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <vector>
|
|
|
|
#include <folly/portability/SysTypes.h>
|
|
#include "eden/fs/model/RootId.h"
|
|
#include "eden/fs/store/ImportPriority.h"
|
|
|
|
namespace folly {
|
|
template <typename T>
|
|
class Future;
|
|
struct Unit;
|
|
} // namespace folly
|
|
|
|
namespace facebook::eden {
|
|
|
|
class Blob;
|
|
class BlobMetadata;
|
|
class ObjectId;
|
|
class Hash20;
|
|
class Tree;
|
|
class ObjectFetchContext;
|
|
|
|
class IObjectStore {
|
|
public:
|
|
virtual ~IObjectStore() {}
|
|
|
|
/*
|
|
* Object access APIs.
|
|
*
|
|
* The given ObjectFetchContext must remain valid at least until the
|
|
* resulting future is complete.
|
|
*/
|
|
|
|
virtual folly::Future<std::shared_ptr<const Tree>> getRootTree(
|
|
const RootId& rootId,
|
|
ObjectFetchContext& context) const = 0;
|
|
virtual folly::Future<std::shared_ptr<const Tree>> getTree(
|
|
const ObjectId& id,
|
|
ObjectFetchContext& context) const = 0;
|
|
virtual folly::Future<std::shared_ptr<const Blob>> getBlob(
|
|
const ObjectId& id,
|
|
ObjectFetchContext& context) const = 0;
|
|
|
|
/**
|
|
* Prefetch all the blobs represented by the HashRange.
|
|
*
|
|
* The caller is responsible for making sure that the HashRange stays valid
|
|
* for as long as the returned SemiFuture.
|
|
*/
|
|
virtual folly::Future<folly::Unit> prefetchBlobs(
|
|
ObjectIdRange ids,
|
|
ObjectFetchContext& context) const = 0;
|
|
};
|
|
|
|
} // namespace facebook::eden
|