fixed windows compile issues

This commit is contained in:
Evan Tschannen 2017-12-20 13:48:31 -08:00
parent c1958b335a
commit c51de3bb88
5 changed files with 20 additions and 16 deletions

View File

@ -388,7 +388,7 @@ public:
// No logs needed if there is a complete key space snapshot at a single version.
if(snapshot.get().beginVersion == snapshot.get().endVersion)
return restorable;
return Optional<RestorableFileSet>(restorable);
std::vector<LogFile> logs = wait(bc->listLogFiles(snapshot.get().beginVersion, targetVersion));
@ -410,7 +410,7 @@ public:
}
if(end >= targetVersion) {
return restorable;
return Optional<RestorableFileSet>(restorable);
}
}
}
@ -837,7 +837,7 @@ Reference<IBackupContainer> IBackupContainer::openContainer(std::string url)
// Get a list of URLS to backup containers based on some a shorter URL. This function knows about some set of supported
// URL types which support this sort of backup discovery.
ACTOR Future<std::vector<std::string>> IBackupContainer::listContainers(std::string baseURL) {
ACTOR Future<std::vector<std::string>> listContainers_impl(std::string baseURL) {
try {
StringRef u(baseURL);
if(u.startsWith(LiteralStringRef("file://"))) {
@ -873,6 +873,10 @@ ACTOR Future<std::vector<std::string>> IBackupContainer::listContainers(std::str
}
}
Future<std::vector<std::string>> IBackupContainer::listContainers(std::string baseURL) {
return listContainers_impl(baseURL);
}
ACTOR Future<Void> writeAndVerifyFile(Reference<IBackupContainer> c, Reference<IBackupFile> f) {
state Standalone<StringRef> content = makeString(g_random->randomInt(0, 10000000));
for(int i = 0; i < content.size(); ++i)
@ -880,10 +884,10 @@ ACTOR Future<Void> writeAndVerifyFile(Reference<IBackupContainer> c, Reference<I
Void _ = wait(f->append(content.begin(), content.size()));
Void _ = wait(f->finish());
state Reference<IAsyncFile> in = wait(c->readFile(f->getFileName()));
int64_t size = wait(in->size());
state Reference<IAsyncFile> inputFile = wait(c->readFile(f->getFileName()));
int64_t size = wait(inputFile->size());
state Standalone<StringRef> buf = makeString(size);
int b = wait(in->read(mutateString(buf), buf.size(), 0));
int b = wait(inputFile->read(mutateString(buf), buf.size(), 0));
ASSERT(b == buf.size());
ASSERT(buf == content);
return Void();

View File

@ -169,7 +169,7 @@ public:
// Get an IBackupContainer based on a container spec string
static Reference<IBackupContainer> openContainer(std::string url);
static std::vector<std::string> getURLFormats();
static Future<std::vector<std::string>> listContainers(std::string const &baseURL);
static Future<std::vector<std::string>> listContainers(std::string baseURL);
std::string getURL() const {
return URL;

View File

@ -835,7 +835,7 @@ namespace fileBackup {
Params.endKey().set(task, end);
Params.addBackupRangeTasks().set(task, false);
if(scheduledVersion != invalidVersion)
ReservedTaskParams.scheduledVersion().set(task, scheduledVersion);
ReservedTaskParams::scheduledVersion().set(task, scheduledVersion);
},
priority));
return key;
@ -1026,7 +1026,7 @@ namespace fileBackup {
waitFor,
[=](Reference<Task> task) {
if(scheduledVersion != invalidVersion)
ReservedTaskParams.scheduledVersion().set(task, scheduledVersion);
ReservedTaskParams::scheduledVersion().set(task, scheduledVersion);
},
priority));
return key;

View File

@ -138,12 +138,12 @@ public:
// Get a task key that is <= a random UID task key, if successful then return it
Key k = wait(tr->getKey(lastLessOrEqual(space.pack(uid)), true));
if(space.contains(k))
return k;
return Optional<Key>(k);
// Get a task key that is <= the maximum possible UID, if successful return it.
Key k = wait(tr->getKey(lastLessOrEqual(space.pack(maxUIDKey)), true));
if(space.contains(k))
return k;
return Optional<Key>(k);
return Optional<Key>();
}
@ -389,13 +389,13 @@ public:
}));
}
} catch(Error &e) {
state Error e2 = e;
TraceEvent(SevWarn, "TB_ExecuteFailure")
.detail("TaskUID", task->key.printable())
.detail("TaskType", task->params[Task::reservedTaskParamKeyType].printable())
.detail("Priority", task->getPriority())
.error(e);
try {
state Error e2 = e;
Void _ = wait(taskFunc->handleError(cx, task, e2));
} catch(Error &e) {
TraceEvent(SevWarn, "TB_ExecuteFailureLogErrorFailed")
@ -809,7 +809,7 @@ Key TaskBucket::addTask(Reference<ReadYourWritesTransaction> tr, Reference<Task>
// If scheduledVersion is valid then place the task directly into the timeout
// space for its scheduled time, otherwise place it in the available space by priority.
Version scheduledVersion = ReservedTaskParams.scheduledVersion().getOrDefault(task, invalidVersion);
Version scheduledVersion = ReservedTaskParams::scheduledVersion().getOrDefault(task, invalidVersion);
if(scheduledVersion != invalidVersion) {
taskSpace = timeouts.get(scheduledVersion).get(key);
}

View File

@ -95,11 +95,11 @@ public:
StringRef key;
};
struct {
TaskParam<Version> scheduledVersion() {
struct ReservedTaskParams {
static TaskParam<Version> scheduledVersion() {
return LiteralStringRef(__FUNCTION__);
}
} ReservedTaskParams;
};
class FutureBucket;