You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2017/12/14 16:36:47 UTC
[5/6] mesos git commit: Mesos: Used a namespace for UUID.
Mesos: Used a namespace for UUID.
To avoid conflicts when introducing a UUID type in Mesos' namespace,
Stout's UUID type is put in the 'id' namespace.
Review: https://reviews.apache.org/r/64381/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/7467c810
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/7467c810
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/7467c810
Branch: refs/heads/master
Commit: 7467c810ac3fc315482f04a08abcf9bb1d5d8c37
Parents: ae9d103
Author: Jan Schlicht <ja...@mesosphere.io>
Authored: Thu Dec 14 17:28:46 2017 +0100
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Thu Dec 14 17:32:48 2017 +0100
----------------------------------------------------------------------
include/mesos/state/in_memory.hpp | 2 +-
include/mesos/state/leveldb.hpp | 2 +-
include/mesos/state/log.hpp | 2 +-
include/mesos/state/state.hpp | 6 +-
include/mesos/state/storage.hpp | 2 +-
include/mesos/state/zookeeper.hpp | 2 +-
src/checks/checker_process.cpp | 2 +-
src/common/protobuf_utils.cpp | 26 ++---
src/common/protobuf_utils.hpp | 16 +--
src/examples/long_lived_executor.cpp | 6 +-
src/examples/persistent_volume_framework.cpp | 6 +-
src/examples/test_http_executor.cpp | 6 +-
src/exec/exec.cpp | 16 +--
src/executor/executor.cpp | 12 +--
src/launcher/default_executor.cpp | 32 +++---
src/launcher/executor.cpp | 14 +--
src/master/http.cpp | 4 +-
src/master/master.cpp | 99 ++++++++---------
src/master/master.hpp | 30 +++---
src/master/validation.cpp | 4 +-
src/messages/messages.cpp | 7 +-
src/resource_provider/daemon.cpp | 12 +--
src/resource_provider/http_connection.hpp | 18 ++--
src/resource_provider/manager.cpp | 24 ++---
src/resource_provider/message.hpp | 8 +-
src/sched/sched.cpp | 8 +-
src/scheduler/scheduler.cpp | 18 ++--
src/slave/containerizer/docker.cpp | 2 +-
.../containerizer/mesos/io/switchboard.cpp | 2 +-
.../mesos/isolators/volume/secret.cpp | 4 +-
.../mesos/provisioner/provisioner.cpp | 2 +-
src/slave/paths.cpp | 8 +-
src/slave/paths.hpp | 6 +-
src/slave/slave.cpp | 89 +++++++--------
src/slave/slave.hpp | 14 +--
src/slave/state.cpp | 2 +-
src/slave/state.hpp | 2 +-
src/slave/task_status_update_manager.cpp | 24 ++---
src/slave/task_status_update_manager.hpp | 10 +-
src/slave/validation.cpp | 2 +-
src/state/in_memory.cpp | 10 +-
src/state/leveldb.cpp | 14 +--
src/state/log.cpp | 20 ++--
src/state/zookeeper.cpp | 23 ++--
src/status_update_manager/offer_operation.cpp | 26 ++---
src/status_update_manager/offer_operation.hpp | 12 +--
.../status_update_manager_process.hpp | 20 ++--
src/tests/agent_container_api_tests.cpp | 20 ++--
src/tests/api_tests.cpp | 20 ++--
src/tests/container_daemon_tests.cpp | 8 +-
.../composing_containerizer_tests.cpp | 4 +-
.../docker_containerizer_tests.cpp | 26 ++---
.../containerizer/io_switchboard_tests.cpp | 16 +--
src/tests/containerizer/isolator_tests.cpp | 2 +-
.../linux_filesystem_isolator_tests.cpp | 16 +--
.../containerizer/mesos_containerizer_tests.cpp | 52 ++++-----
.../nested_mesos_containerizer_tests.cpp | 108 +++++++++----------
src/tests/containerizer/port_mapping_tests.cpp | 28 ++---
.../containerizer/provisioner_appc_tests.cpp | 14 +--
.../containerizer/provisioner_docker_tests.cpp | 4 +-
.../containerizer/runtime_isolator_tests.cpp | 6 +-
.../volume_host_path_isolator_tests.cpp | 10 +-
.../volume_image_isolator_tests.cpp | 8 +-
.../volume_sandbox_path_isolator_tests.cpp | 14 +--
.../volume_secret_isolator_tests.cpp | 4 +-
src/tests/fault_tolerance_tests.cpp | 4 +-
src/tests/fetcher_tests.cpp | 50 ++++-----
src/tests/master_tests.cpp | 6 +-
src/tests/master_validation_tests.cpp | 20 ++--
src/tests/mesos.cpp | 3 +-
src/tests/mesos.hpp | 12 +--
...er_operation_status_update_manager_tests.cpp | 72 ++++++-------
src/tests/partition_tests.cpp | 32 +++---
src/tests/paths_tests.cpp | 2 +-
src/tests/reconciliation_tests.cpp | 16 +--
src/tests/registrar_tests.cpp | 2 +-
src/tests/resource_provider_manager_tests.cpp | 24 +++--
.../resource_provider_validation_tests.cpp | 12 +--
src/tests/scheduler_event_call_tests.cpp | 3 +-
src/tests/scheduler_http_api_tests.cpp | 2 +-
src/tests/slave_authorization_tests.cpp | 10 +-
src/tests/slave_recovery_tests.cpp | 2 +-
src/tests/slave_tests.cpp | 12 +--
src/tests/slave_validation_tests.cpp | 24 ++---
src/tests/task_status_update_manager_tests.cpp | 2 +-
85 files changed, 685 insertions(+), 661 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/include/mesos/state/in_memory.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/state/in_memory.hpp b/include/mesos/state/in_memory.hpp
index 2032742..3fcf462 100644
--- a/include/mesos/state/in_memory.hpp
+++ b/include/mesos/state/in_memory.hpp
@@ -45,7 +45,7 @@ public:
const std::string& name);
virtual process::Future<bool> set(
const internal::state::Entry& entry,
- const UUID& uuid);
+ const id::UUID& uuid);
virtual process::Future<bool> expunge(const internal::state::Entry& entry);
virtual process::Future<std::set<std::string>> names();
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/include/mesos/state/leveldb.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/state/leveldb.hpp b/include/mesos/state/leveldb.hpp
index 6c732d3..265e08b 100644
--- a/include/mesos/state/leveldb.hpp
+++ b/include/mesos/state/leveldb.hpp
@@ -46,7 +46,7 @@ public:
const std::string& name);
virtual process::Future<bool> set(
const internal::state::Entry& entry,
- const UUID& uuid);
+ const id::UUID& uuid);
virtual process::Future<bool> expunge(const internal::state::Entry& entry);
virtual process::Future<std::set<std::string>> names();
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/include/mesos/state/log.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/state/log.hpp b/include/mesos/state/log.hpp
index ac0312f..54cbdc8 100644
--- a/include/mesos/state/log.hpp
+++ b/include/mesos/state/log.hpp
@@ -48,7 +48,7 @@ public:
const std::string& name);
virtual process::Future<bool> set(
const internal::state::Entry& entry,
- const UUID& uuid);
+ const id::UUID& uuid);
virtual process::Future<bool> expunge(const internal::state::Entry& entry);
virtual process::Future<std::set<std::string>> names();
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/include/mesos/state/state.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/state/state.hpp b/include/mesos/state/state.hpp
index 8f7f3ad..eb42c0e 100644
--- a/include/mesos/state/state.hpp
+++ b/include/mesos/state/state.hpp
@@ -143,7 +143,7 @@ inline process::Future<Variable> State::_fetch(
// UUID and no value to start).
internal::state::Entry entry;
entry.set_name(name);
- entry.set_uuid(UUID::random().toBytes());
+ entry.set_uuid(id::UUID::random().toBytes());
return Variable(entry);
}
@@ -152,13 +152,13 @@ inline process::Future<Variable> State::_fetch(
inline process::Future<Option<Variable>> State::store(const Variable& variable)
{
// Note that we try and swap an entry even if the value didn't change!
- UUID uuid = UUID::fromBytes(variable.entry.uuid()).get();
+ id::UUID uuid = id::UUID::fromBytes(variable.entry.uuid()).get();
// Create a new entry to replace the existing entry provided the
// UUID matches.
internal::state::Entry entry;
entry.set_name(variable.entry.name());
- entry.set_uuid(UUID::random().toBytes());
+ entry.set_uuid(id::UUID::random().toBytes());
entry.set_value(variable.entry.value());
return storage->set(entry, uuid)
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/include/mesos/state/storage.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/state/storage.hpp b/include/mesos/state/storage.hpp
index 2bfa047..c1ff390 100644
--- a/include/mesos/state/storage.hpp
+++ b/include/mesos/state/storage.hpp
@@ -44,7 +44,7 @@ public:
const std::string& name) = 0;
virtual process::Future<bool> set(
const internal::state::Entry& entry,
- const UUID& uuid) = 0;
+ const id::UUID& uuid) = 0;
// Returns true if successfully expunged the variable from the state.
virtual process::Future<bool> expunge(
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/include/mesos/state/zookeeper.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/state/zookeeper.hpp b/include/mesos/state/zookeeper.hpp
index 8d8c19c..fee9398 100644
--- a/include/mesos/state/zookeeper.hpp
+++ b/include/mesos/state/zookeeper.hpp
@@ -53,7 +53,7 @@ public:
const std::string& name);
virtual process::Future<bool> set(
const internal::state::Entry& entry,
- const UUID& uuid);
+ const id::UUID& uuid);
virtual process::Future<bool> expunge(const internal::state::Entry& entry);
virtual process::Future<std::set<std::string>> names();
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/checks/checker_process.cpp
----------------------------------------------------------------------
diff --git a/src/checks/checker_process.cpp b/src/checks/checker_process.cpp
index 496bd41..ddb197b 100644
--- a/src/checks/checker_process.cpp
+++ b/src/checks/checker_process.cpp
@@ -545,7 +545,7 @@ void CheckerProcess::__nestedCommandCheck(
http::Connection connection)
{
ContainerID checkContainerId;
- checkContainerId.set_value("check-" + UUID::random().toString());
+ checkContainerId.set_value("check-" + id::UUID::random().toString());
checkContainerId.mutable_parent()->CopyFrom(taskContainerId.get());
previousCheckContainerId = checkContainerId;
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/common/protobuf_utils.cpp
----------------------------------------------------------------------
diff --git a/src/common/protobuf_utils.cpp b/src/common/protobuf_utils.cpp
index 3bc72e4..3bd5bae 100644
--- a/src/common/protobuf_utils.cpp
+++ b/src/common/protobuf_utils.cpp
@@ -107,7 +107,7 @@ StatusUpdate createStatusUpdate(
const TaskID& taskId,
const TaskState& state,
const TaskStatus::Source& source,
- const Option<UUID>& uuid,
+ const Option<id::UUID>& uuid,
const string& message,
const Option<TaskStatus::Reason>& reason,
const Option<ExecutorID>& executorId,
@@ -234,7 +234,7 @@ StatusUpdate createStatusUpdate(
TaskStatus createTaskStatus(
const TaskID& taskId,
const TaskState& state,
- const UUID& uuid,
+ const id::UUID& uuid,
double timestamp)
{
TaskStatus status;
@@ -250,7 +250,7 @@ TaskStatus createTaskStatus(
TaskStatus createTaskStatus(
TaskStatus status,
- const UUID& uuid,
+ const id::UUID& uuid,
double timestamp,
const Option<TaskState>& state,
const Option<string>& message,
@@ -420,7 +420,7 @@ OfferOperationStatus createOfferOperationStatus(
const Option<OfferOperationID>& operationId,
const Option<string>& message,
const Option<Resources>& convertedResources,
- const Option<UUID>& statusUUID)
+ const Option<id::UUID>& statusUUID)
{
OfferOperationStatus status;
status.set_state(state);
@@ -450,7 +450,7 @@ OfferOperation createOfferOperation(
const OfferOperationStatus& latestStatus,
const Option<FrameworkID>& frameworkId,
const Option<SlaveID>& slaveId,
- const Option<UUID>& operationUUID)
+ const Option<id::UUID>& operationUUID)
{
OfferOperation operation;
if (frameworkId.isSome()) {
@@ -464,7 +464,7 @@ OfferOperation createOfferOperation(
if (operationUUID.isSome()) {
operation.set_operation_uuid(operationUUID->toBytes());
} else {
- operation.set_operation_uuid(UUID::random().toBytes());
+ operation.set_operation_uuid(id::UUID::random().toBytes());
}
return operation;
@@ -472,7 +472,7 @@ OfferOperation createOfferOperation(
OfferOperationStatusUpdate createOfferOperationStatusUpdate(
- const UUID& operationUUID,
+ const id::UUID& operationUUID,
const OfferOperationStatus& status,
const Option<OfferOperationStatus>& latestStatus,
const Option<FrameworkID>& frameworkId,
@@ -514,7 +514,7 @@ OfferOperationStatusUpdate createOfferOperationStatusUpdate(
MasterInfo createMasterInfo(const UPID& pid)
{
MasterInfo info;
- info.set_id(stringify(pid) + "-" + UUID::random().toString());
+ info.set_id(stringify(pid) + "-" + id::UUID::random().toString());
// NOTE: Currently, we store the ip in network order, which should
// be fixed. See MESOS-1201 for more details.
@@ -856,13 +856,13 @@ bool isSpeculativeOperation(const Offer::Operation& operation)
RepeatedPtrField<ResourceVersionUUID> createResourceVersions(
- const hashmap<Option<ResourceProviderID>, UUID>& resourceVersions)
+ const hashmap<Option<ResourceProviderID>, id::UUID>& resourceVersions)
{
RepeatedPtrField<ResourceVersionUUID> result;
foreachpair (
const Option<ResourceProviderID>& resourceProviderId,
- const UUID& uuid,
+ const id::UUID& uuid,
resourceVersions) {
ResourceVersionUUID* entry = result.Add();
@@ -876,10 +876,10 @@ RepeatedPtrField<ResourceVersionUUID> createResourceVersions(
}
-hashmap<Option<ResourceProviderID>, UUID> parseResourceVersions(
+hashmap<Option<ResourceProviderID>, id::UUID> parseResourceVersions(
const RepeatedPtrField<ResourceVersionUUID>& resourceVersionUUIDs)
{
- hashmap<Option<ResourceProviderID>, UUID> result;
+ hashmap<Option<ResourceProviderID>, id::UUID> result;
foreach (
const ResourceVersionUUID& resourceVersionUUID,
@@ -891,7 +891,7 @@ hashmap<Option<ResourceProviderID>, UUID> parseResourceVersions(
CHECK(!result.contains(resourceProviderId));
- const Try<UUID> uuid = UUID::fromBytes(resourceVersionUUID.uuid());
+ const Try<id::UUID> uuid = id::UUID::fromBytes(resourceVersionUUID.uuid());
CHECK_SOME(uuid);
result.insert({std::move(resourceProviderId), std::move(uuid.get())});
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/common/protobuf_utils.hpp
----------------------------------------------------------------------
diff --git a/src/common/protobuf_utils.hpp b/src/common/protobuf_utils.hpp
index 03b7caf..e112f19 100644
--- a/src/common/protobuf_utils.hpp
+++ b/src/common/protobuf_utils.hpp
@@ -81,7 +81,7 @@ StatusUpdate createStatusUpdate(
const TaskID& taskId,
const TaskState& state,
const TaskStatus::Source& source,
- const Option<UUID>& uuid,
+ const Option<id::UUID>& uuid,
const std::string& message = "",
const Option<TaskStatus::Reason>& reason = None(),
const Option<ExecutorID>& executorId = None(),
@@ -104,7 +104,7 @@ StatusUpdate createStatusUpdate(
TaskStatus createTaskStatus(
const TaskID& taskId,
const TaskState& state,
- const UUID& uuid,
+ const id::UUID& uuid,
double timestamp);
@@ -121,7 +121,7 @@ TaskStatus createTaskStatus(
// delivered previously.
TaskStatus createTaskStatus(
TaskStatus status,
- const UUID& uuid,
+ const id::UUID& uuid,
double timestamp,
const Option<TaskState>& state = None(),
const Option<std::string>& message = None(),
@@ -158,7 +158,7 @@ OfferOperationStatus createOfferOperationStatus(
const Option<OfferOperationID>& operationId = None(),
const Option<std::string>& message = None(),
const Option<Resources>& convertedResources = None(),
- const Option<UUID>& statusUUID = None());
+ const Option<id::UUID>& statusUUID = None());
OfferOperation createOfferOperation(
@@ -166,11 +166,11 @@ OfferOperation createOfferOperation(
const OfferOperationStatus& latestStatus,
const Option<FrameworkID>& frameworkId,
const Option<SlaveID>& slaveId,
- const Option<UUID>& operationUUID = None());
+ const Option<id::UUID>& operationUUID = None());
OfferOperationStatusUpdate createOfferOperationStatusUpdate(
- const UUID& operationUUID,
+ const id::UUID& operationUUID,
const OfferOperationStatus& status,
const Option<OfferOperationStatus>& latestStatus = None(),
const Option<FrameworkID>& frameworkId = None(),
@@ -217,11 +217,11 @@ bool isSpeculativeOperation(const Offer::Operation& operation);
// Helper function to pack a protobuf list of resource versions.
google::protobuf::RepeatedPtrField<ResourceVersionUUID> createResourceVersions(
- const hashmap<Option<ResourceProviderID>, UUID>& resourceVersions);
+ const hashmap<Option<ResourceProviderID>, id::UUID>& resourceVersions);
// Helper function to unpack a protobuf list of resource versions.
-hashmap<Option<ResourceProviderID>, UUID> parseResourceVersions(
+hashmap<Option<ResourceProviderID>, id::UUID> parseResourceVersions(
const google::protobuf::RepeatedPtrField<ResourceVersionUUID>&
resourceVersionUUIDs);
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/examples/long_lived_executor.cpp
----------------------------------------------------------------------
diff --git a/src/examples/long_lived_executor.cpp b/src/examples/long_lived_executor.cpp
index 319db93..21b511d 100644
--- a/src/examples/long_lived_executor.cpp
+++ b/src/examples/long_lived_executor.cpp
@@ -118,7 +118,7 @@ protected:
case Event::ACKNOWLEDGED: {
// Remove the corresponding update.
- updates.erase(UUID::fromBytes(event.acknowledged().uuid()).get());
+ updates.erase(id::UUID::fromBytes(event.acknowledged().uuid()).get());
// Remove the corresponding task.
tasks.erase(event.acknowledged().task_id());
@@ -175,7 +175,7 @@ protected:
void update(const TaskInfo& task, const TaskState& state)
{
- UUID uuid = UUID::random();
+ id::UUID uuid = id::UUID::random();
TaskStatus status;
status.mutable_task_id()->CopyFrom(task.task_id());
@@ -227,7 +227,7 @@ private:
SUBSCRIBED
} state;
- LinkedHashMap<UUID, Call::Update> updates; // Unacknowledged updates.
+ LinkedHashMap<id::UUID, Call::Update> updates; // Unacknowledged updates.
LinkedHashMap<TaskID, TaskInfo> tasks; // Unacknowledged tasks.
};
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/examples/persistent_volume_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/persistent_volume_framework.cpp b/src/examples/persistent_volume_framework.cpp
index 9ccc7eb..71db39d 100644
--- a/src/examples/persistent_volume_framework.cpp
+++ b/src/examples/persistent_volume_framework.cpp
@@ -211,7 +211,7 @@ public:
if (offered.contains(shard.resources)) {
Resource volume = SHARD_PERSISTENT_VOLUME(
role,
- UUID::random().toString(),
+ id::UUID::random().toString(),
"volume",
frameworkInfo.principal(),
shard.volume.isShared);
@@ -221,7 +221,7 @@ public:
TaskInfo task;
task.set_name(shard.name);
- task.mutable_task_id()->set_value(UUID::random().toString());
+ task.mutable_task_id()->set_value(id::UUID::random().toString());
task.mutable_slave_id()->CopyFrom(offer.slave_id());
task.mutable_resources()->CopyFrom(resources.get());
@@ -269,7 +269,7 @@ public:
TaskInfo task;
task.set_name(shard.name);
- task.mutable_task_id()->set_value(UUID::random().toString());
+ task.mutable_task_id()->set_value(id::UUID::random().toString());
task.mutable_slave_id()->CopyFrom(offer.slave_id());
task.mutable_resources()->CopyFrom(taskResources);
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/examples/test_http_executor.cpp
----------------------------------------------------------------------
diff --git a/src/examples/test_http_executor.cpp b/src/examples/test_http_executor.cpp
index 2166faf..fb9209f 100644
--- a/src/examples/test_http_executor.cpp
+++ b/src/examples/test_http_executor.cpp
@@ -105,7 +105,7 @@ public:
void sendStatusUpdate(const TaskInfo& task, const TaskState& state)
{
- UUID uuid = UUID::random();
+ id::UUID uuid = id::UUID::random();
TaskStatus status;
status.mutable_task_id()->CopyFrom(task.task_id());
@@ -173,7 +173,7 @@ public:
cout << "Received an ACKNOWLEDGED event" << endl;
// Remove the corresponding update.
- updates.erase(UUID::fromBytes(event.acknowledged().uuid()).get());
+ updates.erase(id::UUID::fromBytes(event.acknowledged().uuid()).get());
// Remove the corresponding task.
tasks.erase(event.acknowledged().task_id());
@@ -226,7 +226,7 @@ private:
SUBSCRIBED
} state;
- LinkedHashMap<UUID, Call::Update> updates; // Unacknowledged updates.
+ LinkedHashMap<id::UUID, Call::Update> updates; // Unacknowledged updates.
LinkedHashMap<TaskID, TaskInfo> tasks; // Unacknowledged tasks.
};
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/exec/exec.cpp
----------------------------------------------------------------------
diff --git a/src/exec/exec.cpp b/src/exec/exec.cpp
index cdbf149..7fc46da 100644
--- a/src/exec/exec.cpp
+++ b/src/exec/exec.cpp
@@ -149,7 +149,7 @@ public:
frameworkId(_frameworkId),
executorId(_executorId),
connected(false),
- connection(UUID::random()),
+ connection(id::UUID::random()),
local(_local),
aborted(false),
mutex(_mutex),
@@ -237,7 +237,7 @@ protected:
LOG(INFO) << "Executor registered on agent " << slaveId;
connected = true;
- connection = UUID::random();
+ connection = id::UUID::random();
Stopwatch stopwatch;
if (FLAGS_v >= 1) {
@@ -260,7 +260,7 @@ protected:
LOG(INFO) << "Executor re-registered on agent " << slaveId;
connected = true;
- connection = UUID::random();
+ connection = id::UUID::random();
Stopwatch stopwatch;
if (FLAGS_v >= 1) {
@@ -366,7 +366,7 @@ protected:
const TaskID& taskId,
const string& uuid)
{
- Try<UUID> uuid_ = UUID::fromBytes(uuid);
+ Try<id::UUID> uuid_ = id::UUID::fromBytes(uuid);
CHECK_SOME(uuid_);
if (aborted.load()) {
@@ -475,7 +475,7 @@ protected:
}
}
- void _recoveryTimeout(UUID _connection)
+ void _recoveryTimeout(id::UUID _connection)
{
// If we're connected, no need to shut down the driver!
if (connected) {
@@ -560,7 +560,7 @@ protected:
// We overwrite the UUID for this status update, however with
// the HTTP API, the executor will have to generate a UUID
// (which needs to be validated to be RFC-4122 compliant).
- UUID uuid = UUID::random();
+ id::UUID uuid = id::UUID::random();
update->set_uuid(uuid.toBytes());
update->mutable_status()->set_uuid(uuid.toBytes());
@@ -596,7 +596,7 @@ private:
FrameworkID frameworkId;
ExecutorID executorId;
bool connected; // Registered with the slave.
- UUID connection; // UUID to identify the connection instance.
+ id::UUID connection; // UUID to identify the connection instance.
bool local;
std::atomic_bool aborted;
std::recursive_mutex* mutex;
@@ -606,7 +606,7 @@ private:
Duration recoveryTimeout;
Duration shutdownGracePeriod;
- LinkedHashMap<UUID, StatusUpdate> updates; // Unacknowledged updates.
+ LinkedHashMap<id::UUID, StatusUpdate> updates; // Unacknowledged updates.
// We store tasks that have not been acknowledged
// (via status updates) by the slave. This ensures that, during
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/executor/executor.cpp
----------------------------------------------------------------------
diff --git a/src/executor/executor.cpp b/src/executor/executor.cpp
index 7280951..1c972d9 100644
--- a/src/executor/executor.cpp
+++ b/src/executor/executor.cpp
@@ -353,14 +353,14 @@ protected:
{
CHECK(state == DISCONNECTED || state == CONNECTING) << state;
- connectionId = UUID::random();
+ connectionId = id::UUID::random();
state = CONNECTING;
// This automatic variable is needed for lambda capture. We need to
// create a copy here because `connectionId` might change by the time the
// second `http::connect()` gets called.
- UUID connectionId_ = connectionId.get();
+ id::UUID connectionId_ = connectionId.get();
// We create two persistent connections here, one for subscribe
// call/streaming response and another for non-subscribe calls/responses.
@@ -377,7 +377,7 @@ protected:
}
void connected(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const Future<Connection>& connection1,
const Future<Connection>& connection2)
{
@@ -445,7 +445,7 @@ protected:
}
void disconnected(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const string& failure)
{
// Ignore if the disconnection happened from an old stale connection.
@@ -580,7 +580,7 @@ protected:
}
void _send(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const Call& call,
const Future<Response>& response)
{
@@ -805,7 +805,7 @@ private:
// the agent (e.g., the agent process restarted while an attempt was in
// progress). This helps us in uniquely identifying the current connection
// instance and ignoring the stale instance.
- Option<UUID> connectionId; // UUID to identify the connection instance.
+ Option<id::UUID> connectionId; // UUID to identify the connection instance.
ContentType contentType;
Callbacks callbacks;
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/launcher/default_executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/default_executor.cpp b/src/launcher/default_executor.cpp
index 248c46d..6c88de4 100644
--- a/src/launcher/default_executor.cpp
+++ b/src/launcher/default_executor.cpp
@@ -153,7 +153,7 @@ public:
void connected()
{
state = CONNECTED;
- connectionId = UUID::random();
+ connectionId = id::UUID::random();
doReliableRegistration();
}
@@ -245,7 +245,8 @@ public:
}
case Event::ACKNOWLEDGED: {
- const UUID uuid = UUID::fromBytes(event.acknowledged().uuid()).get();
+ const id::UUID uuid =
+ id::UUID::fromBytes(event.acknowledged().uuid()).get();
if (!unacknowledgedUpdates.contains(uuid)) {
LOG(WARNING) << "Received acknowledgement " << uuid
@@ -406,7 +407,7 @@ protected:
foreach (const TaskInfo& task, taskGroup.tasks()) {
ContainerID containerId;
- containerId.set_value(UUID::random().toString());
+ containerId.set_value(id::UUID::random().toString());
containerId.mutable_parent()->CopyFrom(executorContainerId.get());
containerIds.push_back(containerId);
@@ -664,7 +665,7 @@ protected:
void _wait(
const Future<list<Connection>>& _connections,
const list<TaskID>& taskIds,
- const UUID& _connectionId)
+ const id::UUID& _connectionId)
{
// It is possible that the agent process failed in the interim.
// We would resume waiting on the child containers once we
@@ -695,7 +696,7 @@ protected:
}
void __wait(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const Connection& connection,
const TaskID& taskId)
{
@@ -734,7 +735,7 @@ protected:
}
void waited(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const TaskID& taskId,
const Future<Response>& response)
{
@@ -1122,7 +1123,7 @@ protected:
}
void escalated(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const ContainerID& containerId,
const TaskID& taskId,
const Duration& timeout)
@@ -1219,7 +1220,7 @@ protected:
CHECK_SOME(containers.at(taskId)->lastTaskStatus);
const TaskStatus status = protobuf::createTaskStatus(
containers.at(taskId)->lastTaskStatus.get(),
- UUID::random(),
+ id::UUID::random(),
Clock::now().secs(),
None(),
None(),
@@ -1270,7 +1271,7 @@ protected:
CHECK_SOME(containers.at(healthStatus.task_id())->lastTaskStatus);
const TaskStatus status = protobuf::createTaskStatus(
containers.at(healthStatus.task_id())->lastTaskStatus.get(),
- UUID::random(),
+ id::UUID::random(),
Clock::now().secs(),
None(),
None(),
@@ -1300,7 +1301,7 @@ private:
TaskStatus status = protobuf::createTaskStatus(
taskId,
state,
- UUID::random(),
+ id::UUID::random(),
Clock::now().secs());
status.mutable_executor_id()->CopyFrom(executorId);
@@ -1370,7 +1371,8 @@ private:
call.mutable_update()->mutable_status()->CopyFrom(status);
// Capture the status update.
- unacknowledgedUpdates[UUID::fromBytes(status.uuid()).get()] = call.update();
+ unacknowledgedUpdates[id::UUID::fromBytes(status.uuid()).get()] =
+ call.update();
// Overwrite the last task status.
CHECK(containers.contains(status.task_id()));
@@ -1403,7 +1405,7 @@ private:
: process::http::request(request);
}
- void retry(const UUID& _connectionId, const TaskID& taskId)
+ void retry(const id::UUID& _connectionId, const TaskID& taskId)
{
if (connectionId != _connectionId) {
VLOG(1) << "Ignoring retry attempt from a stale connection";
@@ -1422,7 +1424,7 @@ private:
void _retry(
const Future<Connection>& connection,
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const TaskID& taskId)
{
const Duration duration = Seconds(1);
@@ -1491,7 +1493,7 @@ private:
const string launcherDirectory;
const Option<string> authorizationHeader;
- LinkedHashMap<UUID, Call::Update> unacknowledgedUpdates;
+ LinkedHashMap<id::UUID, Call::Update> unacknowledgedUpdates;
// Child containers.
LinkedHashMap<TaskID, Owned<Container>> containers;
@@ -1501,7 +1503,7 @@ private:
// uniquely identifying the current connection and ignoring
// the stale instance. We initialize this to a new value upon receiving
// a `connected()` callback.
- Option<UUID> connectionId;
+ Option<id::UUID> connectionId;
};
} // namespace internal {
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index c688c04..31a4710 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -204,7 +204,8 @@ public:
}
case Event::ACKNOWLEDGED: {
- const UUID uuid = UUID::fromBytes(event.acknowledged().uuid()).get();
+ const id::UUID uuid =
+ id::UUID::fromBytes(event.acknowledged().uuid()).get();
if (!unacknowledgedUpdates.contains(uuid)) {
LOG(WARNING) << "Received acknowledgement " << uuid
@@ -308,7 +309,7 @@ protected:
CHECK_SOME(lastTaskStatus);
TaskStatus status = protobuf::createTaskStatus(
lastTaskStatus.get(),
- UUID::random(),
+ id::UUID::random(),
Clock::now().secs(),
None(),
None(),
@@ -342,7 +343,7 @@ protected:
CHECK_SOME(lastTaskStatus);
TaskStatus status = protobuf::createTaskStatus(
lastTaskStatus.get(),
- UUID::random(),
+ id::UUID::random(),
Clock::now().secs(),
None(),
None(),
@@ -1000,7 +1001,7 @@ private:
TaskStatus status = protobuf::createTaskStatus(
_taskId,
state,
- UUID::random(),
+ id::UUID::random(),
Clock::now().secs());
status.mutable_executor_id()->CopyFrom(executorId);
@@ -1059,7 +1060,8 @@ private:
call.mutable_update()->mutable_status()->CopyFrom(status);
// Capture the status update.
- unacknowledgedUpdates[UUID::fromBytes(status.uuid()).get()] = call.update();
+ unacknowledgedUpdates[id::UUID::fromBytes(status.uuid()).get()] =
+ call.update();
// Overwrite the last task status.
lastTaskStatus = status;
@@ -1134,7 +1136,7 @@ private:
const ExecutorID executorId;
Owned<MesosBase> mesos;
- LinkedHashMap<UUID, Call::Update> unacknowledgedUpdates;
+ LinkedHashMap<id::UUID, Call::Update> unacknowledgedUpdates;
Option<TaskStatus> lastTaskStatus;
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/master/http.cpp
----------------------------------------------------------------------
diff --git a/src/master/http.cpp b/src/master/http.cpp
index 21de4bc..ec170a2 100644
--- a/src/master/http.cpp
+++ b/src/master/http.cpp
@@ -878,7 +878,7 @@ Future<Response> Master::Http::subscribe(
ok.type = Response::PIPE;
ok.reader = pipe.reader();
- HttpConnection http{pipe.writer(), contentType, UUID::random()};
+ HttpConnection http{pipe.writer(), contentType, id::UUID::random()};
master->subscribe(http, principal);
mesos::master::Event event;
@@ -1058,7 +1058,7 @@ Future<Response> Master::Http::scheduler(
ok.reader = pipe.reader();
// Generate a stream ID and return it in the response.
- UUID streamId = UUID::random();
+ id::UUID streamId = id::UUID::random();
ok.headers["Mesos-Stream-Id"] = streamId.toString();
HttpConnection http {pipe.writer(), acceptType, streamId};
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 2f2608f..a8353ab 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -328,7 +328,7 @@ Master::Master(
// because 'StandaloneMasterDetector' needs access to the info.
// Master ID is generated randomly based on UUID.
- info_.set_id(UUID::random().toString());
+ info_.set_id(id::UUID::random().toString());
// NOTE: Currently, we store ip in MasterInfo in network order,
// which should be fixed. See MESOS-1201 for details.
@@ -2490,7 +2490,7 @@ void Master::receive(
break;
case scheduler::Call::ACKNOWLEDGE: {
- Try<UUID> uuid = UUID::fromBytes(call.acknowledge().uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(call.acknowledge().uuid());
if (uuid.isError()) {
drop(from, call, uuid.error());
return;
@@ -2501,7 +2501,7 @@ void Master::receive(
}
case scheduler::Call::ACKNOWLEDGE_OFFER_OPERATION_UPDATE: {
- Try<UUID> uuid = UUID::fromBytes(
+ Try<id::UUID> uuid = id::UUID::fromBytes(
call.acknowledge_offer_operation_update().status_uuid());
if (uuid.isError()) {
drop(from, call, uuid.error());
@@ -5766,7 +5766,7 @@ void Master::statusUpdateAcknowledgement(
// important as validation logic is moved out of the scheduler
// driver and into the master.
- Try<UUID> uuid_ = UUID::fromBytes(uuid);
+ Try<id::UUID> uuid_ = id::UUID::fromBytes(uuid);
if (uuid_.isError()) {
LOG(WARNING)
<< "Ignoring status update acknowledgement "
@@ -5817,7 +5817,7 @@ void Master::acknowledge(
const SlaveID& slaveId = acknowledge.slave_id();
const TaskID& taskId = acknowledge.task_id();
- const UUID uuid = UUID::fromBytes(acknowledge.uuid()).get();
+ const id::UUID uuid = id::UUID::fromBytes(acknowledge.uuid()).get();
Slave* slave = slaves.registered.get(slaveId);
@@ -5869,7 +5869,7 @@ void Master::acknowledge(
// Remove the task once the terminal update is acknowledged.
if (protobuf::isTerminalState(task->status_update_state()) &&
- UUID::fromBytes(task->status_update_uuid()).get() == uuid) {
+ id::UUID::fromBytes(task->status_update_uuid()).get() == uuid) {
removeTask(task);
}
}
@@ -6297,9 +6297,9 @@ void Master::__registerSlave(
vector<Resource> checkpointedResources = google::protobuf::convert(
std::move(*registerSlaveMessage.mutable_checkpointed_resources()));
- Option<UUID> resourceVersion;
+ Option<id::UUID> resourceVersion;
if (registerSlaveMessage.has_resource_version_uuid()) {
- Try<UUID> uuid = UUID::fromBytes(
+ Try<id::UUID> uuid = id::UUID::fromBytes(
registerSlaveMessage.resource_version_uuid());
CHECK_SOME(uuid);
@@ -6850,9 +6850,9 @@ void Master::__reregisterSlave(
vector<ExecutorInfo> executorInfos = google::protobuf::convert(
std::move(*reregisterSlaveMessage.mutable_executor_infos()));
- Option<UUID> resourceVersion;
+ Option<id::UUID> resourceVersion;
if (reregisterSlaveMessage.has_resource_version_uuid()) {
- Try<UUID> uuid = UUID::fromBytes(
+ Try<id::UUID> uuid = id::UUID::fromBytes(
reregisterSlaveMessage.resource_version_uuid());
CHECK_SOME(uuid);
@@ -6994,9 +6994,9 @@ void Master::___reregisterSlave(
const vector<SlaveInfo::Capability> agentCapabilities =
google::protobuf::convert(reregisterSlaveMessage.agent_capabilities());
- Option<UUID> resourceVersion;
+ Option<id::UUID> resourceVersion;
if (reregisterSlaveMessage.has_resource_version_uuid()) {
- Try<UUID> uuid = UUID::fromBytes(
+ Try<id::UUID> uuid = id::UUID::fromBytes(
reregisterSlaveMessage.resource_version_uuid());
CHECK_SOME(uuid);
@@ -7299,10 +7299,10 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
if (slave->capabilities.resourceProvider) {
CHECK(message.has_resource_version_uuid());
- hashmap<Option<ResourceProviderID>, UUID> resourceVersions;
+ hashmap<Option<ResourceProviderID>, id::UUID> resourceVersions;
- const Try<UUID> slaveResourceVersion =
- UUID::fromBytes(message.resource_version_uuid());
+ const Try<id::UUID> slaveResourceVersion =
+ id::UUID::fromBytes(message.resource_version_uuid());
CHECK_SOME(slaveResourceVersion);
resourceVersions.insert({None(), slaveResourceVersion.get()});
@@ -7314,8 +7314,8 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
continue;
}
- Try<UUID> resourceVersion =
- UUID::fromBytes(resourceProvider.resource_version_uuid());
+ Try<id::UUID> resourceVersion =
+ id::UUID::fromBytes(resourceProvider.resource_version_uuid());
CHECK_SOME(resourceVersion);
@@ -7333,13 +7333,14 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
}
// Check if the known offer operations for this agent changed.
- const hashset<UUID> knownOfferOperations = slave->offerOperations.keys();
- hashset<UUID> receivedOfferOperations;
+ const hashset<id::UUID> knownOfferOperations = slave->offerOperations.keys();
+ hashset<id::UUID> receivedOfferOperations;
foreach (
const OfferOperation& operation,
message.offer_operations().operations()) {
- Try<UUID> operationUuid = UUID::fromBytes(operation.operation_uuid());
+ Try<id::UUID> operationUuid =
+ id::UUID::fromBytes(operation.operation_uuid());
CHECK_SOME(operationUuid);
receivedOfferOperations.insert(operationUuid.get());
}
@@ -7351,7 +7352,8 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
foreach (
const OfferOperation& operation,
resourceProvider.operations().operations()) {
- Try<UUID> operationUuid = UUID::fromBytes(operation.operation_uuid());
+ Try<id::UUID> operationUuid =
+ id::UUID::fromBytes(operation.operation_uuid());
CHECK_SOME(operationUuid);
receivedOfferOperations.insert(operationUuid.get());
}
@@ -7370,8 +7372,8 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
{
Option<Resources> oldTotal;
Option<Resources> newTotal;
- Option<hashmap<UUID, OfferOperation>> oldOfferOperations;
- Option<hashmap<UUID, OfferOperation>> newOfferOperations;
+ Option<hashmap<id::UUID, OfferOperation>> oldOfferOperations;
+ Option<hashmap<id::UUID, OfferOperation>> newOfferOperations;
Option<ResourceProviderInfo> info;
};
@@ -7409,7 +7411,7 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
// Process known offer operations.
foreachpair (
- const UUID& uuid,
+ const id::UUID& uuid,
OfferOperation* operation,
slave->offerOperations) {
Result<ResourceProviderID> providerId_ =
@@ -7428,7 +7430,7 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
// create a record for this resource provider if needed.
if (resourceProviders[providerId].oldOfferOperations.isNone()) {
resourceProviders.at(providerId).oldOfferOperations =
- hashmap<UUID, OfferOperation>();
+ hashmap<id::UUID, OfferOperation>();
}
resourceProviders.at(providerId)
@@ -7441,12 +7443,12 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
// Process received agent offer operations.
resourceProviders[None()].newOfferOperations =
- hashmap<UUID, OfferOperation>();
+ hashmap<id::UUID, OfferOperation>();
foreach (
const OfferOperation& operation,
message.offer_operations().operations()) {
- Try<UUID> uuid = UUID::fromBytes(operation.operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(operation.operation_uuid());
CHECK_SOME(uuid) << "Could not deserialize operation id when reconciling "
"offer operations";
@@ -7469,13 +7471,13 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
provider.newTotal = resourceProvider.total_resources();
if (provider.newOfferOperations.isNone()) {
- provider.newOfferOperations = hashmap<UUID, OfferOperation>();
+ provider.newOfferOperations = hashmap<id::UUID, OfferOperation>();
}
foreach (
const OfferOperation& operation,
resourceProvider.operations().operations()) {
- Try<UUID> uuid = UUID::fromBytes(operation.operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(operation.operation_uuid());
CHECK_SOME(uuid)
<< "Could not deserialize operation id when reconciling "
"offer operations";
@@ -7508,10 +7510,10 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
// acknowledgement, or the agent initiates an unrelated
// `UpdateSlaveMessage`.
auto extractPendingOperations =
- [](const hashmap<UUID, OfferOperation>& source,
- hashset<UUID>* target) {
+ [](const hashmap<id::UUID, OfferOperation>& source,
+ hashset<id::UUID>* target) {
foreachpair (
- const UUID& uuid, const OfferOperation& operation, source) {
+ const id::UUID& uuid, const OfferOperation& operation, source) {
if (!protobuf::isTerminalState(
operation.latest_status().state())) {
target->insert(uuid);
@@ -7519,8 +7521,8 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
}
};
- hashset<UUID> oldPendingOperations;
- hashset<UUID> newPendingOperations;
+ hashset<id::UUID> oldPendingOperations;
+ hashset<id::UUID> newPendingOperations;
if (provider.oldOfferOperations.isSome()) {
extractPendingOperations(
@@ -7532,7 +7534,7 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
provider.newOfferOperations.get(), &newPendingOperations);
}
- foreach (const UUID& uuid, newPendingOperations) {
+ foreach (const id::UUID& uuid, newPendingOperations) {
CHECK(oldPendingOperations.contains(uuid))
<< "Agent tried to reconcile unknown non-terminal offer "
"operation "
@@ -7612,7 +7614,7 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
if (provider.newOfferOperations.isSome()) {
foreachpair (
- const UUID& uuid,
+ const id::UUID& uuid,
const OfferOperation& operation,
provider.newOfferOperations.get()) {
// Update to bookkeeping of operations.
@@ -7648,7 +7650,7 @@ void Master::updateSlave(UpdateSlaveMessage&& message)
// generated and the master will remove the operation from its state upon
// receipt of that update.
if (provider.oldOfferOperations.isSome()) {
- foreachkey (const UUID& uuid, provider.oldOfferOperations.get()) {
+ foreachkey (const id::UUID& uuid, provider.oldOfferOperations.get()) {
if (provider.newOfferOperations.isNone() ||
!provider.newOfferOperations->contains(uuid)) {
LOG(WARNING) << "Performing explicit reconciliation with agent for"
@@ -7839,7 +7841,7 @@ void Master::statusUpdate(StatusUpdate update, const UPID& pid)
return;
}
- Try<UUID> uuid = UUID::fromBytes(update.uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(update.uuid());
if (uuid.isError()) {
LOG(WARNING) << "Ignoring status update "
<< " from agent " << *slave
@@ -7940,7 +7942,7 @@ void Master::offerOperationStatusUpdate(
? update.framework_id()
: Option<FrameworkID>::none();
- Try<UUID> uuid = UUID::fromBytes(update.operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(update.operation_uuid());
if (uuid.isError()) {
LOG(ERROR) << "Failed to parse offer operation UUID for operation "
<< "'" << update.status().operation_id() << "' for "
@@ -10356,7 +10358,7 @@ void Master::updateOfferOperation(
operation->add_statuses()->CopyFrom(status);
- Try<UUID> uuid = UUID::fromBytes(update.operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(update.operation_uuid());
CHECK_SOME(uuid);
LOG(INFO) << "Updating the state of offer operation '"
@@ -10522,7 +10524,7 @@ void Master::_apply(
// This must have been validated by the caller.
CHECK(!resourceProviderId.isError());
- Option<UUID> resourceVersion = resourceProviderId.isSome()
+ Option<id::UUID> resourceVersion = resourceProviderId.isSome()
? slave->resourceVersions.get(resourceProviderId.get())
: slave->resourceVersions.get(None());
@@ -10570,7 +10572,8 @@ void Master::_apply(
message.mutable_resource_version_uuid()
->set_uuid(resourceVersion->toBytes());
- Try<UUID> operationUUID = UUID::fromBytes(offerOperation->operation_uuid());
+ Try<id::UUID> operationUUID =
+ id::UUID::fromBytes(offerOperation->operation_uuid());
CHECK_SOME(operationUUID);
LOG(INFO) << "Sending offer operation '"
@@ -11298,7 +11301,7 @@ void Master::Subscribers::Subscriber::send(
}
-void Master::exited(const UUID& id)
+void Master::exited(const id::UUID& id)
{
if (!subscribers.subscribed.contains(id)) {
LOG(WARNING) << "Unknown subscriber " << id << " disconnected";
@@ -11341,7 +11344,7 @@ Slave::Slave(
vector<SlaveInfo::Capability> _capabilites,
const Time& _registeredTime,
vector<Resource> _checkpointedResources,
- const Option<UUID>& resourceVersion,
+ const Option<id::UUID>& resourceVersion,
vector<ExecutorInfo> executorInfos,
vector<Task> tasks)
: master(_master),
@@ -11479,7 +11482,7 @@ void Slave::removeTask(Task* task)
void Slave::addOfferOperation(OfferOperation* operation)
{
- Try<UUID> uuid = UUID::fromBytes(operation->operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(operation->operation_uuid());
CHECK_SOME(uuid);
offerOperations.put(uuid.get(), operation);
@@ -11530,7 +11533,7 @@ void Slave::recoverResources(OfferOperation* operation)
void Slave::removeOfferOperation(OfferOperation* operation)
{
- Try<UUID> uuid = UUID::fromBytes(operation->operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(operation->operation_uuid());
CHECK_SOME(uuid);
CHECK(offerOperations.contains(uuid.get()))
@@ -11546,7 +11549,7 @@ void Slave::removeOfferOperation(OfferOperation* operation)
}
-OfferOperation* Slave::getOfferOperation(const UUID& uuid) const
+OfferOperation* Slave::getOfferOperation(const id::UUID& uuid) const
{
if (offerOperations.contains(uuid)) {
return offerOperations.at(uuid);
@@ -11651,7 +11654,7 @@ Try<Nothing> Slave::update(
const SlaveInfo& _info,
const string& _version,
const vector<SlaveInfo::Capability>& _capabilities,
- const Option<UUID>& resourceVersion)
+ const Option<id::UUID>& resourceVersion)
{
Try<Resources> resources = applyCheckpointedResources(
_info.resources(),
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 2d74ec4..004be71 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -116,15 +116,15 @@ struct Role;
struct Slave
{
- Slave(Master* const _master,
- SlaveInfo _info,
+Slave(Master* const _master,
+ SlaveInfo _info,
const process::UPID& _pid,
const MachineID& _machineId,
const std::string& _version,
std::vector<SlaveInfo::Capability> _capabilites,
const process::Time& _registeredTime,
std::vector<Resource> _checkpointedResources,
- const Option<UUID>& resourceVersion,
+ const Option<id::UUID>& resourceVersion,
std::vector<ExecutorInfo> executorInfos = std::vector<ExecutorInfo>(),
std::vector<Task> tasks = std::vector<Task>());
@@ -152,7 +152,7 @@ struct Slave
void removeOfferOperation(OfferOperation* operation);
- OfferOperation* getOfferOperation(const UUID& uuid) const;
+ OfferOperation* getOfferOperation(const id::UUID& uuid) const;
void addOffer(Offer* offer);
@@ -180,7 +180,7 @@ struct Slave
const SlaveInfo& info,
const std::string& _version,
const std::vector<SlaveInfo::Capability>& _capabilites,
- const Option<UUID>& resourceVersion);
+ const Option<id::UUID>& resourceVersion);
Master* const master;
const SlaveID id;
@@ -244,7 +244,7 @@ struct Slave
// Pending operations or terminal operations that have
// unacknowledged status updates on this agent.
- hashmap<UUID, OfferOperation*> offerOperations;
+ hashmap<id::UUID, OfferOperation*> offerOperations;
// Active offers on this slave.
hashset<Offer*> offers;
@@ -277,7 +277,7 @@ struct Slave
SlaveObserver* observer;
- hashmap<Option<ResourceProviderID>, UUID> resourceVersions;
+ hashmap<Option<ResourceProviderID>, id::UUID> resourceVersions;
hashmap<ResourceProviderID, ResourceProviderInfo> resourceProviders;
private:
@@ -299,7 +299,7 @@ struct HttpConnection
{
HttpConnection(const process::http::Pipe::Writer& _writer,
ContentType _contentType,
- UUID _streamId)
+ id::UUID _streamId)
: writer(_writer),
contentType(_contentType),
streamId(_streamId) {}
@@ -327,7 +327,7 @@ struct HttpConnection
process::http::Pipe::Writer writer;
ContentType contentType;
- UUID streamId;
+ id::UUID streamId;
};
@@ -559,7 +559,7 @@ protected:
void _exited(Framework* framework);
// Invoked upon noticing a subscriber disconnection.
- void exited(const UUID& id);
+ void exited(const id::UUID& id);
void agentReregisterTimeout(const SlaveID& slaveId);
Nothing _agentReregisterTimeout(const SlaveID& slaveId);
@@ -2015,7 +2015,7 @@ private:
// Active subscribers to the 'api/vX' endpoint keyed by the stream
// identifier.
- hashmap<UUID, process::Owned<Subscriber>> subscribed;
+ hashmap<id::UUID, process::Owned<Subscriber>> subscribed;
} subscribers;
hashmap<OfferID, Offer*> offers;
@@ -2462,7 +2462,7 @@ struct Framework
const FrameworkID& frameworkId = operation->framework_id();
- Try<UUID> uuid = UUID::fromBytes(operation->operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(operation->operation_uuid());
CHECK_SOME(uuid);
CHECK(!offerOperations.contains(uuid.get()))
@@ -2549,7 +2549,7 @@ struct Framework
void removeOfferOperation(OfferOperation* operation)
{
- Try<UUID> uuid = UUID::fromBytes(operation->operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(operation->operation_uuid());
CHECK_SOME(uuid);
CHECK(offerOperations.contains(uuid.get()))
@@ -2819,11 +2819,11 @@ struct Framework
// Pending operations or terminal operations that have
// unacknowledged status updates.
- hashmap<UUID, OfferOperation*> offerOperations;
+ hashmap<id::UUID, OfferOperation*> offerOperations;
// The map from the framework-specified operation ID to the
// corresponding internal operation UUID.
- hashmap<OfferOperationID, UUID> offerOperationUUIDs;
+ hashmap<OfferOperationID, id::UUID> offerOperationUUIDs;
// NOTE: For the used and offered resources below, we keep the
// total as well as partitioned by SlaveID.
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/master/validation.cpp
----------------------------------------------------------------------
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index a9b0805..7f5a67d 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -584,7 +584,7 @@ Option<Error> validate(
return Error("Expecting 'acknowledge' to be present");
}
- Try<UUID> uuid = UUID::fromBytes(call.acknowledge().uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(call.acknowledge().uuid());
if (uuid.isError()) {
return uuid.error();
}
@@ -597,7 +597,7 @@ Option<Error> validate(
"Expecting 'acknowledge_offer_operation_update' to be present");
}
- Try<UUID> uuid = UUID::fromBytes(
+ Try<id::UUID> uuid = id::UUID::fromBytes(
call.acknowledge_offer_operation_update().status_uuid());
if (uuid.isError()) {
return uuid.error();
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/messages/messages.cpp
----------------------------------------------------------------------
diff --git a/src/messages/messages.cpp b/src/messages/messages.cpp
index 56876f2..9efbe7f 100644
--- a/src/messages/messages.cpp
+++ b/src/messages/messages.cpp
@@ -110,7 +110,7 @@ ostream& operator<<(ostream& stream, const StatusUpdate& update)
if (update.has_uuid()) {
stream << " (Status UUID: "
- << stringify(UUID::fromBytes(update.uuid()).get()) << ")";
+ << stringify(id::UUID::fromBytes(update.uuid()).get()) << ")";
}
stream << " for task " << update.status().task_id();
@@ -130,12 +130,13 @@ ostream& operator<<(ostream& stream, const OfferOperationStatusUpdate& update)
if (update.status().has_status_uuid()) {
stream << " (Status UUID: "
- << stringify(UUID::fromBytes(update.status().status_uuid()).get())
+ << stringify(
+ id::UUID::fromBytes(update.status().status_uuid()).get())
<< ")";
}
stream << " for operation UUID "
- << stringify(UUID::fromBytes(update.operation_uuid()).get());
+ << stringify(id::UUID::fromBytes(update.operation_uuid()).get());
if (update.status().has_operation_id()) {
stream << " (framework-supplied ID '" << update.status().operation_id()
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/resource_provider/daemon.cpp
----------------------------------------------------------------------
diff --git a/src/resource_provider/daemon.cpp b/src/resource_provider/daemon.cpp
index f160a87..d0a8186 100644
--- a/src/resource_provider/daemon.cpp
+++ b/src/resource_provider/daemon.cpp
@@ -105,14 +105,14 @@ private:
struct ProviderData
{
ProviderData(const string& _path, const ResourceProviderInfo& _info)
- : path(_path), info(_info), version(UUID::random()) {}
+ : path(_path), info(_info), version(id::UUID::random()) {}
const string path;
ResourceProviderInfo info;
// The `version` is used to check if `provider` holds a resource
// provider instance that is in sync with the current config.
- UUID version;
+ id::UUID version;
Owned<LocalResourceProvider> provider;
};
@@ -128,7 +128,7 @@ private:
Future<Nothing> _launch(
const string& type,
const string& name,
- const UUID& version,
+ const id::UUID& version,
const Option<string>& authToken);
Future<Option<string>> generateAuthToken(const ResourceProviderInfo& info);
@@ -192,7 +192,7 @@ Future<bool> LocalResourceProviderDaemonProcess::add(
// with existing ad-hoc config files.
const string path = path::join(
configDir.get(),
- strings::join(".", info.type(), info.name(), UUID::random(), "json"));
+ strings::join(".", info.type(), info.name(), id::UUID::random(), "json"));
LOG(INFO) << "Creating new config file '" << path << "'";
@@ -243,7 +243,7 @@ Future<bool> LocalResourceProviderDaemonProcess::update(
data.info = info;
// Update `version` to indicate that the config has been updated.
- data.version = UUID::random();
+ data.version = id::UUID::random();
// Launch the resource provider if the daemon is already started.
if (slaveId.isSome()) {
@@ -425,7 +425,7 @@ Future<Nothing> LocalResourceProviderDaemonProcess::launch(
Future<Nothing> LocalResourceProviderDaemonProcess::_launch(
const string& type,
const string& name,
- const UUID& version,
+ const id::UUID& version,
const Option<string>& authToken)
{
// If the resource provider config is removed, abort the launch sequence.
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/resource_provider/http_connection.hpp
----------------------------------------------------------------------
diff --git a/src/resource_provider/http_connection.hpp b/src/resource_provider/http_connection.hpp
index 47686a8..207120a 100644
--- a/src/resource_provider/http_connection.hpp
+++ b/src/resource_provider/http_connection.hpp
@@ -220,7 +220,7 @@ protected:
LOG(INFO) << "New endpoint detected at " << endpoint.get();
- connectionId = UUID::random();
+ connectionId = id::UUID::random();
dispatch(self(), &Self::connect, connectionId.get());
}
@@ -229,7 +229,7 @@ protected:
.onAny(defer(self(), &Self::detected, lambda::_1));
}
- void connect(const UUID& _connectionId)
+ void connect(const id::UUID& _connectionId)
{
// It is possible that a new endpoint was detected while we were
// waiting to establish a connection with the old master.
@@ -253,7 +253,7 @@ protected:
}
void connected(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const process::Future<std::tuple<
process::http::Connection, process::http::Connection>>& _connections)
{
@@ -324,7 +324,7 @@ protected:
connectionId = None();
}
- void disconnected(const UUID& _connectionId, const std::string& failure)
+ void disconnected(const id::UUID& _connectionId, const std::string& failure)
{
// Ignore if the disconnection happened from an old stale connection.
if (connectionId != _connectionId) {
@@ -339,7 +339,7 @@ protected:
}
process::Future<Nothing> _send(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const Call& call,
const process::http::Response& response)
{
@@ -372,8 +372,8 @@ protected:
subscribed = SubscribedResponse(reader, std::move(decoder));
if (response.headers.contains("Mesos-Stream-Id")) {
- Try<UUID> uuid =
- UUID::fromString(response.headers.at("Mesos-Stream-Id"));
+ Try<id::UUID> uuid =
+ id::UUID::fromString(response.headers.at("Mesos-Stream-Id"));
CHECK_SOME(uuid);
@@ -553,8 +553,8 @@ private:
// while an attempt was in progress). This helps us in uniquely
// identifying the current connection instance and ignoring the
// stale instance.
- Option<UUID> connectionId;
- Option<UUID> streamId;
+ Option<id::UUID> connectionId;
+ Option<id::UUID> streamId;
process::Future<Option<process::http::URL>> detection;
};
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/resource_provider/manager.cpp
----------------------------------------------------------------------
diff --git a/src/resource_provider/manager.cpp b/src/resource_provider/manager.cpp
index 046dba7..d9e0d25 100644
--- a/src/resource_provider/manager.cpp
+++ b/src/resource_provider/manager.cpp
@@ -89,7 +89,7 @@ struct HttpConnection
{
HttpConnection(const http::Pipe::Writer& _writer,
ContentType _contentType,
- UUID _streamId)
+ id::UUID _streamId)
: writer(_writer),
contentType(_contentType),
streamId(_streamId),
@@ -116,7 +116,7 @@ struct HttpConnection
http::Pipe::Writer writer;
ContentType contentType;
- UUID streamId;
+ id::UUID streamId;
::recordio::Encoder<v1::resource_provider::Event> encoder;
};
@@ -144,7 +144,7 @@ struct ResourceProvider
ResourceProviderInfo info;
HttpConnection http;
- hashmap<UUID, Owned<Promise<Nothing>>> publishes;
+ hashmap<id::UUID, Owned<Promise<Nothing>>> publishes;
};
@@ -279,7 +279,7 @@ Future<http::Response> ResourceProviderManagerProcess::api(
ok.reader = pipe.reader();
// Generate a stream ID and return it in the response.
- UUID streamId = UUID::random();
+ id::UUID streamId = id::UUID::random();
ok.headers["Mesos-Stream-Id"] = streamId.toString();
HttpConnection http(pipe.writer(), acceptType, streamId);
@@ -350,7 +350,7 @@ void ResourceProviderManagerProcess::applyOfferOperation(
const Offer::Operation& operation = message.operation_info();
const FrameworkID& frameworkId = message.framework_id();
- Try<UUID> uuid = UUID::fromBytes(message.operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(message.operation_uuid());
if (uuid.isError()) {
LOG(ERROR) << "Failed to parse offer operation UUID for operation "
<< "'" << operation.id() << "' from framework "
@@ -534,7 +534,7 @@ Future<Nothing> ResourceProviderManagerProcess::publishResources(
foreachpair (const ResourceProviderID& resourceProviderId,
const Resources& resources,
providedResources) {
- UUID uuid = UUID::random();
+ id::UUID uuid = id::UUID::random();
Event event;
event.set_type(Event::PUBLISH_RESOURCES);
@@ -656,16 +656,16 @@ void ResourceProviderManagerProcess::updateState(
// TODO(chhsiao): Report pending operations.
- Try<UUID> resourceVersion =
- UUID::fromBytes(update.resource_version_uuid());
+ Try<id::UUID> resourceVersion =
+ id::UUID::fromBytes(update.resource_version_uuid());
CHECK_SOME(resourceVersion)
<< "Could not deserialize version of resource provider "
<< resourceProvider->info.id() << ": " << resourceVersion.error();
- hashmap<UUID, OfferOperation> offerOperations;
+ hashmap<id::UUID, OfferOperation> offerOperations;
foreach (const OfferOperation &operation, update.operations()) {
- Try<UUID> uuid = UUID::fromBytes(operation.operation_uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(operation.operation_uuid());
CHECK_SOME(uuid);
offerOperations.put(uuid.get(), operation);
@@ -693,7 +693,7 @@ void ResourceProviderManagerProcess::updatePublishResourcesStatus(
ResourceProvider* resourceProvider,
const Call::UpdatePublishResourcesStatus& update)
{
- Try<UUID> uuid = UUID::fromBytes(update.uuid());
+ Try<id::UUID> uuid = id::UUID::fromBytes(update.uuid());
if (uuid.isError()) {
LOG(ERROR) << "Invalid UUID in UpdatePublishResourcesStatus from resource"
<< " provider " << resourceProvider->info.id()
@@ -731,7 +731,7 @@ void ResourceProviderManagerProcess::updatePublishResourcesStatus(
ResourceProviderID ResourceProviderManagerProcess::newResourceProviderId()
{
ResourceProviderID resourceProviderId;
- resourceProviderId.set_value(UUID::random().toString());
+ resourceProviderId.set_value(id::UUID::random().toString());
return resourceProviderId;
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/resource_provider/message.hpp
----------------------------------------------------------------------
diff --git a/src/resource_provider/message.hpp b/src/resource_provider/message.hpp
index 137554a..bac3ffb 100644
--- a/src/resource_provider/message.hpp
+++ b/src/resource_provider/message.hpp
@@ -48,9 +48,9 @@ struct ResourceProviderMessage
struct UpdateState
{
ResourceProviderInfo info;
- UUID resourceVersion;
+ id::UUID resourceVersion;
Resources totalResources;
- hashmap<UUID, OfferOperation> offerOperations;
+ hashmap<id::UUID, OfferOperation> offerOperations;
};
struct UpdateOfferOperationStatus
@@ -95,8 +95,8 @@ inline std::ostream& operator<<(
CHECK_SOME(updateOfferOperationStatus);
- Try<UUID> operationUUID =
- UUID::fromBytes(updateOfferOperationStatus->update.operation_uuid());
+ Try<id::UUID> operationUUID = id::UUID::fromBytes(
+ updateOfferOperationStatus->update.operation_uuid());
CHECK_SOME(operationUUID);
return stream
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/sched/sched.cpp
----------------------------------------------------------------------
diff --git a/src/sched/sched.cpp b/src/sched/sched.cpp
index 72bd413..cce4633 100644
--- a/src/sched/sched.cpp
+++ b/src/sched/sched.cpp
@@ -1796,7 +1796,7 @@ MesosSchedulerDriver::MesosSchedulerDriver(
status(DRIVER_NOT_STARTED),
implicitAcknowlegements(true),
credential(nullptr),
- schedulerId("scheduler-" + UUID::random().toString())
+ schedulerId("scheduler-" + id::UUID::random().toString())
{
initialize();
}
@@ -1816,7 +1816,7 @@ MesosSchedulerDriver::MesosSchedulerDriver(
status(DRIVER_NOT_STARTED),
implicitAcknowlegements(true),
credential(new Credential(_credential)),
- schedulerId("scheduler-" + UUID::random().toString())
+ schedulerId("scheduler-" + id::UUID::random().toString())
{
initialize();
}
@@ -1836,7 +1836,7 @@ MesosSchedulerDriver::MesosSchedulerDriver(
status(DRIVER_NOT_STARTED),
implicitAcknowlegements(_implicitAcknowlegements),
credential(nullptr),
- schedulerId("scheduler-" + UUID::random().toString())
+ schedulerId("scheduler-" + id::UUID::random().toString())
{
initialize();
}
@@ -1857,7 +1857,7 @@ MesosSchedulerDriver::MesosSchedulerDriver(
status(DRIVER_NOT_STARTED),
implicitAcknowlegements(_implicitAcknowlegements),
credential(new Credential(_credential)),
- schedulerId("scheduler-" + UUID::random().toString())
+ schedulerId("scheduler-" + id::UUID::random().toString())
{
initialize();
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/scheduler/scheduler.cpp
----------------------------------------------------------------------
diff --git a/src/scheduler/scheduler.cpp b/src/scheduler/scheduler.cpp
index e354709..07d2b37 100644
--- a/src/scheduler/scheduler.cpp
+++ b/src/scheduler/scheduler.cpp
@@ -336,7 +336,7 @@ protected:
.onAny(defer(self(), &MesosProcess::detected, lambda::_1));
}
- void connect(const UUID& _connectionId)
+ void connect(const id::UUID& _connectionId)
{
// It is possible that a new master was detected while we were waiting
// to establish a connection with the old master.
@@ -361,7 +361,7 @@ protected:
}
void connected(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const Future<tuple<Connection, Connection>>& _connections)
{
// It is possible that a new master was detected while we had an ongoing
@@ -411,7 +411,7 @@ protected:
}
void disconnected(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const string& failure)
{
// Ignore if the disconnection happened from an old stale connection.
@@ -493,7 +493,7 @@ protected:
LOG(INFO) << "New master detected at " << upid;
- connectionId = UUID::random();
+ connectionId = id::UUID::random();
// Wait for a random duration between 0 and `flags.connectionDelayMax`
// before (re-)connecting with the master.
@@ -577,7 +577,7 @@ protected:
}
void __send(
- const UUID& _connectionId,
+ const id::UUID& _connectionId,
const Call& call,
const Future<process::http::Response>& response)
{
@@ -620,8 +620,8 @@ protected:
// Responses to SUBSCRIBE calls should always include a stream ID.
CHECK(response->headers.contains("Mesos-Stream-Id"));
- Try<UUID> uuid =
- UUID::fromString(response->headers.at("Mesos-Stream-Id"));
+ Try<id::UUID> uuid =
+ id::UUID::fromString(response->headers.at("Mesos-Stream-Id"));
CHECK_SOME(uuid);
@@ -832,7 +832,7 @@ private:
// the master (e.g., the master failed over while an attempt was in progress).
// This helps us in uniquely identifying the current connection instance and
// ignoring the stale instance.
- Option<UUID> connectionId; // UUID to identify the connection instance.
+ Option<id::UUID> connectionId; // UUID to identify the connection instance.
Option<Connections> connections;
Option<SubscribedResponse> subscribed;
@@ -844,7 +844,7 @@ private:
shared_ptr<MasterDetector> detector;
queue<Event> events;
Option<::URL> master;
- Option<UUID> streamId;
+ Option<id::UUID> streamId;
const Flags flags;
Owned<mesos::http::authentication::Authenticatee> authenticatee;
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index 229891d..890cb2a 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -147,7 +147,7 @@ Option<ContainerID> parse(const Docker::Container& container)
// Check if id is a valid UUID.
if (containerId.isSome()) {
- Try<UUID> uuid = UUID::fromString(containerId.get().value());
+ Try<id::UUID> uuid = id::UUID::fromString(containerId.get().value());
if (uuid.isError()) {
return None();
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/slave/containerizer/mesos/io/switchboard.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/io/switchboard.cpp b/src/slave/containerizer/mesos/io/switchboard.cpp
index 8a00e6d..af8fbe8 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -500,7 +500,7 @@ Future<Option<ContainerLaunchInfo>> IOSwitchboard::_prepare(
switchboardFlags.socket_path = path::join(
stringify(os::PATH_SEPARATOR),
"tmp",
- "mesos-io-switchboard-" + UUID::random().toString());
+ "mesos-io-switchboard-" + id::UUID::random().toString());
// Just before launching our io switchboard server, we need to
// create a directory to hold checkpointed files related to the
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/slave/containerizer/mesos/isolators/volume/secret.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/volume/secret.cpp b/src/slave/containerizer/mesos/isolators/volume/secret.cpp
index ba23519..8071e4e 100644
--- a/src/slave/containerizer/mesos/isolators/volume/secret.cpp
+++ b/src/slave/containerizer/mesos/isolators/volume/secret.cpp
@@ -124,7 +124,7 @@ Future<Option<ContainerLaunchInfo>> VolumeSecretIsolatorProcess::prepare(
const string sandboxSecretRootDir =
path::join(containerConfig.directory(),
- SECRET_DIR + string("-") + stringify(UUID::random()));
+ SECRET_DIR + string("-") + stringify(id::UUID::random()));
// TODO(Kapil): Add some UUID suffix to the secret-root dir to avoid conflicts
// with user container_path.
@@ -236,7 +236,7 @@ Future<Option<ContainerLaunchInfo>> VolumeSecretIsolatorProcess::prepare(
}
const string hostSecretPath =
- path::join(flags.runtime_dir, SECRET_DIR, stringify(UUID::random()));
+ path::join(flags.runtime_dir, SECRET_DIR, stringify(id::UUID::random()));
const string sandboxSecretPath =
path::join(sandboxSecretRootDir,
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/slave/containerizer/mesos/provisioner/provisioner.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/provisioner.cpp b/src/slave/containerizer/mesos/provisioner/provisioner.cpp
index a177744..61e7718 100644
--- a/src/slave/containerizer/mesos/provisioner/provisioner.cpp
+++ b/src/slave/containerizer/mesos/provisioner/provisioner.cpp
@@ -535,7 +535,7 @@ Future<ProvisionInfo> ProvisionerProcess::_provision(
{
CHECK(backends.contains(backend));
- string rootfsId = UUID::random().toString();
+ string rootfsId = id::UUID::random().toString();
string rootfs = provisioner::paths::getContainerRootfsDir(
rootDir,
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/slave/paths.cpp
----------------------------------------------------------------------
diff --git a/src/slave/paths.cpp b/src/slave/paths.cpp
index f9f0c78..fca2a0e 100644
--- a/src/slave/paths.cpp
+++ b/src/slave/paths.cpp
@@ -556,13 +556,13 @@ Try<list<string>> getOfferOperationPaths(
string getOfferOperationPath(
const string& rootDir,
- const UUID& operationUuid)
+ const id::UUID& operationUuid)
{
return path::join(rootDir, OFFER_OPERATIONS_DIR, operationUuid.toString());
}
-Try<UUID> parseOfferOperationPath(
+Try<id::UUID> parseOfferOperationPath(
const string& rootDir,
const string& dir)
{
@@ -578,7 +578,7 @@ Try<UUID> parseOfferOperationPath(
prefix + "'");
}
- Try<UUID> operationUuid = UUID::fromString(Path(dir).basename());
+ Try<id::UUID> operationUuid = id::UUID::fromString(Path(dir).basename());
if (operationUuid.isError()) {
return Error(
"Could not decode offer operation UUID from string '" +
@@ -591,7 +591,7 @@ Try<UUID> parseOfferOperationPath(
string getOfferOperationUpdatesPath(
const string& rootDir,
- const UUID& operationUuid)
+ const id::UUID& operationUuid)
{
return path::join(
getOfferOperationPath(rootDir, operationUuid),
http://git-wip-us.apache.org/repos/asf/mesos/blob/7467c810/src/slave/paths.hpp
----------------------------------------------------------------------
diff --git a/src/slave/paths.hpp b/src/slave/paths.hpp
index bae68d0..9cbacd8 100644
--- a/src/slave/paths.hpp
+++ b/src/slave/paths.hpp
@@ -359,17 +359,17 @@ Try<std::list<std::string>> getOfferOperationPaths(
std::string getOfferOperationPath(
const std::string& rootDir,
- const UUID& operationUuid);
+ const id::UUID& operationUuid);
-Try<UUID> parseOfferOperationPath(
+Try<id::UUID> parseOfferOperationPath(
const std::string& rootDir,
const std::string& dir);
std::string getOfferOperationUpdatesPath(
const std::string& rootDir,
- const UUID& operationUuid);
+ const id::UUID& operationUuid);
std::string getResourcesInfoPath(