2016-10-14 20:39:59 +03:00
|
|
|
/*
|
2017-01-21 09:02:33 +03:00
|
|
|
* Copyright (c) 2016-present, Facebook, Inc.
|
2016-10-14 20:39:59 +03:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
2018-05-25 23:47:49 +03:00
|
|
|
#include <vector>
|
2016-10-14 20:39:59 +03:00
|
|
|
|
2016-12-14 05:11:05 +03:00
|
|
|
namespace folly {
|
|
|
|
template <typename T>
|
|
|
|
class Future;
|
2018-05-25 23:47:49 +03:00
|
|
|
struct Unit;
|
2018-10-02 20:01:06 +03:00
|
|
|
} // namespace folly
|
2016-12-14 05:11:05 +03:00
|
|
|
|
2016-10-14 20:39:59 +03:00
|
|
|
namespace facebook {
|
|
|
|
namespace eden {
|
|
|
|
|
|
|
|
class Blob;
|
2016-12-14 05:11:05 +03:00
|
|
|
class BlobMetadata;
|
2016-10-14 20:39:59 +03:00
|
|
|
class Hash;
|
|
|
|
class Tree;
|
|
|
|
|
|
|
|
class IObjectStore {
|
|
|
|
public:
|
|
|
|
virtual ~IObjectStore() {}
|
|
|
|
|
2016-12-14 05:11:05 +03:00
|
|
|
/*
|
2017-06-22 03:05:55 +03:00
|
|
|
* Object access APIs.
|
2016-12-14 05:11:05 +03:00
|
|
|
*/
|
2017-09-30 02:43:01 +03:00
|
|
|
virtual folly::Future<std::shared_ptr<const Tree>> getTree(
|
2016-12-14 05:11:05 +03:00
|
|
|
const Hash& id) const = 0;
|
2017-09-30 02:43:01 +03:00
|
|
|
virtual folly::Future<std::shared_ptr<const Blob>> getBlob(
|
2016-12-14 05:11:05 +03:00
|
|
|
const Hash& id) const = 0;
|
2017-09-30 02:43:01 +03:00
|
|
|
virtual folly::Future<std::shared_ptr<const Tree>> getTreeForCommit(
|
2016-12-14 05:11:05 +03:00
|
|
|
const Hash& commitID) const = 0;
|
|
|
|
virtual folly::Future<BlobMetadata> getBlobMetadata(const Hash& id) const = 0;
|
2018-05-25 23:47:49 +03:00
|
|
|
virtual folly::Future<folly::Unit> prefetchBlobs(
|
|
|
|
const std::vector<Hash>& ids) const = 0;
|
2016-10-14 20:39:59 +03:00
|
|
|
};
|
2017-11-04 01:58:04 +03:00
|
|
|
} // namespace eden
|
|
|
|
} // namespace facebook
|