Commit 93bf2bfd authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Make ObjectPool an object

Making a difference between a 'normal' repository and an object pool
repository helps us leverage the type systems of Go, and less so but
still a bit, of Ruby.

Proposed in: gitaly!966 (comment 119137498)
parent 67797256
......@@ -108,6 +108,7 @@ It has these top-level messages:
RenameNamespaceResponse
PostReceiveRequest
PostReceiveResponse
ObjectPool
CreateObjectPoolRequest
CreateObjectPoolResponse
DeleteObjectPoolRequest
......
This diff is collapsed.
......@@ -13,29 +13,34 @@ service ObjectPoolService {
rpc UnlinkRepositoryFromObjectPool(UnlinkRepositoryFromObjectPoolRequest) returns (UnlinkRepositoryFromObjectPoolResponse) {}
}
message ObjectPool {
Repository repository = 1;
}
// Creates an object pool from the repository. The client is responsible for
// joining this pool later with this repository.
message CreateObjectPoolRequest {
Repository object_pool = 1;
ObjectPool object_pool = 1;
Repository origin = 2;
}
message CreateObjectPoolResponse {}
// Removes the directory from disk, callee is responsible for leaving the object
// Removes the directory from disk, caller is responsible for leaving the object
// pool before calling this RPC
message DeleteObjectPoolRequest {
Repository object_pool = 1;
ObjectPool object_pool = 1;
}
message DeleteObjectPoolResponse {}
message LinkRepositoryToObjectPoolRequest {
Repository object_pool = 1;
ObjectPool object_pool = 1;
Repository repository = 2;
}
message LinkRepositoryToObjectPoolResponse {}
// This RPC doesn't require the ObjectPool as it will remove the alternates file
// from the pool participant. The caller is responsible no data loss occurs.
message UnlinkRepositoryFromObjectPoolRequest {
Repository object_pool = 1;
Repository repository = 2;
Repository repository = 1;
}
message UnlinkRepositoryFromObjectPoolResponse {}
......@@ -5,32 +5,35 @@ require 'google/protobuf'
require 'shared_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "gitaly.ObjectPool" do
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.CreateObjectPoolRequest" do
optional :object_pool, :message, 1, "gitaly.Repository"
optional :object_pool, :message, 1, "gitaly.ObjectPool"
optional :origin, :message, 2, "gitaly.Repository"
end
add_message "gitaly.CreateObjectPoolResponse" do
end
add_message "gitaly.DeleteObjectPoolRequest" do
optional :object_pool, :message, 1, "gitaly.Repository"
optional :object_pool, :message, 1, "gitaly.ObjectPool"
end
add_message "gitaly.DeleteObjectPoolResponse" do
end
add_message "gitaly.LinkRepositoryToObjectPoolRequest" do
optional :object_pool, :message, 1, "gitaly.Repository"
optional :object_pool, :message, 1, "gitaly.ObjectPool"
optional :repository, :message, 2, "gitaly.Repository"
end
add_message "gitaly.LinkRepositoryToObjectPoolResponse" do
end
add_message "gitaly.UnlinkRepositoryFromObjectPoolRequest" do
optional :object_pool, :message, 1, "gitaly.Repository"
optional :repository, :message, 2, "gitaly.Repository"
optional :repository, :message, 1, "gitaly.Repository"
end
add_message "gitaly.UnlinkRepositoryFromObjectPoolResponse" do
end
end
module Gitaly
ObjectPool = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ObjectPool").msgclass
CreateObjectPoolRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CreateObjectPoolRequest").msgclass
CreateObjectPoolResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.CreateObjectPoolResponse").msgclass
DeleteObjectPoolRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.DeleteObjectPoolRequest").msgclass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment