Imported Upstream version 1.5.1
This commit is contained in:
57
interface/Makefile
Normal file
57
interface/Makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
PROTOC=../cpp/thirdparty/protobuf-2.5.0/src/protoc
|
||||
BASE_DIR=$(shell pwd)
|
||||
INCLUDE_DIR=include/
|
||||
PROTOBUF_INCLUDE=../cpp/thirdparty/protobuf-2.5.0/src
|
||||
|
||||
PBRPC_PLUGIN=../bin/protoc-gen-pbrpc
|
||||
PBRPCCPP_PLUGIN=../bin/protoc-gen-pbrpccpp
|
||||
|
||||
TARGET_DIR_JAVA_FOUNDATION=../java/foundation/src/
|
||||
GENERATED_DIR_JAVA_FOUNDATION=$(TARGET_DIR_JAVA_FOUNDATION)org/xtreemfs/foundation/pbrpc/generatedinterfaces/
|
||||
|
||||
TARGET_DIR_JAVA_PBRPCGEN=../java/pbrpcgen/src/
|
||||
GENERATED_DIR_JAVA_PBRPCGEN=$(TARGET_DIR_JAVA_PBRPCGEN)org/xtreemfs/foundation/pbrpc/generatedinterfaces/
|
||||
|
||||
TARGET_DIR_JAVA_SERVERS=../java/servers/src/
|
||||
GENERATED_DIR_JAVA_SERVERS=$(TARGET_DIR_JAVA_SERVERS)org/xtreemfs/pbrpc/generatedinterfaces/
|
||||
|
||||
TARGET_DIR_CPP_CLIENT=../cpp/generated/
|
||||
TARGET_DIR_H_CLIENT=../client/include/generated/
|
||||
|
||||
|
||||
PROTOS_FOUNDATION=$(wildcard pbrpc/*.proto) include/PBRPC.proto
|
||||
PROTOS_SERVERS=$(wildcard xtreemfs/*.proto) include/Common.proto
|
||||
|
||||
.PHONY: foundation_clean pbrpcgen_clean servers_clean
|
||||
|
||||
all: cpp servers foundation
|
||||
|
||||
cpp:
|
||||
$(PROTOC) -I$(PROTOBUF_INCLUDE) -I. -I$(@D)/pbrpc/ $(PROTOS_FOUNDATION) --cpp_out=$(TARGET_DIR_CPP_CLIENT)
|
||||
|
||||
$(PROTOC) include/Common.proto --cpp_out=$(TARGET_DIR_CPP_CLIENT)
|
||||
$(PROTOC) -I$(PROTOBUF_INCLUDE) -I. -I$(@D)/xtreemfs/ $(PROTOS_SERVERS) --cpp_out=$(TARGET_DIR_CPP_CLIENT)
|
||||
$(PROTOC) --plugin=$(PBRPCCPP_PLUGIN) -I$(PROTOBUF_INCLUDE) -I. -I$(@D)/xtreemfs/ $(PROTOS_SERVERS) --pbrpccpp_out=$(TARGET_DIR_CPP_CLIENT)
|
||||
$(PROTOC) --plugin=$(PBRPCCPP_PLUGIN) -I$(PROTOBUF_INCLUDE) -I. -I$(@D)/pbrpc/ $(PROTOS_FOUNDATION) --pbrpccpp_out=$(TARGET_DIR_CPP_CLIENT)
|
||||
|
||||
|
||||
servers:
|
||||
$(PROTOC) include/Common.proto --java_out=$(TARGET_DIR_JAVA_SERVERS)
|
||||
$(PROTOC) -I$(PROTOBUF_INCLUDE) -I. -I$(@D)/xtreemfs/ $(PROTOS_SERVERS) --java_out=$(TARGET_DIR_JAVA_SERVERS)
|
||||
$(PROTOC) --plugin=$(PBRPC_PLUGIN) -I$(PROTOBUF_INCLUDE) -I. -I$(@D)/xtreemfs/ $(PROTOS_SERVERS) --pbrpc_out=$(TARGET_DIR_JAVA_SERVERS)
|
||||
|
||||
servers_clean:
|
||||
@rm -r $(GENERATED_DIR_JAVA_SERVERS)*.java
|
||||
|
||||
foundation: pbrpc/*.proto
|
||||
$(PROTOC) -I$(PROTOBUF_INCLUDE) -I. -I$(@D)/pbrpc/ $(PROTOS_FOUNDATION) --java_out=$(TARGET_DIR_JAVA_FOUNDATION)
|
||||
$(PROTOC) --plugin=$(PBRPC_PLUGIN) -I$(PROTOBUF_INCLUDE) -I. -I$(@D)/pbrpc/ $(PROTOS_FOUNDATION) --pbrpc_out=$(TARGET_DIR_JAVA_FOUNDATION)
|
||||
|
||||
foundation_clean:
|
||||
@rm -r $(GENERATED_DIR_JAVA_FOUNDATION)*.java
|
||||
|
||||
pbrpcgen: include/PBRPC.proto
|
||||
$(PROTOC) -I$(PROTOBUF_INCLUDE) -Iinclude/ $< --java_out=$(TARGET_DIR_JAVA_PBRPCGEN)
|
||||
|
||||
pbrpcgen_clean:
|
||||
@rm -r $(GENERATED_DIR_JAVA_PBRPCGEN)*.java
|
||||
44
interface/include/Common.proto
Normal file
44
interface/include/Common.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Copyright (c) 2009-2011, Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// Neither the name of the Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
// nor the names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// AUTHORS: Bjoern Kolbeck (ZIB)
|
||||
//
|
||||
|
||||
option java_package="org.xtreemfs.pbrpc.generatedinterfaces";
|
||||
package xtreemfs.pbrpc;
|
||||
|
||||
// Dummy message for requests without parameters.
|
||||
// The RPC implementation sends an empty message block.
|
||||
message emptyRequest {
|
||||
}
|
||||
|
||||
// Dummy message for responses without content.
|
||||
// The RPC implementation sends an empty message block.
|
||||
message emptyResponse {
|
||||
}
|
||||
49
interface/include/PBRPC.proto
Normal file
49
interface/include/PBRPC.proto
Normal file
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// Copyright (c) 2009-2011, Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// Neither the name of the Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
// nor the names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// AUTHORS: Bjoern Kolbeck (ZIB)
|
||||
//
|
||||
|
||||
|
||||
option java_package="org.xtreemfs.foundation.pbrpc.generatedinterfaces";
|
||||
package xtreemfs.pbrpc;
|
||||
import "google/protobuf/descriptor.proto";
|
||||
|
||||
// Ids used by the protoc for the PBRPC specific options.
|
||||
// data_in/out signals that a method can take raw data as input or produces
|
||||
// raw data as output.
|
||||
extend google.protobuf.MethodOptions {
|
||||
optional fixed32 proc_id = 50001;
|
||||
optional bool data_in = 50004;
|
||||
optional bool data_out = 50003;
|
||||
}
|
||||
|
||||
extend google.protobuf.ServiceOptions {
|
||||
optional fixed32 interface_id = 50002;
|
||||
}
|
||||
77
interface/pbrpc/Ping.proto
Normal file
77
interface/pbrpc/Ping.proto
Normal file
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// Copyright (c) 2009-2011, Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// Neither the name of the Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
// nor the names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// AUTHORS: Bjoern Kolbeck (ZIB)
|
||||
//
|
||||
|
||||
// Simple ping-pong RPCs for testing.
|
||||
|
||||
option java_package="org.xtreemfs.foundation.pbrpc.generatedinterfaces";
|
||||
package xtreemfs.pbrpc;
|
||||
import "include/PBRPC.proto";
|
||||
|
||||
message PingRequest{
|
||||
required string text = 1;
|
||||
required bool sendError = 2;
|
||||
}
|
||||
|
||||
message PingResponse {
|
||||
|
||||
message PingResult {
|
||||
required string text = 1;
|
||||
}
|
||||
|
||||
message PingError {
|
||||
required string errorMessage = 1;
|
||||
}
|
||||
|
||||
optional PingResult result = 1;
|
||||
optional PingError error = 2;
|
||||
}
|
||||
|
||||
message Ping_emptyRequest {
|
||||
}
|
||||
|
||||
message Ping_emptyResponse {
|
||||
}
|
||||
|
||||
|
||||
service PingService {
|
||||
option(interface_id)=1;
|
||||
|
||||
rpc doPing(PingRequest) returns(PingResponse) {
|
||||
option(proc_id)=1;
|
||||
option(data_in)=true;
|
||||
};
|
||||
rpc emptyPing(Ping_emptyRequest) returns(Ping_emptyResponse) {
|
||||
option(proc_id)=2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
167
interface/pbrpc/RPC.proto
Normal file
167
interface/pbrpc/RPC.proto
Normal file
@@ -0,0 +1,167 @@
|
||||
//
|
||||
// Copyright (c) 2009-2011, Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// Neither the name of the Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
// nor the names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// AUTHORS: Bjoern Kolbeck (ZIB)
|
||||
//
|
||||
|
||||
// Header for RPC protocol.
|
||||
|
||||
option java_package="org.xtreemfs.foundation.pbrpc.generatedinterfaces";
|
||||
package xtreemfs.pbrpc;
|
||||
|
||||
// Encodes the type of the RPC message sent.
|
||||
enum MessageType {
|
||||
// RPC request to execute method.
|
||||
RPC_REQUEST = 0;
|
||||
// RPC response after successful execution of method.
|
||||
RPC_RESPONSE_SUCCESS = 1;
|
||||
// RPC response when execution of a method failed, including POSIX errors.
|
||||
RPC_RESPONSE_ERROR = 2;
|
||||
}
|
||||
|
||||
// Authentication type provided for request.
|
||||
enum AuthType {
|
||||
// No authentication.
|
||||
AUTH_NONE = 0;
|
||||
// Plain text admin password authentication.
|
||||
AUTH_PASSWORD = 1;
|
||||
}
|
||||
|
||||
// File system user credentials for executing an operation.
|
||||
// Might be ignored by some operations.
|
||||
message UserCredentials {
|
||||
// Globally unique user ID (GUID).
|
||||
required string username = 1;
|
||||
// List of one or more globally unique group IDs (GGID).
|
||||
repeated string groups = 2;
|
||||
}
|
||||
|
||||
// Admin password if AuthType AUTH_PASSWORD.
|
||||
message AuthPassword {
|
||||
required string password = 1;
|
||||
}
|
||||
|
||||
// RPC Authentication information.
|
||||
message Auth {
|
||||
// Selected authentication type.
|
||||
required AuthType auth_type = 1;
|
||||
// Optional data, depends on auth_type selected.
|
||||
optional AuthPassword auth_passwd = 3;
|
||||
optional bytes auth_data = 2;
|
||||
}
|
||||
|
||||
// Error types.
|
||||
enum ErrorType {
|
||||
// Requested interface_id not implemented by server.
|
||||
INVALID_INTERFACE_ID = 1;
|
||||
// Requested procedure_id not implemented by serevr.
|
||||
INVALID_PROC_ID = 2;
|
||||
// Server cannot parse the RPC request.
|
||||
GARBAGE_ARGS = 3;
|
||||
// Authentication failed, access denied.
|
||||
AUTH_FAILED = 4;
|
||||
// Unspecific internal server error that caused the RPC to fail.
|
||||
INTERNAL_SERVER_ERROR = 5;
|
||||
// POSIX errno error (not necessarily a failure), e.g. ENOENT.
|
||||
// POSIXErrno contains details that can be passed to an application.
|
||||
ERRNO = 6;
|
||||
// Server redirects to another server implementing the same interface.
|
||||
REDIRECT = 7;
|
||||
// Request failed, due to an invalid view (i.e. an outdated xlocset).
|
||||
INVALID_VIEW = 8;
|
||||
// Generic IO_ERROR to be used by the RPC implementation.
|
||||
IO_ERROR = 100;
|
||||
}
|
||||
|
||||
// Additional error code which can be passed to applications.
|
||||
// See errno.h for details. Values are equivalent to Linux
|
||||
// values, but are different for other unix platforms such as
|
||||
// Mac OS X and Solaris!
|
||||
enum POSIXErrno {
|
||||
POSIX_ERROR_NONE = 9999;
|
||||
POSIX_ERROR_EPERM = 1;
|
||||
POSIX_ERROR_ENOENT = 2;
|
||||
POSIX_ERROR_EINTR = 4;
|
||||
POSIX_ERROR_EIO = 5;
|
||||
POSIX_ERROR_EAGAIN = 11;
|
||||
POSIX_ERROR_EACCES = 13;
|
||||
POSIX_ERROR_EEXIST = 17;
|
||||
POSIX_ERROR_EXDEV = 18;
|
||||
POSIX_ERROR_ENODEV = 19;
|
||||
POSIX_ERROR_ENOTDIR = 20;
|
||||
POSIX_ERROR_EISDIR = 21;
|
||||
POSIX_ERROR_EINVAL = 22;
|
||||
POSIX_ERROR_ENOSPC = 28;
|
||||
POSIX_ERROR_ENOTEMPTY = 39;
|
||||
POSIX_ERROR_ENODATA = 61;
|
||||
}
|
||||
|
||||
// RPC header message sent in the first request fragment.
|
||||
message RPCHeader {
|
||||
|
||||
// Header data for requests, i.e. message_type is RPC_REQUEST.
|
||||
message RequestHeader {
|
||||
// Interface id of the requested method.
|
||||
required fixed32 interface_id = 1;
|
||||
// Procedure id of the requested method.
|
||||
required fixed32 proc_id = 2;
|
||||
// File system user credentials for the operation.
|
||||
required UserCredentials user_creds = 3;
|
||||
// Authentication details.
|
||||
required Auth auth_data = 4;
|
||||
}
|
||||
|
||||
// Header data for error responses, i.e. message_type is RPC_ERROR_RESPONSE.
|
||||
message ErrorResponse {
|
||||
// Error type details.
|
||||
required ErrorType error_type = 1;
|
||||
// Optional POSIX errno.
|
||||
optional POSIXErrno posix_errno = 2 [default = POSIX_ERROR_NONE];
|
||||
// Optional human readable error message in English (not localized!).
|
||||
optional string error_message = 3;
|
||||
// Optional debug information that only makes sense to developers such
|
||||
// as stack traces.
|
||||
optional string debug_info = 4;
|
||||
// Optional UUID of the server to use instead. Required when error_type is REDIRECT.
|
||||
optional string redirect_to_server_uuid = 5;
|
||||
}
|
||||
|
||||
// A unique id to identify the request. The response sent back by the server will have
|
||||
// the same call_id.
|
||||
// The call_id must be unqiue per TCP connection. In addition, clients should start
|
||||
// with a value based e.g. on time to avoid problems after a client restart.
|
||||
required fixed32 call_id = 1;
|
||||
// Type of this RPC message (Request, Response).
|
||||
required MessageType message_type = 2;
|
||||
|
||||
// Optional request_header, required if message_type is RPC_REQUEST.
|
||||
optional RequestHeader request_header = 3;
|
||||
// Optional error_response, required if message_type is RPC_ERROR_RESPONSE.
|
||||
optional ErrorResponse error_response = 4;
|
||||
}
|
||||
281
interface/xtreemfs/DIR.proto
Normal file
281
interface/xtreemfs/DIR.proto
Normal file
@@ -0,0 +1,281 @@
|
||||
//
|
||||
// Copyright (c) 2009-2011, Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// Neither the name of the Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
// nor the names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// AUTHORS: Bjoern Kolbeck (ZIB), Jan Stender (ZIB)
|
||||
//
|
||||
|
||||
option java_package="org.xtreemfs.pbrpc.generatedinterfaces";
|
||||
package xtreemfs.pbrpc;
|
||||
import "include/PBRPC.proto";
|
||||
import "include/Common.proto";
|
||||
import "xtreemfs/GlobalTypes.proto";
|
||||
|
||||
// For each server UUID, at least one address mapping must exist.
|
||||
// Each record maps a UUID to one FQDN or IP address and port.
|
||||
message AddressMapping {
|
||||
// UUID being mapped.
|
||||
required string uuid = 1;
|
||||
// Version of this record.
|
||||
required fixed64 version = 2;
|
||||
// Protocol, see org.xtreemfs.foundation.pbrpc.Schemes for values.
|
||||
required string protocol = 3;
|
||||
// FQDN or IP address of the server.
|
||||
required string address = 4;
|
||||
// TCP/UDP port number.
|
||||
required fixed32 port = 5;
|
||||
// Matching network. There has to exist exactly one default address
|
||||
// accessible from any network for which this is set to "*".
|
||||
required string match_network = 6;
|
||||
// Time to live in seconds before the
|
||||
// entry should be evicted from caches.
|
||||
required fixed32 ttl_s = 7;
|
||||
// URI, obsolete.
|
||||
required string uri = 8;
|
||||
}
|
||||
|
||||
// Set of mappings for a UUID.
|
||||
message AddressMappingSet {
|
||||
repeated AddressMapping mappings = 1;
|
||||
}
|
||||
|
||||
// DIR service address, used for auto discovery.
|
||||
message DirService {
|
||||
required string address = 1;
|
||||
required fixed32 port = 2;
|
||||
required string protocol = 3;
|
||||
required fixed32 interface_version = 4;
|
||||
}
|
||||
|
||||
// Key/Value pairs for a service.
|
||||
message ServiceDataMap {
|
||||
repeated KeyValuePair data = 1;
|
||||
}
|
||||
|
||||
enum ServiceType {
|
||||
// Returns a list of all service types.
|
||||
SERVICE_TYPE_MIXED = 0;
|
||||
SERVICE_TYPE_MRC = 1;
|
||||
SERVICE_TYPE_OSD = 2;
|
||||
SERVICE_TYPE_VOLUME = 3;
|
||||
SERVICE_TYPE_DIR = 4;
|
||||
}
|
||||
|
||||
enum ServiceStatus {
|
||||
// Service is available.
|
||||
SERVICE_STATUS_AVAIL = 0;
|
||||
// Service (OSD) will be removed, new files are
|
||||
// not allocated to this OSD.
|
||||
SERVICE_STATUS_TO_BE_REMOVED = 1;
|
||||
// Service was removed permanently, data is lost.
|
||||
SERVICE_STATUS_REMOVED = 2;
|
||||
}
|
||||
|
||||
// Service data in DIR.
|
||||
message Service {
|
||||
required ServiceType type = 1;
|
||||
// Service uuid, e.g. volume UUID.
|
||||
required string uuid = 2;
|
||||
// Version of this record, assigned by the DIR on write.
|
||||
required fixed64 version = 3;
|
||||
// Service name, e.g. volume name.
|
||||
required string name = 4;
|
||||
// Timestamp of last update in global XtreemFS time, assigned
|
||||
// by the DIR on write.
|
||||
required fixed64 last_updated_s = 5;
|
||||
// Service details including service state.
|
||||
required ServiceDataMap data = 6;
|
||||
}
|
||||
|
||||
message ServiceSet {
|
||||
repeated Service services = 1;
|
||||
}
|
||||
|
||||
// Service configuration stored in the DIR.
|
||||
message Configuration {
|
||||
// Service UUID.
|
||||
required string uuid = 1;
|
||||
// Configuration options.
|
||||
repeated KeyValuePair parameter = 2;
|
||||
// Version of this record, assigned by the DIR on write.
|
||||
required fixed64 version = 3;
|
||||
}
|
||||
|
||||
|
||||
message addressMappingGetRequest {
|
||||
// UUID of the service for which mapping should be returned.
|
||||
required string uuid = 1;
|
||||
}
|
||||
|
||||
message addressMappingGetResponse {
|
||||
// List of matching mappings, might be empty.
|
||||
optional AddressMappingSet result = 1;
|
||||
}
|
||||
|
||||
message addressMappingSetResponse {
|
||||
// New version number assigned to the address mapping
|
||||
// by the DIR.
|
||||
optional fixed64 new_version = 1;
|
||||
}
|
||||
|
||||
message globalTimeSGetResponse {
|
||||
// Global XtreemFS time in seconds.
|
||||
required fixed64 time_in_seconds = 1;
|
||||
}
|
||||
|
||||
message serviceDeregisterRequest {
|
||||
// UUID of the service that should be dregistered.
|
||||
required string uuid = 1;
|
||||
}
|
||||
|
||||
message serviceGetByNameRequest {
|
||||
// Service name to search for.
|
||||
required string name = 1;
|
||||
}
|
||||
|
||||
message serviceGetByUUIDRequest {
|
||||
// UUID to search for.
|
||||
required string name = 1;
|
||||
}
|
||||
|
||||
message serviceGetByTypeRequest {
|
||||
// Service types to search for.
|
||||
required ServiceType type = 1;
|
||||
}
|
||||
|
||||
message serviceRegisterRequest {
|
||||
// Service data to be registered.
|
||||
// Old data for the service with the same UUID is
|
||||
// overwritten.
|
||||
required Service service = 1;
|
||||
}
|
||||
|
||||
message serviceRegisterResponse {
|
||||
// New version assigned to the service record by the DIR.
|
||||
required fixed64 new_version = 1;
|
||||
}
|
||||
|
||||
message configurationGetRequest {
|
||||
// UUID of the servic for which the configuration is requested.
|
||||
required string uuid = 1;
|
||||
}
|
||||
|
||||
message configurationSetResponse {
|
||||
// New version assigned to the configuration record by the DIR.
|
||||
optional fixed64 new_version = 1;
|
||||
}
|
||||
|
||||
// Due to a name clash with "message DIRService", the former service
|
||||
// "DIRService" had to be renamed to another name, now "DirectoryService".
|
||||
// See http://code.google.com/p/xtreemfs/issues/detail?id=248 for more info.
|
||||
service DirectoryService {
|
||||
|
||||
option(interface_id)=10001;
|
||||
|
||||
// Returns the address mappings for a UUID stored on the DIR.
|
||||
rpc xtreemfs_address_mappings_get(addressMappingGetRequest) returns(AddressMappingSet) {
|
||||
option(proc_id)=1;
|
||||
};
|
||||
// Removes all address mappings for a UUID.
|
||||
rpc xtreemfs_address_mappings_remove(addressMappingGetRequest) returns(emptyResponse) {
|
||||
option(proc_id)=2;
|
||||
};
|
||||
// Sets (updates or adds) the address mappings for a UUID. All records must have the same
|
||||
// UUID and the same version. The version must be the latest returned by the DIR, otherwise
|
||||
// the DIR will return an error.
|
||||
rpc xtreemfs_address_mappings_set(AddressMappingSet) returns(addressMappingSetResponse) {
|
||||
option(proc_id)=3;
|
||||
};
|
||||
|
||||
// DIR discovery requests are sent via UDP. DIRs in the same net answer with a
|
||||
// DirService response.
|
||||
rpc xtreemfs_discover_dir(emptyRequest) returns(DirService) {
|
||||
option(proc_id)=4;
|
||||
};
|
||||
|
||||
// Returns the global XtreemFS time in seconds since Unix epoch.
|
||||
rpc xtreemfs_global_time_s_get(emptyRequest) returns(globalTimeSGetResponse) {
|
||||
option(proc_id)=5;
|
||||
};
|
||||
|
||||
// Deregisters a service (deletes the service record).
|
||||
rpc xtreemfs_service_deregister(serviceDeregisterRequest) returns(emptyResponse) {
|
||||
option(proc_id)=6;
|
||||
};
|
||||
|
||||
// Returns a list of services with a matching name.
|
||||
rpc xtreemfs_service_get_by_name(serviceGetByNameRequest) returns(ServiceSet) {
|
||||
option(proc_id)=7;
|
||||
};
|
||||
|
||||
// Returns a list of services with a matching type. Use MIXED to get all types.
|
||||
rpc xtreemfs_service_get_by_type(serviceGetByTypeRequest) returns(ServiceSet) {
|
||||
option(proc_id)=8;
|
||||
};
|
||||
|
||||
// Returns a list of services with a matching UUID.
|
||||
rpc xtreemfs_service_get_by_uuid(serviceGetByUUIDRequest) returns(ServiceSet) {
|
||||
option(proc_id)=9;
|
||||
};
|
||||
|
||||
// Sets the status of the service with UUID to offline.
|
||||
rpc xtreemfs_service_offline(serviceGetByUUIDRequest) returns(emptyResponse) {
|
||||
option(proc_id)=10;
|
||||
};
|
||||
|
||||
// Registers (or updates) a service record. Version should be 0 for new records and the
|
||||
// previous version returned by the DIR for updates.
|
||||
rpc xtreemfs_service_register(serviceRegisterRequest) returns(serviceRegisterResponse) {
|
||||
option(proc_id)=11;
|
||||
};
|
||||
|
||||
// Triggers a BabuDB database snapshot.
|
||||
rpc xtreemfs_checkpoint(emptyRequest) returns(emptyResponse) {
|
||||
option(proc_id)=20;
|
||||
};
|
||||
|
||||
// Shuts the service down, requires AUTH_PASSWORD.
|
||||
rpc xtreemfs_shutdown(emptyRequest) returns(emptyResponse) {
|
||||
option(proc_id)=21;
|
||||
};
|
||||
|
||||
// Returns the configuration for the service with UUID.
|
||||
rpc xtreemfs_configuration_get(configurationGetRequest) returns(Configuration) {
|
||||
option(proc_id)=22;
|
||||
};
|
||||
|
||||
// Updates the configuration for the service.
|
||||
rpc xtreemfs_configuration_set(Configuration) returns(configurationSetResponse) {
|
||||
option(proc_id)=23;
|
||||
};
|
||||
|
||||
// Send a client's vivaldi coordinates to th DIR.
|
||||
rpc xtreemfs_vivaldi_client_update(VivaldiCoordinates) returns(emptyResponse) {
|
||||
option(proc_id)=24;
|
||||
};
|
||||
}
|
||||
288
interface/xtreemfs/GlobalTypes.proto
Normal file
288
interface/xtreemfs/GlobalTypes.proto
Normal file
@@ -0,0 +1,288 @@
|
||||
//
|
||||
// Copyright (c) 2009-2011, Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// Neither the name of the Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
// nor the names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// AUTHORS: Bjoern Kolbeck (ZIB), Jan Stender (ZIB)
|
||||
//
|
||||
|
||||
option java_package="org.xtreemfs.pbrpc.generatedinterfaces";
|
||||
package xtreemfs.pbrpc;
|
||||
import "include/PBRPC.proto";
|
||||
import "include/Common.proto";
|
||||
|
||||
// Access control policy for a volume.
|
||||
enum AccessControlPolicyType {
|
||||
// No access control.
|
||||
ACCESS_CONTROL_POLICY_NULL = 1;
|
||||
// Regular POSIX permission and ACL-based access control.
|
||||
ACCESS_CONTROL_POLICY_POSIX = 2;
|
||||
// Permissions per volume (instead of per directory),
|
||||
// faster since hierarchical evaluation is skipped.
|
||||
ACCESS_CONTROL_POLICY_VOLUME = 3;
|
||||
}
|
||||
|
||||
// Values for OSD (and Replica) selection policies.
|
||||
enum OSDSelectionPolicyType {
|
||||
// Default filter.
|
||||
OSD_SELECTION_POLICY_FILTER_DEFAULT = 1000;
|
||||
// Filter based on the domain name (FQDN) of OSDs.
|
||||
OSD_SELECTION_POLICY_FILTER_FQDN = 1001;
|
||||
// Filter based on the UUID of OSDs.
|
||||
OSD_SELECTION_POLICY_FILTER_UUID = 1002;
|
||||
// Groups OSDs according to their location in the
|
||||
// datacenter map.
|
||||
OSD_SELECTION_POLICY_GROUP_DCMAP = 2000;
|
||||
// Groups OSDs accroding to their domain names.
|
||||
OSD_SELECTION_POLICY_GROUP_FQDN = 2001;
|
||||
// Sorts the OSDs by distance from client calculated
|
||||
// using the datacenter map.
|
||||
OSD_SELECTION_POLICY_SORT_DCMAP = 3000;
|
||||
// Sorts the OSDs by longest postfix match of the FQDN
|
||||
// of OSD and client.
|
||||
OSD_SELECTION_POLICY_SORT_FQDN = 3001;
|
||||
// Random order.
|
||||
OSD_SELECTION_POLICY_SORT_RANDOM = 3002;
|
||||
// Sorts the OSDs by proximity of vivalid network
|
||||
// coordinates of the client.
|
||||
OSD_SELECTION_POLICY_SORT_VIVALDI = 3003;
|
||||
// Sorts the OSDs in a round robin manner for
|
||||
// multiple OSDs per host.
|
||||
OSD_SELECTION_POLICY_SORT_HOST_ROUND_ROBIN = 3004;
|
||||
// Sortes the OSDs by their UUID.
|
||||
OSD_SELECTION_POLICY_SORT_UUID = 3998;
|
||||
// Reverse given list. Used only internally by unit tests.
|
||||
OSD_SELECTION_POLICY_SORT_REVERSE = 3999;
|
||||
}
|
||||
|
||||
enum ReplicaSelectionPolicyType {
|
||||
REPLICA_SELECTION_POLICY_SIMPLE = 1;
|
||||
}
|
||||
|
||||
// Configuration for file data snapshots.
|
||||
enum SnapConfig {
|
||||
// Indicates that snapshots are disabled.
|
||||
SNAP_CONFIG_SNAPS_DISABLED = 0;
|
||||
// Indicates access to the current version of a file.
|
||||
SNAP_CONFIG_ACCESS_CURRENT = 1;
|
||||
// Indicates access to a snapshot of a file.
|
||||
SNAP_CONFIG_ACCESS_SNAP = 2;
|
||||
}
|
||||
|
||||
// File size update data sent by OSDs.
|
||||
message NewFileSize {
|
||||
// New file size in bytes.
|
||||
required fixed64 size_in_bytes = 1;
|
||||
// Truncate epoch to sort file size updates.
|
||||
required fixed32 truncate_epoch = 2;
|
||||
}
|
||||
|
||||
enum StripingPolicyType {
|
||||
// Default striping policy (round-robin distribution).
|
||||
STRIPING_POLICY_RAID0 = 0;
|
||||
// Erasure code striping policy (.
|
||||
STRIPING_POLICY_ERASURECODE = 1;
|
||||
}
|
||||
|
||||
message StripingPolicy {
|
||||
// Type (by default STRIPING_POLICY_RAID0).
|
||||
required StripingPolicyType type = 1;
|
||||
// Size of a single chunk (object) in *kB*!
|
||||
// The name of the field is wrong: This is not the total size of the stripe.
|
||||
// Instead, the total size of a stripe in XtreemFS is: stripe_size * (width + parity_width)
|
||||
required fixed32 stripe_size = 2;
|
||||
// Number of OSDs to distribute data chunks on.
|
||||
required fixed32 width = 3;
|
||||
// Number of OSDs to distribute parity chunks on.
|
||||
optional fixed32 parity_width = 4;
|
||||
}
|
||||
|
||||
// Details for a file replica.
|
||||
message Replica {
|
||||
// UUIDs of OSDs to store objects on.
|
||||
// Length of this list must be equal to width
|
||||
// in striping_policy!
|
||||
repeated string osd_uuids = 1;
|
||||
// Flags to control replication, e.g. transfer strategy.
|
||||
required fixed32 replication_flags = 2;
|
||||
// Striping policy for this replica.
|
||||
required StripingPolicy striping_policy = 3;
|
||||
}
|
||||
|
||||
// List of replicas for a file.
|
||||
message Replicas {
|
||||
repeated Replica replicas = 1;
|
||||
}
|
||||
|
||||
// The LeaseState for a Replica.
|
||||
enum LeaseState {
|
||||
// The replica's update policy is not using lease.
|
||||
NONE = 0;
|
||||
// The replica is the the primary.
|
||||
PRIMARY = 1;
|
||||
// The replica is a backup (and an active primary exists).
|
||||
BACKUP = 2;
|
||||
// The replica is not active (currently no lease exists).
|
||||
IDLE = 3;
|
||||
}
|
||||
|
||||
// The XCap is the authorization token that allows a
|
||||
// client to execute operations on an OSD. It is created
|
||||
// by the MRC on open and must be renewed by the client
|
||||
// *before* it times out.
|
||||
// The XCap is signed and must not be modified by a client.
|
||||
message XCap {
|
||||
// Access mode (see SYSTEM_V_FCNTL for allowed values).
|
||||
required fixed32 access_mode = 1;
|
||||
// IP address of the client that owns this XCap.
|
||||
required string client_identity = 2;
|
||||
// Number of seconds this XCap is valid.
|
||||
required fixed64 expire_time_s = 3;
|
||||
// Timestamp in global synchronized XtreemFS time when
|
||||
// the XCap expires.
|
||||
required fixed32 expire_timeout_s = 4;
|
||||
// FileID for which this XCap is valid.
|
||||
required string file_id = 5;
|
||||
// True, if the file should be replicated when
|
||||
// closed (read-only replication).
|
||||
required bool replicate_on_close = 6;
|
||||
// MRC server signature, based on various fields of the XCap.
|
||||
required string server_signature = 7;
|
||||
// Current truncate_epoch for the file, required by OSDs.
|
||||
required fixed32 truncate_epoch = 8;
|
||||
// Snapshot configuration for the file, required by OSDs.
|
||||
required SnapConfig snap_config = 9;
|
||||
// If a snapshot of the file is being accessed, this timestamp
|
||||
// indicates which version (snapshot) of the file should be used
|
||||
// on the OSD.
|
||||
required fixed64 snap_timestamp = 10;
|
||||
}
|
||||
|
||||
// Locations of a file, i.e. the list of replicas including the OSDs that hold
|
||||
// the file data.
|
||||
message XLocSet {
|
||||
// Used by the read-only replication to properly handle
|
||||
// holes in sparse files and EOF.
|
||||
required fixed64 read_only_file_size = 1;
|
||||
// List of actual file replicas.
|
||||
repeated Replica replicas = 2;
|
||||
// Update policy to use for the file,
|
||||
// see org.xtreemfs.common.ReplicaUpdatePolicies for values.
|
||||
required string replica_update_policy = 3;
|
||||
// Monotonically increasing version number of a file's XLocSet.
|
||||
// Used to identify clients with outdates XLocSets.
|
||||
required fixed32 version = 4;
|
||||
}
|
||||
|
||||
// Information required by OSDs for all file operations.
|
||||
message FileCredentials {
|
||||
required XCap xcap = 1;
|
||||
required XLocSet xlocs = 2;
|
||||
}
|
||||
|
||||
message FileCredentialsSet {
|
||||
optional FileCredentials file_credentials = 1;
|
||||
}
|
||||
|
||||
// Network coordinates to estimate the latency.
|
||||
message VivaldiCoordinates {
|
||||
required double x_coordinate = 1;
|
||||
required double y_coordinate = 2;
|
||||
required double local_error = 3;
|
||||
}
|
||||
|
||||
// Response returned by OSD write and truncate operations.
|
||||
// This information is stored by the client and must be
|
||||
// relayed to the MRC in regular intervals or when the file
|
||||
// is fsynced or closed.
|
||||
// In addition, the client must use this information locally
|
||||
// for open files to provide processes with an accurate
|
||||
// file size.
|
||||
// Clients only need to store and relay the most recent OSDWriteResponse.
|
||||
// These are sorted first by truncate_epoch and then by size_in_bytes, both ascending.
|
||||
message OSDWriteResponse {
|
||||
// Current file size in bytes.
|
||||
optional fixed64 size_in_bytes = 1;
|
||||
// Truncate epoch.
|
||||
optional fixed32 truncate_epoch = 2;
|
||||
}
|
||||
|
||||
// TCP ports used by the services.
|
||||
// HTTP ports are used for the status pages.
|
||||
enum PORTS {
|
||||
DIR_HTTP_PORT_DEFAULT = 30638;
|
||||
DIR_PBRPC_PORT_DEFAULT = 32638;
|
||||
MRC_HTTP_PORT_DEFAULT = 30636;
|
||||
MRC_PBRPC_PORT_DEFAULT = 32636;
|
||||
OSD_HTTP_PORT_DEFAULT = 30640;
|
||||
OSD_PBRPC_PORT_DEFAULT = 32640;
|
||||
}
|
||||
|
||||
// Renew interval for clients.
|
||||
enum CONSTANTS {
|
||||
XCAP_RENEW_INTERVAL_IN_MIN = 1;
|
||||
}
|
||||
|
||||
// Flags for open command and access mode.
|
||||
// Values are Linux, might be different for other platforms!
|
||||
enum SYSTEM_V_FCNTL {
|
||||
SYSTEM_V_FCNTL_H_O_RDONLY = 0x0000;
|
||||
SYSTEM_V_FCNTL_H_O_WRONLY = 0x0001;
|
||||
SYSTEM_V_FCNTL_H_O_RDWR = 0x0002;
|
||||
SYSTEM_V_FCNTL_H_O_APPEND = 0x0008;
|
||||
SYSTEM_V_FCNTL_H_O_CREAT = 0x0100;
|
||||
SYSTEM_V_FCNTL_H_O_TRUNC = 0x0200;
|
||||
SYSTEM_V_FCNTL_H_O_EXCL = 0x0400;
|
||||
SYSTEM_V_FCNTL_H_O_SYNC = 0x0010;
|
||||
SYSTEM_V_FCNTL_H_S_IFREG = 0x8000;
|
||||
SYSTEM_V_FCNTL_H_S_IFDIR = 0x4000;
|
||||
SYSTEM_V_FCNTL_H_S_IFLNK = 0xA000;
|
||||
SYSTEM_V_FCNTL_H_S_IFIFO = 0x1000;
|
||||
}
|
||||
|
||||
// Flags for replication, multiple flags can be
|
||||
// OR'ed.
|
||||
enum REPL_FLAG {
|
||||
REPL_FLAG_FULL_REPLICA = 1;
|
||||
REPL_FLAG_IS_COMPLETE = 2;
|
||||
REPL_FLAG_STRATEGY_RANDOM = 4;
|
||||
REPL_FLAG_STRATEGY_RAREST_FIRST = 8;
|
||||
REPL_FLAG_STRATEGY_SEQUENTIAL = 16;
|
||||
REPL_FLAG_STRATEGY_SEQUENTIAL_PREFETCHING = 32;
|
||||
}
|
||||
|
||||
// Simple key/value pair. Protobuf doesn't provide a map type.
|
||||
message KeyValuePair {
|
||||
required string key = 1;
|
||||
required string value = 2;
|
||||
}
|
||||
|
||||
enum SERVICES {
|
||||
DIR = 1;
|
||||
MRC = 2;
|
||||
OSD = 3;
|
||||
}
|
||||
823
interface/xtreemfs/MRC.proto
Normal file
823
interface/xtreemfs/MRC.proto
Normal file
@@ -0,0 +1,823 @@
|
||||
//
|
||||
// Copyright (c) 2009-2011, Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// Neither the name of the Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
// nor the names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// AUTHORS: Bjoern Kolbeck (ZIB), Jan Stender (ZIB)
|
||||
//
|
||||
|
||||
option java_package="org.xtreemfs.pbrpc.generatedinterfaces";
|
||||
package xtreemfs.pbrpc;
|
||||
import "include/PBRPC.proto";
|
||||
import "include/Common.proto";
|
||||
import "xtreemfs/GlobalTypes.proto";
|
||||
|
||||
// information about a single file or directory; relevant for the 'stat' call
|
||||
message Stat {
|
||||
|
||||
// POSIX attributes
|
||||
|
||||
// device number; represented by a hash of the volume id
|
||||
required fixed64 dev = 1;
|
||||
// inode number; represented by the file ID
|
||||
required fixed64 ino = 2;
|
||||
// POSIX access mode
|
||||
required fixed32 mode = 3;
|
||||
// hardlink count
|
||||
required fixed32 nlink = 4;
|
||||
// owning user ID
|
||||
required string user_id = 5;
|
||||
// owning group ID
|
||||
required string group_id = 6;
|
||||
// file size
|
||||
required fixed64 size = 7;
|
||||
// atime (access time) in nanoseconds since 1970
|
||||
required fixed64 atime_ns = 8;
|
||||
// mtime (data modification time) in nanoseconds since 1970
|
||||
required fixed64 mtime_ns = 9;
|
||||
// ctime (inode change time) in nanoseconds since 1970
|
||||
required fixed64 ctime_ns = 10;
|
||||
// block size; represented by the stripe size
|
||||
required fixed32 blksize = 11;
|
||||
|
||||
// XtreemFS-specific attributes
|
||||
|
||||
// identification tag for the stat object
|
||||
optional fixed64 etag = 12;
|
||||
// truncate epoch
|
||||
required fixed32 truncate_epoch = 13;
|
||||
// Win32-specific attributes
|
||||
optional fixed32 attributes = 14;
|
||||
}
|
||||
|
||||
// single directory entry; relevant for the 'readdir' call
|
||||
message DirectoryEntry {
|
||||
// file or subdirectory name
|
||||
required string name = 1;
|
||||
// stat buffer containing the associated stat information
|
||||
// Can have 0 or 1 Stats on a readdir for names only
|
||||
optional Stat stbuf = 2;
|
||||
}
|
||||
|
||||
// list of directory entries; relevant for the 'readdir' call
|
||||
message DirectoryEntries {
|
||||
repeated DirectoryEntry entries = 1;
|
||||
}
|
||||
|
||||
// extended attribute of a file or directory
|
||||
message XAttr {
|
||||
// attribute name
|
||||
required string name = 1;
|
||||
// attribute value; can be empty on a 'listxattr' call for names only
|
||||
optional string value = 2;
|
||||
// redundant field of "value" which also accepts binary values (needed
|
||||
// for storing the value of "system.posix_acl_access",
|
||||
// added after version 1.3.1)
|
||||
// If both value and value_bytes are present, value_bytes will always
|
||||
// be preferred. For backward compability "value" always has to be set,
|
||||
// even if "value_bytes" is available.
|
||||
optional bytes value_bytes_string = 3;
|
||||
}
|
||||
|
||||
// information about a volume; relevant for the 'xtfs_mkvol' call
|
||||
message Volume {
|
||||
// access control policy to be assigned to the volume
|
||||
required AccessControlPolicyType access_control_policy = 1;
|
||||
// default striping policy to be assigned to the volume
|
||||
required StripingPolicy default_striping_policy = 2;
|
||||
// volume ID
|
||||
required string id = 3;
|
||||
// initial access mode for the root directory
|
||||
required fixed32 mode = 4;
|
||||
// volume name
|
||||
required string name = 5;
|
||||
// owning group ID of the volume (i.e. volume's root directory)
|
||||
required string owner_group_id = 6;
|
||||
// owning user ID of the volume (i.e. volume's root directory)
|
||||
required string owner_user_id = 7;
|
||||
// optional configuration attributes for the volume
|
||||
repeated KeyValuePair attrs = 8;
|
||||
// optional volume quota
|
||||
optional fixed64 quota = 9;
|
||||
}
|
||||
|
||||
// a list of volumes; relevant for the 'xtfs_lsvol' call
|
||||
message Volumes {
|
||||
repeated Volume volumes = 1;
|
||||
}
|
||||
|
||||
// information about a file system (i.e. mounted volume)
|
||||
message StatVFS {
|
||||
|
||||
// POSIX attributes
|
||||
|
||||
// size of a block in bytes
|
||||
required fixed32 bsize = 1;
|
||||
// number of available blocks in the file system for non-privileged users
|
||||
required fixed64 bavail = 2;
|
||||
// number of free blocks in the file system
|
||||
optional fixed64 bfree = 13;
|
||||
// total number of blocks in file system
|
||||
required fixed64 blocks = 3;
|
||||
// volume id
|
||||
required string fsid = 4;
|
||||
// maximum filename length
|
||||
required fixed32 namemax = 5;
|
||||
|
||||
// XtreemFS-specific attributes
|
||||
|
||||
// access control policy of the volume
|
||||
required AccessControlPolicyType access_control_policy = 6;
|
||||
// default striping policy of the volume
|
||||
required StripingPolicy default_striping_policy = 7;
|
||||
// identification tag for the statVFS object
|
||||
required fixed64 etag = 8;
|
||||
// access mode of the volume's root directory
|
||||
required fixed32 mode = 9;
|
||||
// volume name
|
||||
required string name = 10;
|
||||
// owning group ID of the volume (i.e. volume's root directory)
|
||||
required string owner_group_id = 11;
|
||||
// owning user ID of the volume (i.e. volume's root directory)
|
||||
required string owner_user_id = 12;
|
||||
}
|
||||
|
||||
// flags for setattr request
|
||||
enum Setattrs {
|
||||
SETATTR_MODE = 1;
|
||||
SETATTR_UID = 2;
|
||||
SETATTR_GID = 4;
|
||||
SETATTR_SIZE = 8;
|
||||
SETATTR_ATIME = 16;
|
||||
SETATTR_MTIME = 32;
|
||||
SETATTR_CTIME = 64;
|
||||
SETATTR_ATTRIBUTES = 128;
|
||||
}
|
||||
|
||||
//messages for requests
|
||||
|
||||
// sets file attriubtes of an open file
|
||||
message fsetattrRequest {
|
||||
// a buffer containing the attributes to update
|
||||
required Stat stbuf = 1;
|
||||
// a bitmap of Setattrs indicating which attributes to update
|
||||
required fixed32 to_set = 2;
|
||||
// the capability returned by the MRC when the file was opened
|
||||
required XCap cap = 3;
|
||||
}
|
||||
|
||||
// requests attributes of a file or directory
|
||||
message getattrRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// an identification tag indicating the last known version of the attributes
|
||||
required fixed64 known_etag = 3;
|
||||
}
|
||||
|
||||
// returns attributes of a file or directory
|
||||
message getattrResponse {
|
||||
optional Stat stbuf = 1;
|
||||
}
|
||||
|
||||
|
||||
// requests extended attributes of a file or directory
|
||||
message getxattrRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// the name of the attribute to retrieve
|
||||
required string name = 3;
|
||||
}
|
||||
|
||||
// returns an attribute value of a file or directory
|
||||
message getxattrResponse {
|
||||
required string value = 1;
|
||||
// see XAttr message for explanation.
|
||||
optional bytes value_bytes_string = 2;
|
||||
}
|
||||
|
||||
// creates a new hardlink to an existing file
|
||||
message linkRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file to which the link is supposed to be created,
|
||||
// relative to the volume root
|
||||
required string target_path = 2;
|
||||
// the path to the new link, relative to the volume root
|
||||
required string link_path = 3;
|
||||
}
|
||||
|
||||
// requests a list of extended attributes of a file or directory
|
||||
message listxattrRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// a flag indicating that no attribute values are supposed to be returned
|
||||
required bool names_only = 3;
|
||||
}
|
||||
|
||||
// returns a list of extended attributes of a file or directory
|
||||
message listxattrResponse {
|
||||
repeated XAttr xattrs = 1;
|
||||
}
|
||||
|
||||
// creates a new directory
|
||||
message mkdirRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// the initial access mode of the newly created directory
|
||||
required fixed32 mode = 3;
|
||||
}
|
||||
|
||||
// opens a file and requests file credentials
|
||||
message openRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file, relative to the volume root
|
||||
required string path = 2;
|
||||
// a bitmap open flags, as defined in the specification of the POSIX
|
||||
// 'open' call, e.g. O_RDWR, O_RDONLY, O_CREAT, O_EXCL, O_TRUNC ...
|
||||
required fixed32 flags = 3;
|
||||
// the initial access mode for a file created w/ O_CREAT
|
||||
required fixed32 mode = 4;
|
||||
// the initial set of Win32-specific attributes
|
||||
required fixed32 attributes = 5;
|
||||
// optional set of Vivaldi cooridnates of the client, which can be
|
||||
// used to order the list of replicas
|
||||
optional VivaldiCoordinates coordinates = 6;
|
||||
}
|
||||
|
||||
// returns a set of file credentials
|
||||
message openResponse {
|
||||
// the file credentials
|
||||
required FileCredentials creds = 1;
|
||||
// the server timestamp in seconds since 1970 to which the file
|
||||
// timestamps were updated
|
||||
required fixed32 timestamp_s = 2;
|
||||
}
|
||||
|
||||
// requests the content of a directory
|
||||
message readdirRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// an identification tag indicating the last known version of the directory
|
||||
// content
|
||||
required fixed64 known_etag = 3;
|
||||
// the maximum number of directory entries to return
|
||||
required fixed32 limit_directory_entries_count = 4;
|
||||
// a flag indicating that only names of nested files and directories are
|
||||
// supposed to be returned, no attributes
|
||||
required bool names_only = 5;
|
||||
// the number of directory entries that have been returned already by
|
||||
// previous calls
|
||||
required fixed64 seen_directory_entries_count = 6;
|
||||
}
|
||||
|
||||
// requests the target path of a symbolic link
|
||||
message readlinkRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the symbolic link, relative to the volume root
|
||||
required string path = 2;
|
||||
}
|
||||
|
||||
// returns the target path of a symbolic link
|
||||
message readlinkResponse {
|
||||
repeated string link_target_path = 1;
|
||||
}
|
||||
|
||||
// removes an extended attribute from a file or directory
|
||||
message removexattrRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// the name of the attribute to remove
|
||||
required string name = 3;
|
||||
}
|
||||
|
||||
// changes the path name of a file or directory
|
||||
message renameRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the pathname to the file or directory to change
|
||||
required string source_path = 2;
|
||||
// the new path name for the file or directory
|
||||
required string target_path = 3;
|
||||
}
|
||||
|
||||
// returns the result of a rename operation
|
||||
message renameResponse {
|
||||
// the server timestamp in seconds since 1970 to which the file and
|
||||
// directory timestamps were updated
|
||||
required fixed32 timestamp_s = 1;
|
||||
// an optional set of file credentials that may contain a capabiltiy
|
||||
// for the deletion of the previous file at the given target path
|
||||
optional FileCredentials creds = 2;
|
||||
}
|
||||
|
||||
// deletes an empty directory
|
||||
message rmdirRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the directory to delete
|
||||
required string path = 2;
|
||||
}
|
||||
|
||||
// changes attributes of a file or directory
|
||||
message setattrRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// a buffer containing the attributes to update
|
||||
required Stat stbuf = 3;
|
||||
// a bitmap of Setattrs indicating which attributes to update
|
||||
required fixed32 to_set = 4;
|
||||
}
|
||||
|
||||
// flags for setxattr request
|
||||
enum XATTR_FLAGS {
|
||||
XATTR_FLAGS_CREATE = 1;
|
||||
XATTR_FLAGS_REPLACE = 2;
|
||||
}
|
||||
|
||||
// sets an extended attribute of a file or directory
|
||||
message setxattrRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// the name of the extended attribute to set
|
||||
required string name = 3;
|
||||
// the (new) value for the extended attribute to set
|
||||
required string value = 4;
|
||||
// (new) value in bytes, see XAttr for explanation.
|
||||
optional bytes value_bytes_string = 6;
|
||||
// flags indicating whether the attribute is supposed to be created or
|
||||
// replaced (see XATTR_FLAGS)
|
||||
required fixed32 flags = 5;
|
||||
}
|
||||
|
||||
// requests information about a mounted volume
|
||||
message statvfsRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// an identification tag indicating the last known version of the directory
|
||||
// content
|
||||
required fixed64 known_etag = 5;
|
||||
}
|
||||
|
||||
// creates a symbolic link to a file
|
||||
message symlinkRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file to which the link is supposed to be created,
|
||||
// relative to the volume root
|
||||
required string target_path = 2;
|
||||
// the path to the new link, relative to the volume root
|
||||
required string link_path = 3;
|
||||
}
|
||||
|
||||
// deletes a file or directory
|
||||
message unlinkRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
}
|
||||
|
||||
// returns the result of an unlink operation
|
||||
message unlinkResponse {
|
||||
// the server timestamp in seconds since 1970 to which the file and
|
||||
// directory timestamps were updated
|
||||
required fixed32 timestamp_s = 1;
|
||||
// an optional set of file credentials that may contain a capabiltiy
|
||||
// for the deletion of the previous file at the given target path
|
||||
optional FileCredentials creds = 2;
|
||||
}
|
||||
|
||||
// flags for the 'access' call
|
||||
enum ACCESS_FLAGS {
|
||||
ACCESS_FLAGS_F_OK = 0; // existence
|
||||
ACCESS_FLAGS_X_OK = 1; // execute permission
|
||||
ACCESS_FLAGS_W_OK = 2; // write permission
|
||||
ACCESS_FLAGS_R_OK = 4; // read permission
|
||||
}
|
||||
|
||||
// checks whether access is granted to a file or directory
|
||||
message accessRequest {
|
||||
// the volume name
|
||||
required string volume_name = 1;
|
||||
// the path to the file or directory, relative to the volume root
|
||||
required string path = 2;
|
||||
// the flags for which the access is supposed to be checked;
|
||||
// see ACCESS_FLAGS
|
||||
required fixed32 flags = 3;
|
||||
}
|
||||
|
||||
message xtreemfs_check_file_existsRequest {
|
||||
required string volume_id = 1;
|
||||
repeated string file_ids = 2;
|
||||
required string osd_uuid = 3;
|
||||
}
|
||||
|
||||
message xtreemfs_check_file_existsResponse {
|
||||
required bool volume_exists = 1;
|
||||
|
||||
enum FILE_STATE {
|
||||
DELETED=0;
|
||||
REGISTERED=1;
|
||||
ABANDONED=2;
|
||||
}
|
||||
repeated FILE_STATE file_states = 2 [packed=true];
|
||||
}
|
||||
|
||||
// dumps or restores the MRC database
|
||||
message xtreemfs_dump_restore_databaseRequest {
|
||||
// the path to the dump file on the MRC host
|
||||
required string dump_file = 1;
|
||||
}
|
||||
|
||||
// requests the list of suitable OSDs for new replicas of a file
|
||||
message xtreemfs_get_suitable_osdsRequest {
|
||||
// the file ID
|
||||
optional string file_id = 1;
|
||||
// or path and volume_name to file.
|
||||
optional string path = 3;
|
||||
optional string volume_name = 4;
|
||||
// the number of OSDs required in a valid group
|
||||
// ignored by filtering and sorting policies
|
||||
required fixed32 num_osds = 2;
|
||||
}
|
||||
|
||||
// returns a list of suitable OSDs
|
||||
message xtreemfs_get_suitable_osdsResponse {
|
||||
repeated string osd_uuids = 1;
|
||||
}
|
||||
|
||||
message timestampResponse {
|
||||
required fixed32 timestamp_s = 1;
|
||||
}
|
||||
|
||||
message stringMessage {
|
||||
required string a_string = 1;
|
||||
}
|
||||
|
||||
message xtreemfs_listdirRequest {
|
||||
required string path = 1;
|
||||
}
|
||||
|
||||
message xtreemfs_listdirResponse {
|
||||
repeated string names = 1;
|
||||
}
|
||||
|
||||
// adds a replica to a file
|
||||
message xtreemfs_replica_addRequest {
|
||||
// the file ID
|
||||
optional string file_id = 1;
|
||||
// or path and volume_name to file.
|
||||
optional string path = 3;
|
||||
optional string volume_name = 4;
|
||||
// the replica to add
|
||||
required Replica new_replica = 2;
|
||||
}
|
||||
|
||||
// requests a list of all replicas of a file (deprecated)
|
||||
message xtreemfs_replica_listRequest {
|
||||
// the file ID
|
||||
optional string file_id = 1;
|
||||
// or path and volume_name to file.
|
||||
optional string path = 2;
|
||||
optional string volume_name = 3;
|
||||
}
|
||||
|
||||
// requests the xLocSet of a file
|
||||
message xtreemfs_get_xlocsetRequest {
|
||||
// the file ID
|
||||
optional string file_id = 1;
|
||||
// or path and volume_name to file
|
||||
optional string path = 2;
|
||||
optional string volume_name = 3;
|
||||
// or a valid XCap.
|
||||
optional XCap xcap = 4;
|
||||
}
|
||||
|
||||
// removes a replica from a file
|
||||
message xtreemfs_replica_removeRequest {
|
||||
// the file ID
|
||||
optional string file_id = 1;
|
||||
// or path and volume_name to file.
|
||||
optional string path = 3;
|
||||
optional string volume_name = 4;
|
||||
// the UUID of the head OSD of the replica to remove
|
||||
required string osd_uuid = 2;
|
||||
}
|
||||
|
||||
// restores a file w/ orphaned file content by creating a new metadata object
|
||||
message xtreemfs_restore_fileRequest {
|
||||
// the path to the restored file
|
||||
required string file_path = 1;
|
||||
// the file ID
|
||||
required string file_id = 2;
|
||||
// the file size
|
||||
required fixed64 file_size = 3;
|
||||
// the UUID of the OSD with the orphaned file content
|
||||
required string osd_uuid = 4;
|
||||
// the stripe size of the file
|
||||
required fixed32 stripe_size = 5;
|
||||
}
|
||||
|
||||
// deletes a volume
|
||||
message xtreemfs_rmvolRequest {
|
||||
// the name of the volume to delete
|
||||
required string volume_name = 1;
|
||||
}
|
||||
|
||||
// updates the size of an open file
|
||||
message xtreemfs_update_file_sizeRequest {
|
||||
// the capability that was returned when opening the file
|
||||
required XCap xcap = 1;
|
||||
// the OSDWriteResponse received from an OSD that contains the new file size
|
||||
required OSDWriteResponse osd_write_response = 2;
|
||||
// a flag indicating that the file is supposed to be closed
|
||||
optional bool close_file = 3;
|
||||
// the client's Vivaldi coordinates (e.g. used for creating replicas at
|
||||
// specific locations when the file is closed)
|
||||
optional VivaldiCoordinates coordinates = 4;
|
||||
}
|
||||
|
||||
// sets the replica update policy of a file by ID
|
||||
message xtreemfs_set_replica_update_policyRequest {
|
||||
// the file ID
|
||||
required string file_id = 1;
|
||||
// the new replica update policy
|
||||
required string update_policy = 2;
|
||||
}
|
||||
|
||||
// returns the old replica update policy when setting a new one
|
||||
message xtreemfs_set_replica_update_policyResponse {
|
||||
// the old replica update policy
|
||||
required string old_update_policy = 1;
|
||||
}
|
||||
|
||||
// sets the read-only flag of a file by ID
|
||||
message xtreemfs_set_read_only_xattrRequest {
|
||||
// the file ID
|
||||
required string file_id = 1;
|
||||
// the read-only flag to set
|
||||
required bool value = 2;
|
||||
}
|
||||
|
||||
message xtreemfs_set_read_only_xattrResponse {
|
||||
required bool was_set = 1;
|
||||
}
|
||||
|
||||
message xtreemfs_get_file_credentialsRequest{
|
||||
required string file_id = 1;
|
||||
}
|
||||
|
||||
service MRCService {
|
||||
|
||||
option(interface_id)=20001;
|
||||
|
||||
// POSIX/FUSE operations ----------------------------------------
|
||||
|
||||
// sets attributes of an open file
|
||||
rpc fsetattr(fsetattrRequest) returns(emptyResponse) {
|
||||
option(proc_id)=2;
|
||||
};
|
||||
|
||||
// truncates an open file
|
||||
rpc ftruncate(XCap) returns(XCap) {
|
||||
option(proc_id)=3;
|
||||
};
|
||||
|
||||
// returns attributes of a file or directory
|
||||
rpc getattr(getattrRequest) returns(getattrResponse) {
|
||||
option(proc_id)=4;
|
||||
};
|
||||
|
||||
// returns an extended attribute of a file or directory
|
||||
rpc getxattr(getxattrRequest) returns(getxattrResponse) {
|
||||
option(proc_id)=5;
|
||||
};
|
||||
|
||||
// creates a hardlink to a file
|
||||
rpc link(linkRequest) returns(timestampResponse) {
|
||||
option(proc_id)=6;
|
||||
};
|
||||
|
||||
// returns the list of extended attributes of a file or directory
|
||||
rpc listxattr(listxattrRequest) returns(listxattrResponse) {
|
||||
option(proc_id)=7;
|
||||
};
|
||||
|
||||
// creates a new directory
|
||||
rpc mkdir(mkdirRequest) returns(timestampResponse) {
|
||||
option(proc_id)=8;
|
||||
};
|
||||
|
||||
// opens an existing file to obtain file credentials
|
||||
rpc open(openRequest) returns(openResponse) {
|
||||
option(proc_id)=9;
|
||||
};
|
||||
|
||||
// returns a list of all nested files and directories in a directory
|
||||
rpc readdir(readdirRequest) returns(DirectoryEntries) {
|
||||
option(proc_id)=10;
|
||||
};
|
||||
|
||||
// returns the target path of a symbolic link
|
||||
rpc readlink(readlinkRequest) returns(readlinkResponse) {
|
||||
option(proc_id)=11;
|
||||
};
|
||||
|
||||
// removes an extended attribute from a file or directory
|
||||
rpc removexattr(removexattrRequest) returns(timestampResponse) {
|
||||
option(proc_id)=12;
|
||||
};
|
||||
|
||||
// renames a file or directory
|
||||
rpc rename(renameRequest) returns(renameResponse) {
|
||||
option(proc_id)=13;
|
||||
};
|
||||
|
||||
// removes an empty directory
|
||||
rpc rmdir(rmdirRequest) returns(timestampResponse) {
|
||||
option(proc_id)=14;
|
||||
};
|
||||
|
||||
// sets attributes of a file or directory
|
||||
rpc setattr(setattrRequest) returns(timestampResponse) {
|
||||
option(proc_id)=15;
|
||||
};
|
||||
|
||||
// sets an extended attribute of a file or directory
|
||||
rpc setxattr(setxattrRequest) returns(timestampResponse) {
|
||||
option(proc_id)=16;
|
||||
};
|
||||
|
||||
// returns information about a mounted volume
|
||||
rpc statvfs(statvfsRequest) returns(StatVFS) {
|
||||
option(proc_id)=17;
|
||||
};
|
||||
|
||||
// creates a symbolic link to a file or directory
|
||||
rpc symlink(symlinkRequest) returns(timestampResponse) {
|
||||
option(proc_id)=18;
|
||||
};
|
||||
|
||||
// removes a link to a file and removes the file if no more links exist
|
||||
rpc unlink(unlinkRequest) returns(unlinkResponse) {
|
||||
option(proc_id)=19;
|
||||
};
|
||||
|
||||
// checks access to a file or directory
|
||||
rpc access(accessRequest) returns(emptyResponse) {
|
||||
option(proc_id)=20;
|
||||
};
|
||||
|
||||
//-- XtreemFS specific operations -------------------------------------
|
||||
|
||||
// enforces a database checkpoint on the MRC
|
||||
rpc xtreemfs_checkpoint(emptyRequest) returns(emptyResponse) {
|
||||
option(proc_id)=30;
|
||||
};
|
||||
|
||||
// checks if a certain set of files exist
|
||||
rpc xtreemfs_check_file_exists(xtreemfs_check_file_existsRequest) returns(xtreemfs_check_file_existsResponse) {
|
||||
option(proc_id)=31;
|
||||
};
|
||||
|
||||
// dumps the MRC database to a dump file on the MRC host
|
||||
rpc xtreemfs_dump_database(xtreemfs_dump_restore_databaseRequest) returns(emptyResponse) {
|
||||
option(proc_id)=32;
|
||||
};
|
||||
|
||||
// returns the list of suitable OSDs for replicas of a given file
|
||||
rpc xtreemfs_get_suitable_osds(xtreemfs_get_suitable_osdsRequest) returns(xtreemfs_get_suitable_osdsResponse) {
|
||||
option(proc_id)=33;
|
||||
};
|
||||
|
||||
// call for internal debugging purposes
|
||||
rpc xtreemfs_internal_debug(stringMessage) returns(stringMessage) {
|
||||
option(proc_id)=34;
|
||||
};
|
||||
|
||||
|
||||
rpc xtreemfs_listdir(xtreemfs_listdirRequest) returns(xtreemfs_listdirResponse) {
|
||||
option(proc_id)=35;
|
||||
};
|
||||
|
||||
// returns a list of all volumes on the MRC
|
||||
rpc xtreemfs_lsvol(emptyRequest) returns(Volumes) {
|
||||
option(proc_id)=36;
|
||||
};
|
||||
|
||||
// creates a new volume
|
||||
rpc xtreemfs_mkvol(Volume) returns(emptyResponse) {
|
||||
option(proc_id)=47;
|
||||
};
|
||||
|
||||
// renews an existing capability to extend the validity period
|
||||
rpc xtreemfs_renew_capability(XCap) returns(XCap) {
|
||||
option(proc_id)=37;
|
||||
};
|
||||
|
||||
rpc xtreemfs_replication_to_master(emptyRequest) returns(emptyResponse) {
|
||||
option(proc_id)=38;
|
||||
};
|
||||
|
||||
// adds a replica to a file
|
||||
rpc xtreemfs_replica_add(xtreemfs_replica_addRequest) returns(emptyResponse) {
|
||||
option(proc_id)=39;
|
||||
};
|
||||
|
||||
// lists all replicas of a file (deprecated)
|
||||
rpc xtreemfs_replica_list(xtreemfs_replica_listRequest) returns(Replicas) {
|
||||
option(proc_id)=40;
|
||||
};
|
||||
|
||||
// removes a replica from a file
|
||||
rpc xtreemfs_replica_remove(xtreemfs_replica_removeRequest) returns(FileCredentials) {
|
||||
option(proc_id)=41;
|
||||
};
|
||||
|
||||
// restores the MRC database from a dump file on the MRC host
|
||||
rpc xtreemfs_restore_database(xtreemfs_dump_restore_databaseRequest) returns(emptyResponse) {
|
||||
option(proc_id)=42;
|
||||
};
|
||||
|
||||
// restores a file on the MRC for which orphaned objects exist on an OSD
|
||||
rpc xtreemfs_restore_file(xtreemfs_restore_fileRequest) returns(emptyResponse) {
|
||||
option(proc_id)=43;
|
||||
};
|
||||
|
||||
// deletes a volume
|
||||
rpc xtreemfs_rmvol(xtreemfs_rmvolRequest) returns(emptyResponse) {
|
||||
option(proc_id)=44;
|
||||
};
|
||||
|
||||
// terminates the MRC
|
||||
rpc xtreemfs_shutdown(emptyRequest) returns(emptyResponse) {
|
||||
option(proc_id)=45;
|
||||
};
|
||||
|
||||
// updates the size of a file and indicates that a file was closed
|
||||
rpc xtreemfs_update_file_size(xtreemfs_update_file_sizeRequest) returns(timestampResponse) {
|
||||
option(proc_id)=46;
|
||||
};
|
||||
|
||||
// sets the replica update policy on a file identified by a file ID (privileged users only!)
|
||||
rpc xtreemfs_set_replica_update_policy(xtreemfs_set_replica_update_policyRequest) returns(xtreemfs_set_replica_update_policyResponse) {
|
||||
option(proc_id)=48;
|
||||
};
|
||||
|
||||
// sets the read-only attribute on a file identified by a file ID (privileged users only!)
|
||||
rpc xtreemfs_set_read_only_xattr(xtreemfs_set_read_only_xattrRequest) returns(xtreemfs_set_read_only_xattrResponse) {
|
||||
option(proc_id)=49;
|
||||
};
|
||||
|
||||
// returns a set of file credentials (capability + XLocList) for a file identified by a file ID (privileged users only!)
|
||||
rpc xtreemfs_get_file_credentials(xtreemfs_get_file_credentialsRequest) returns(FileCredentials) {
|
||||
option(proc_id)=50;
|
||||
};
|
||||
|
||||
// Returns the current xLocSet for the specified file.
|
||||
rpc xtreemfs_get_xlocset(xtreemfs_get_xlocsetRequest) returns(XLocSet) {
|
||||
option(proc_id)=51;
|
||||
};
|
||||
}
|
||||
582
interface/xtreemfs/OSD.proto
Normal file
582
interface/xtreemfs/OSD.proto
Normal file
@@ -0,0 +1,582 @@
|
||||
//
|
||||
// Copyright (c) 2009-2011, Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
// Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// Neither the name of the Konrad-Zuse-Zentrum fuer Informationstechnik Berlin
|
||||
// nor the names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// AUTHORS: Bjoern Kolbeck (ZIB), Jan Stender (ZIB)
|
||||
//
|
||||
|
||||
option java_package="org.xtreemfs.pbrpc.generatedinterfaces";
|
||||
package xtreemfs.pbrpc;
|
||||
import "include/PBRPC.proto";
|
||||
import "include/Common.proto";
|
||||
import "xtreemfs/GlobalTypes.proto";
|
||||
|
||||
// Message sent between OSDs when the size of a striped file changes.
|
||||
// Optimization to reduce communication between servers for sparse files
|
||||
// and to handle EOF.
|
||||
message InternalGmax {
|
||||
required fixed64 epoch = 1;
|
||||
required fixed64 file_size = 2;
|
||||
required fixed64 last_object_id = 3;
|
||||
}
|
||||
|
||||
// POSIX file lock.
|
||||
message Lock {
|
||||
// Process ID, must be unique per client,
|
||||
// i.e. client_pid+uuid must be globally unique.
|
||||
required fixed32 client_pid = 1;
|
||||
// UUID for client, can be temporary.
|
||||
required string client_uuid = 2;
|
||||
// Length of byte range for the lock.
|
||||
required fixed64 length = 3;
|
||||
// Offset of the locked byte range.
|
||||
required fixed64 offset = 4;
|
||||
// If true, lock is exclusive.
|
||||
required bool exclusive = 5;
|
||||
}
|
||||
|
||||
// Contains details on object data which is now sent in
|
||||
// the data fragment of the RPC protocol.
|
||||
message ObjectData {
|
||||
// Data checksum (Adler32), if checksums are enabled.
|
||||
required fixed32 checksum = 1;
|
||||
// True, if the checksum doesn't match the data on the OSD.
|
||||
required bool invalid_checksum_on_osd = 2;
|
||||
// Number of zeros the client must append to data before delivering
|
||||
// data to an application (for sparse files).
|
||||
// When returned by the xtreemfs_check_object method
|
||||
// it stores the total number of bytes(data + sparse data)
|
||||
required fixed32 zero_padding = 3;
|
||||
}
|
||||
|
||||
// List of objects which an OSD has stored locally.
|
||||
// Used by the read-only replication to optimize
|
||||
// fetching of missing objects.
|
||||
message ObjectList {
|
||||
// serialized data type
|
||||
required bytes set = 1;
|
||||
required fixed32 stripe_width = 2;
|
||||
required fixed32 first_ = 3;
|
||||
}
|
||||
|
||||
// Version information for an object.
|
||||
// Used to generate a mapping from object_number
|
||||
// to object_version. Used by the read-write replication.
|
||||
message ObjectVersion {
|
||||
required fixed64 object_number = 1;
|
||||
required fixed64 object_version = 2;
|
||||
}
|
||||
|
||||
// Entry for the truncate log required by the read-write
|
||||
// replication. For each truncate, a version number is
|
||||
// assigned and a record is appended to the truncate log.
|
||||
message TruncateRecord {
|
||||
required fixed64 version = 1;
|
||||
required fixed64 last_object_number = 2;
|
||||
}
|
||||
|
||||
message TruncateLog {
|
||||
repeated TruncateRecord records = 1;
|
||||
}
|
||||
|
||||
// Version of the latest XLocSet a Replica has beeen part of
|
||||
// and a flag indicating if the Replica is currently participating
|
||||
// in a XLocSetChange
|
||||
message XLocSetVersionState {
|
||||
required fixed32 version = 1;
|
||||
required bool invalidated = 2;
|
||||
optional fixed64 modified_time = 3;
|
||||
}
|
||||
|
||||
// Full status of a replica. Used by the read-write
|
||||
// replication during Replica Reset.
|
||||
message ReplicaStatus {
|
||||
// Current truncate epoch.
|
||||
required fixed64 truncate_epoch = 1;
|
||||
// Local file size.
|
||||
required fixed64 file_size = 2;
|
||||
// Last object version stored locally.
|
||||
required fixed64 max_obj_version = 3;
|
||||
// Primary epoch number (aka Master Epoch).
|
||||
required fixed32 primary_epoch = 4;
|
||||
// List of objects and their version.
|
||||
repeated ObjectVersion objectVersions = 5;
|
||||
// Truncate log.
|
||||
required TruncateLog truncate_log = 6;
|
||||
}
|
||||
|
||||
// Mapping from object_number/version to OSDs that have
|
||||
// a copy of this object. Used by the rw-replication.
|
||||
message ObjectVersionMapping {
|
||||
required fixed64 object_number = 1;
|
||||
required fixed64 object_version = 2;
|
||||
repeated string osd_uuids = 3;
|
||||
}
|
||||
|
||||
// Correct replica state sent by the Primary to all
|
||||
// backups. After receiving this information, backups
|
||||
// will bring themselves to the authoritative state by
|
||||
// fetching missing data and deleting outdated objects.
|
||||
message AuthoritativeReplicaState {
|
||||
required fixed64 truncate_epoch = 1;
|
||||
required fixed64 max_obj_version = 4;
|
||||
repeated ObjectVersionMapping objectVersions = 2;
|
||||
required TruncateLog truncate_log = 3;
|
||||
}
|
||||
|
||||
// Response sent by an OSD when reading objects for
|
||||
// the ro/rw replication.
|
||||
message InternalReadLocalResponse {
|
||||
required ObjectData data = 1;
|
||||
// List of objects the OSD has.
|
||||
repeated ObjectList object_set = 2;
|
||||
}
|
||||
|
||||
message readRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
// Object number starting at 0.
|
||||
required fixed64 object_number = 3;
|
||||
// Version, currently ignored.
|
||||
required fixed64 object_version = 4;
|
||||
// Offset within the object.
|
||||
required fixed32 offset = 5;
|
||||
// Length of data to be read, must be <= stripe_size - offset.
|
||||
required fixed32 length = 6;
|
||||
}
|
||||
|
||||
message truncateRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
// New file size in bytes.
|
||||
required fixed64 new_file_size = 3;
|
||||
}
|
||||
|
||||
message unlink_osd_Request {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
}
|
||||
|
||||
message writeRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
// Object number starting at 0.
|
||||
required fixed64 object_number = 3;
|
||||
// Version, currently ignored.
|
||||
required fixed64 object_version = 4;
|
||||
// Offset within the object.
|
||||
required fixed32 offset = 5;
|
||||
// Timeout of the client lease, if set.
|
||||
// Reserved for client-side-caching, currently not used.
|
||||
required fixed64 lease_timeout = 6;
|
||||
// Only the checksum of ObjectData is used.
|
||||
required ObjectData object_data = 7;
|
||||
}
|
||||
|
||||
// Internal message sent between OSDs of a striped file.
|
||||
// Transmitted via UDP.
|
||||
message xtreemfs_broadcast_gmaxRequest{
|
||||
required string file_id = 1;
|
||||
required fixed64 truncate_epoch = 2;
|
||||
required fixed64 last_object = 3;
|
||||
required fixed64 file_size = 4;
|
||||
}
|
||||
|
||||
message xtreemfs_check_objectRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required fixed64 object_number = 3;
|
||||
required fixed64 object_version = 4;
|
||||
}
|
||||
|
||||
message xtreemfs_cleanup_get_resultsResponse {
|
||||
// Human readable English status and error messages.
|
||||
repeated string results = 1;
|
||||
}
|
||||
|
||||
message xtreemfs_cleanup_is_runningResponse {
|
||||
required bool is_running = 1;
|
||||
}
|
||||
|
||||
message xtreemfs_cleanup_startRequest {
|
||||
// If true, objects for deleted files are deleted as well.
|
||||
required bool remove_zombies = 1;
|
||||
// If true, files for which the MRC cannot be contacted or
|
||||
// where no volume DIR entry exists are deleted.
|
||||
required bool remove_unavail_volume = 2;
|
||||
// If true, objects are not deleted but moved to lost and found.
|
||||
required bool lost_and_found = 3;
|
||||
// Delete metadata of deleted or abandoned files.
|
||||
required bool delete_metadata = 4;
|
||||
// Time in seconds to wait after the last view update before
|
||||
// deleting metadata.
|
||||
required fixed32 metadata_timeout = 5;
|
||||
}
|
||||
|
||||
message xtreemfs_cleanup_statusResponse {
|
||||
required string status = 1;
|
||||
}
|
||||
|
||||
message xtreemfs_rwr_fetchRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required fixed64 object_number = 3;
|
||||
required fixed64 object_version = 4;
|
||||
}
|
||||
|
||||
message xtreemfs_repair_objectRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required fixed64 object_number = 3;
|
||||
required fixed64 object_version = 4;
|
||||
}
|
||||
|
||||
message xtreemfs_rwr_flease_msgRequest {
|
||||
// The actual flease message is sent in data.
|
||||
required string sender_hostname = 1;
|
||||
required fixed32 sender_port = 2;
|
||||
}
|
||||
|
||||
message xtreemfs_rwr_set_primary_epochRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required fixed32 primary_epoch = 3;
|
||||
}
|
||||
|
||||
message xtreemfs_rwr_statusRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
// Maximum local object version stored on an OSD.
|
||||
required fixed64 max_local_obj_version = 3;
|
||||
}
|
||||
|
||||
message xtreemfs_rwr_truncateRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required fixed64 new_file_size = 3;
|
||||
required fixed64 object_version = 4;
|
||||
}
|
||||
|
||||
message xtreemfs_rwr_updateRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required fixed64 new_file_size = 3;
|
||||
required fixed64 object_number = 7;
|
||||
required fixed64 object_version = 4;
|
||||
required fixed32 offset = 5;
|
||||
required ObjectData obj = 6;
|
||||
}
|
||||
|
||||
message xtreemfs_internal_get_gmaxRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
}
|
||||
|
||||
message xtreemfs_internal_get_file_sizeRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
}
|
||||
|
||||
message xtreemfs_internal_get_file_sizeResponse {
|
||||
// File size in bytes (as seen by local OSD).
|
||||
required fixed64 file_size = 1;
|
||||
}
|
||||
|
||||
message xtreemfs_internal_read_localRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required fixed64 object_number = 3;
|
||||
required fixed64 object_version = 4;
|
||||
required fixed32 offset = 5;
|
||||
required fixed32 length = 6;
|
||||
required bool attach_object_list = 7;
|
||||
repeated ObjectList required_objects = 8;
|
||||
}
|
||||
|
||||
message xtreemfs_internal_get_object_setRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
}
|
||||
|
||||
message xtreemfs_internal_get_fileid_listResponse {
|
||||
repeated string file_ids = 1;
|
||||
}
|
||||
message lockRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required Lock lock_request = 2;
|
||||
}
|
||||
|
||||
message xtreemfs_pingMesssage {
|
||||
required VivaldiCoordinates coordinates = 1;
|
||||
required bool request_response = 2;
|
||||
}
|
||||
|
||||
message xtreemfs_rwr_auth_stateRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required AuthoritativeReplicaState state = 3;
|
||||
}
|
||||
|
||||
message xtreemfs_rwr_reset_completeRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
required fixed32 primary_epoch = 3;
|
||||
}
|
||||
|
||||
message xtreemfs_xloc_set_invalidateRequest {
|
||||
required FileCredentials file_credentials = 1;
|
||||
required string file_id = 2;
|
||||
}
|
||||
|
||||
message xtreemfs_xloc_set_invalidateResponse {
|
||||
required LeaseState lease_state = 1;
|
||||
optional ReplicaStatus replica_status = 2;
|
||||
}
|
||||
|
||||
// Status of OSD health test
|
||||
enum OSDHealthResult {
|
||||
OSD_HEALTH_RESULT_PASSED = 0;
|
||||
OSD_HEALTH_RESULT_WARNING = 1;
|
||||
OSD_HEALTH_RESULT_FAILED = 2;
|
||||
// Status is not available,
|
||||
// i.e. the test is disabled or an error occurred
|
||||
OSD_HEALTH_RESULT_NOT_AVAIL = 3;
|
||||
}
|
||||
|
||||
service OSDService {
|
||||
|
||||
option(interface_id)=30001;
|
||||
|
||||
// POSIX/FUSE operations ----------------------------------------
|
||||
// See POSIX for details.
|
||||
|
||||
// Client read operation with POSIX semantics.
|
||||
// In case of EOF, read returns less data than requested.
|
||||
rpc read(readRequest) returns(ObjectData) {
|
||||
option(proc_id)=10;
|
||||
option(data_out)=true;
|
||||
};
|
||||
|
||||
// Truncates a file.
|
||||
// OSDWriteResponse may contain new file size, if it changed.
|
||||
// The OSDWriteResponse should be sent to the MRC immediately.
|
||||
rpc truncate(truncateRequest) returns(OSDWriteResponse) {
|
||||
option(proc_id)=11;
|
||||
};
|
||||
|
||||
// Deletes the objects of a file.
|
||||
rpc unlink(unlink_osd_Request) returns(emptyResponse) {
|
||||
option(proc_id)=12;
|
||||
};
|
||||
|
||||
// Client write operation.
|
||||
// If an OSDWriteResponse with a new file size is returned,
|
||||
// it can be cached by the client and relayed to the MRC
|
||||
// at a later point.
|
||||
// However, the cached file size must be considered
|
||||
// when a local process stats the file.
|
||||
// If a fsync or close is truncated, the file size must first
|
||||
// be written to the MRC *before* the call returns.
|
||||
rpc write(writeRequest) returns(OSDWriteResponse) {
|
||||
option(proc_id)=13;
|
||||
option(data_in)=true;
|
||||
};
|
||||
|
||||
// XtreemFS specific ops ----------------------------------------
|
||||
|
||||
// Sent only via UDP. After a write to a striped file that modifies the file size,
|
||||
// an OSD will sent this hint to all other OSDs in the stripe.
|
||||
// These hints are used to handle EOF and holes in sparse files correctly.
|
||||
// However, they are not necessary for correct operations.
|
||||
rpc xtreemfs_broadcast_gmax(xtreemfs_broadcast_gmaxRequest) returns(emptyResponse) {
|
||||
option(proc_id)=20;
|
||||
};
|
||||
|
||||
// The OSD reads the object from the local disk, and if enabled calculates and
|
||||
// compares the checksum.
|
||||
rpc xtreemfs_check_object(xtreemfs_check_objectRequest) returns(ObjectData) {
|
||||
option(proc_id)=21;
|
||||
};
|
||||
|
||||
// Returns the messages produces by the OSD cleanup process. Requires AUTH_PASSWORD.
|
||||
rpc xtreemfs_cleanup_get_results(emptyRequest) returns(xtreemfs_cleanup_get_resultsResponse) {
|
||||
option(proc_id)=30;
|
||||
};
|
||||
|
||||
// Checks if the OSD cleanup process is running. Requires AUTH_PASSWORD.
|
||||
rpc xtreemfs_cleanup_is_running(emptyRequest) returns(xtreemfs_cleanup_is_runningResponse) {
|
||||
option(proc_id)=31;
|
||||
};
|
||||
|
||||
// Starts the OSD cleanup process (removes orphaned objects). Requires AUTH_PASSWORD.
|
||||
rpc xtreemfs_cleanup_start(xtreemfs_cleanup_startRequest) returns(emptyResponse) {
|
||||
option(proc_id)=32;
|
||||
};
|
||||
|
||||
// Returns a short status message of the cleanup process.
|
||||
// Can be used for (G)UIs to report progress. Requires AUTH_PASSWORD.
|
||||
rpc xtreemfs_cleanup_status(emptyRequest) returns(xtreemfs_cleanup_statusResponse) {
|
||||
option(proc_id)=33;
|
||||
};
|
||||
|
||||
// Stops the OSD cleanup process. Requires AUTH_PASSWORD.
|
||||
rpc xtreemfs_cleanup_stop(emptyRequest) returns(emptyResponse) {
|
||||
option(proc_id)=34;
|
||||
};
|
||||
|
||||
// Removes superflous object versions.
|
||||
// Part of the experimental snapshots implementation.
|
||||
rpc xtreemfs_cleanup_versions_start(emptyRequest) returns(emptyResponse) {
|
||||
option(proc_id)=35;
|
||||
};
|
||||
|
||||
// Triggers the OSD to fetch an Object form another Replica.
|
||||
rpc xtreemfs_repair_object(xtreemfs_repair_objectRequest) returns(emptyResponse) {
|
||||
option(proc_id)=36;
|
||||
};
|
||||
|
||||
// Reads a specific object version from the OSD. Used by the read-write replication.
|
||||
rpc xtreemfs_rwr_fetch(xtreemfs_rwr_fetchRequest) returns(ObjectData) {
|
||||
option(proc_id)=73;
|
||||
};
|
||||
|
||||
// Wrapper for flease messages. Flease is used for primary election
|
||||
// in the rw-replication.
|
||||
rpc xtreemfs_rwr_flease_msg(xtreemfs_rwr_flease_msgRequest) returns(emptyResponse) {
|
||||
option(proc_id)=71;
|
||||
option(data_in)=true;
|
||||
};
|
||||
|
||||
// No-op used to inform an OSD that the replica set changed.
|
||||
rpc xtreemfs_rwr_notify(FileCredentials) returns(emptyResponse) {
|
||||
option(proc_id)=75;
|
||||
}
|
||||
|
||||
// Stores the primary epoch on the OSD.
|
||||
rpc xtreemfs_rwr_set_primary_epoch(xtreemfs_rwr_set_primary_epochRequest) returns(ObjectData) {
|
||||
option(proc_id)=78;
|
||||
};
|
||||
|
||||
// Returns the replica status for a file on the local OSD.
|
||||
rpc xtreemfs_rwr_status(xtreemfs_rwr_statusRequest) returns(ReplicaStatus) {
|
||||
option(proc_id)=76;
|
||||
};
|
||||
|
||||
// Executes the truncate on the backup replicas.
|
||||
// A version number must have been assigned by the primary.
|
||||
rpc xtreemfs_rwr_truncate(xtreemfs_rwr_truncateRequest) returns(emptyResponse) {
|
||||
option(proc_id)=74;
|
||||
};
|
||||
|
||||
// Executes the write on the backup replicas.
|
||||
// A version number must have been assigned by the primary.
|
||||
rpc xtreemfs_rwr_update(xtreemfs_rwr_updateRequest) returns(emptyResponse) {
|
||||
option(proc_id)=72;
|
||||
option(data_in)=true;
|
||||
};
|
||||
|
||||
// Sets the authoritative state on a backup OSD.
|
||||
// Only primaries can send this operation.
|
||||
rpc xtreemfs_rwr_auth_state(xtreemfs_rwr_auth_stateRequest) returns(emptyResponse) {
|
||||
option(proc_id)=79;
|
||||
};
|
||||
|
||||
// Informs the primary that a backup has completed the RESET.
|
||||
rpc xtreemfs_rwr_reset_complete(xtreemfs_rwr_reset_completeRequest) returns(emptyResponse) {
|
||||
option(proc_id)=80;
|
||||
};
|
||||
|
||||
// Returns the local file size information on an OSD.
|
||||
// Used to determine the real file size of a striped file.
|
||||
rpc xtreemfs_internal_get_gmax(xtreemfs_internal_get_gmaxRequest) returns(InternalGmax) {
|
||||
option(proc_id)=40;
|
||||
};
|
||||
|
||||
// Truncate operation sent by the head OSD to the other stripes.
|
||||
// Only for striped files.
|
||||
rpc xtreemfs_internal_truncate(truncateRequest) returns(OSDWriteResponse) {
|
||||
option(proc_id)=41;
|
||||
};
|
||||
|
||||
// Returns the file size.
|
||||
rpc xtreemfs_internal_get_file_size(xtreemfs_internal_get_file_sizeRequest) returns(xtreemfs_internal_get_file_sizeResponse) {
|
||||
option(proc_id)=42;
|
||||
};
|
||||
|
||||
// Reads an object from a remote OSD, used by the ronly-replication.
|
||||
rpc xtreemfs_internal_read_local(xtreemfs_internal_read_localRequest) returns(InternalReadLocalResponse) {
|
||||
option(proc_id)=43;
|
||||
};
|
||||
|
||||
// Returns the list of objects that an OSD has stored for a file.
|
||||
rpc xtreemfs_internal_get_object_set(xtreemfs_internal_get_object_setRequest) returns(ObjectList) {
|
||||
option(proc_id)=44;
|
||||
};
|
||||
|
||||
// Returns a list of file ids stored on the OSD.
|
||||
rpc xtreemfs_internal_get_fileid_list(emptyRequest) returns(xtreemfs_internal_get_fileid_listResponse) {
|
||||
option(proc_id)=45;
|
||||
}
|
||||
|
||||
// Acquires a file lock. See POSIX fcntl locks.
|
||||
rpc xtreemfs_lock_acquire(lockRequest) returns(Lock) {
|
||||
option(proc_id)=50;
|
||||
};
|
||||
|
||||
// Checks a file lock. See POSIX fcntl locks.
|
||||
rpc xtreemfs_lock_check(lockRequest) returns(Lock) {
|
||||
option(proc_id)=51;
|
||||
};
|
||||
|
||||
// Releases a file lock. See POSIX fcntl locks.
|
||||
rpc xtreemfs_lock_release(lockRequest) returns(emptyResponse) {
|
||||
option(proc_id)=52;
|
||||
};
|
||||
|
||||
// Simple RPC ping.
|
||||
rpc xtreemfs_ping(xtreemfs_pingMesssage) returns(xtreemfs_pingMesssage) {
|
||||
option(proc_id)=60;
|
||||
};
|
||||
|
||||
// Shuts the OSD down. Requires AUTH_PASSWORD.
|
||||
rpc xtreemfs_shutdown(emptyRequest) returns(emptyResponse) {
|
||||
option(proc_id)=70;
|
||||
};
|
||||
|
||||
// Invalidate the replicas location set.
|
||||
rpc xtreemfs_xloc_set_invalidate(xtreemfs_xloc_set_invalidateRequest) returns(xtreemfs_xloc_set_invalidateResponse) {
|
||||
option(proc_id)=81;
|
||||
};
|
||||
|
||||
// Sets the authoritative state on a replica during an xLocSet change.
|
||||
// This operation invalidets replicas not yet invalidated and does not require
|
||||
// a valid view.
|
||||
rpc xtreemfs_rwr_auth_state_invalidated(xtreemfs_rwr_auth_stateRequest) returns(emptyResponse) {
|
||||
option(proc_id)=82;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user