com.yahoo.vespa.hosted.provision.backup.SnapshotStoreMock Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of node-repository Show documentation
Show all versions of node-repository Show documentation
Keeps track of node assignment in a multi-application setup.
The newest version!
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.provision.backup;
import com.yahoo.config.provision.CloudAccount;
import com.yahoo.config.provision.HostName;
import com.yahoo.config.provision.SnapshotId;
import com.yahoo.vespa.hosted.provision.provisioning.SnapshotStore;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/**
* @author mpolden
*/
public class SnapshotStoreMock implements SnapshotStore {
private final Set snapshots = new HashSet<>();
public SnapshotStoreMock add(SnapshotId snapshot) {
snapshots.add(snapshot);
return this;
}
public Set list() {
return Collections.unmodifiableSet(snapshots);
}
@Override
public void delete(SnapshotId snapshot, HostName hostname, CloudAccount cloudAccount) {
snapshots.remove(snapshot);
}
}